Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26315

Group aggregation with sql_big_result returns wrong result on Spider

    XMLWordPrintable

Details

    Description

      How to repeat

      CREATE TABLE t3 (
        spID int(10) unsigned,
        userID int(10) unsigned,
        score smallint(5) unsigned,
        key (spid),
        key (score)
      )ENGINE=SPIDER COMMENT='wrapper "mysql", table "t3"'
      PARTITION BY LIST (spID%2)
      (
          PARTITION pt0 VALUES IN (0) COMMENT = 'database "test1_0", table "t3", server "SPT0"',
          PARTITION pt1 VALUES IN (1) COMMENT = 'database "test1_1", table "t3", server "SPT1"'
      );
       
      INSERT INTO t3 VALUES
      (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3),(6,3,3),(7,3,3);
       
      select sql_big_result spid,sum(userid) from t3 group by spid
      desc; --bug
      

      The result of the final SELECT is

      select sql_big_result spid,sum(userid) from t3 group by spid
          -> desc;
      +------+-------------+
      | spid | sum(userid) |
      +------+-------------+
      |    7 |           3 |
      |    6 |           3 |
      |    5 |           3 |
      |    4 |           3 |
      |    3 |           3 |
      |    2 |           2 | --> sum(userid) should be 3 here!
      |    1 |           1 |
      +------+-------------+
      7 rows in set (0.20 sec)
      

      Solution

      We solve the problem by simply prohibiting `sql_big_result` from using on the Spider SE.
      https://github.com/Tencent/TenDBCluster-TSpider/commit/01c278b6b1b27ce95a8ecc30b0bc9dd90d8abd70

      Attachments

        Activity

          People

            ycp Yuchen Pei
            Yongxin Xu Yongxin Xu
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.