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

Inconsistent SQL Query Results Due to Indexing and Special Character '֣' Handling

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.4.2, 10.11, 11.0(EOL), 11.2(EOL), 11.4, 11.5(EOL)
    • 10.11, 11.4
    • None
    • None
    • ubuntu 20.04

    Description

      In the following example, sql1 differs from sql2 in whether an index is created. This theoretically does not change the content of the result. There is a difference on the character '֣' between sql1 and sql3, which results in different results. I think there are some bugs in the indexing and handling of the '֣' character

      --sql1
      DROP TABLE IF EXISTS t0;
      CREATE TABLE t0(c0 TEXT);
      INSERT INTO t0(c0) VALUES(0);
      CREATE INDEX i0 ON t0(c0(1));
      SELECT * FROM t0 WHERE t0.c0 NOT BETWEEN '֣k' AND NULL; 
      --Empty set (0.00 sec)
       
      --sql2
      DROP TABLE IF EXISTS t0;
      CREATE TABLE t0(c0 TEXT);
      INSERT INTO t0(c0) VALUES(0);
      SELECT * FROM t0 WHERE t0.c0 NOT BETWEEN '֣k' AND NULL; 
      +------+
      | c0   |
      +------+
      | 0    |
      +------+
      1 row in set (0.00 sec)
       
      --sql3
      DROP TABLE IF EXISTS t0;
      CREATE TABLE t0(c0 TEXT);
      INSERT INTO t0(c0) VALUES(0);
      CREATE INDEX i0 ON t0(c0(1));
      SELECT * FROM t0 WHERE t0.c0 NOT BETWEEN 'k' AND NULL; 
      +------+
      | c0   |
      +------+
      | 0    |
      +------+
      1 row in set (0.00 sec)
      
      

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            Wangdada HeShan
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.