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

NULL gets lost (becomes empty string), SELECT hangs with DESC index on MyISAM/Aria table

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: 10.8.1
    • Component/s: Server
    • Labels:
      None

      Description

      SET max_statement_time= 2; # Just so that if it hangs, then not forever
       
      DROP TABLE IF EXISTS t3;
      CREATE TABLE t (c CHAR(8), KEY(c DESC)) ENGINE=MyISAM CHARACTER SET utf8mb4;
      INSERT INTO t VALUES (''),('foo'),(NULL),(''),('bar');
      SELECT DISTINCT c FROM t;
      SELECT c FROM t;
       
      # Cleanup
      DROP TABLE t;
      

      The first query returns three values, without NULL:

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

      SELECT DISTINCT c FROM t;
      c
       
      bar
      foo
      

      If count is added, it claims there are 3 empty strings instead of 2.
      The second query, plain SELECT without DISTINCT, hangs (subject to max_statement_time).

      Reproducible with MyISAM and Aria. Not reproducible with InnoDB.
      Reproducible with big5, utf8mb4, utf8mb3. Not reproducible with latin1. I didn't try other charsets.
      Not reproducible without DESC index.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              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.