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

Inconsistent query result caused by index

    XMLWordPrintable

Details

    • Q3/2025 Maintenance, Q4/2025 Server Maintenance

    Description

      I run the following cases, which are expected to return the same query result.

      -- case 1
      CREATE TABLE t1 (c1 TEXT) ENGINE=InnoDB;
      INSERT INTO t1 (c1) VALUES ('a');
      SELECT c1 FROM t1 WHERE CAST(c1 AS BINARY(7)) NOT IN (SELECT c1 FROM t1); -- {a}
      

      -- case 2
      CREATE TABLE t1 (c1 TEXT, UNIQUE (c1(1))) ENGINE=InnoDB;
      INSERT INTO t1 (c1) VALUES ('a');
      SELECT c1 FROM t1 WHERE CAST(c1 AS BINARY(7)) NOT IN (SELECT c1 FROM t1); -- actual: {}, expected: {a}
      

      Attachments

        Issue Links

          Activity

            People

              Gosselin Dave Gosselin
              John Jove John Jove
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.