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

spider: inconsistent treatment of descending index between usual and group by handlers

    XMLWordPrintable

Details

    Description

      The spider gbh simply passes the query to the remote table with only table name translation.

      Without gbh, it may translate descending indexes to ORDER BY ... DESC in index_first.

      To see the bug, simply run mtrr --mysqld=--loose-spider-disable-group-by-handler spider/bugfix.index

      10.11 fd39c63b416c4c4f8bfff6c3935fda159a25faee

      # [... 20 lines elided]
      spider/bugfix.index                      [ fail ]
              Test ended at 2025-09-05 14:23:38
       
      CURRENT_TEST: spider/bugfix.index
      --- /home/ycp/source/mariadb-server/10.11/src/storage/spider/mysql-test/spider/bugfix/r/index.result	2024-06-21 13:50:21.429397065 +1000
      +++ /home/ycp/source/mariadb-server/10.11/src/storage/spider/mysql-test/spider/bugfix/r/index.reject	2025-09-05 14:23:37.726423015 +1000
      @@ -16,12 +16,12 @@
       insert into t_sp1 () values (),(),();
       select * from t_sp1;
       id
      -1
      -2
      -3
      -4
      -5
       6
      +5
      +4
      +3
      +2
      +1
       drop table t_sp1, auto_test_local.t;
       #
       # MDEV-27581 Wrong result with DESC key on partitioned Spider table
       
      Result content mismatch
      

      Here id is the primary key column with a descending index, whereas the remote table has the same definition except that id does not have descending index.

      Perhaps spider should check the definition of spider table against the remote table, and error out with incompatibilities like this. I think there is an MDEV somewhere with this proposal...

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              ycp Yuchen Pei
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.