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

Different ASC/DESC index attributes on MERGE and underlying table can cause wrong results

    XMLWordPrintable

    Details

      Description

      Currently MERGE and underlying MyISAM tables are allowed to have different ASC/DESC attributes on corresponding indexes. It can cause wrong results, at least for ORDER BY:

      create or replace table t (a int, key(a desc)) engine=MyISAM;
      create or replace table tm (a int, key(a)) engine=Merge union(t);
      insert into t values (1),(5),(3);
       
      # From the underlying table -- OK
      select * from t force index for order by (a) order by a;
      # From the MERGE table -- not OK
      select * from tm force index for order by (a) order by a;
       
      # Cleanup
      drop table tm, t;
      

      preview-10.8-MDEV-13756-desc-indexes 49b38c82a

      select * from tm force index for order by (a) order by a;
      a
      5
      3
      1
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration

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