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

Wrong sorting order with DESC index and empty strings in MyISAM/Aria table

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • N/A
    • 10.8.1
    • Server
    • None

    Description

      CREATE TABLE t (id int, c char(128) NOT NULL, KEY (c DESC)) ENGINE=MyISAM CHARSET latin1;
      INSERT INTO t VALUES (1,''),(2,'foo'),(3,''),(4,'bar');
       
      SELECT c FROM t ORDER BY c;
       
      # Cleanup
      DROP TABLE t;
      

      preview-10.8-MDEV-13756-desc-indexes 47c18283

      MariaDB [test]> SELECT c FROM t ORDER BY c;
      +-----+
      | c   |
      +-----+
      | bar |
      | foo |
      |     |
      |     |
      +-----+
      4 rows in set (0.000 sec)
      

      So, the empty strings go last, contrary to the expectation.
      Reproducible with MyISAM and Aria.
      Not reproducible with InnoDB.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Sergei Golubchik made transition -
            Open In Progress
            9h 49m 1
            Sergei Golubchik made transition -
            In Progress Stalled
            2h 38m 1
            Sergei Golubchik made transition -
            Stalled In Testing
            6d 8h 17m 1
            Sergei Golubchik made transition -
            In Testing Closed
            29d 23h 30m 1

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.