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

prefix index causes incorrect range query result

    XMLWordPrintable

Details

    • Q3/2026 Server Maintenance, Q4/2026 Server Maintenance

    Description

      The same SELECT statement returned different results after I dropped the index on the datatype LONGTEXT;

      DROP DATABASE IF EXISTS test;
      CREATE DATABASE test;
      USE test;
       
      CREATE TABLE `t0` (
      `c0` LONGTEXT,
      KEY `i0` (`c0`(1))
      ) ;
       
      INSERT INTO t0(c0) VALUES ('꙰dcF');
      REPLACE INTO t0(c0) VALUES ('kER');
       
      SELECT ALL t0.c0 FROM t0 WHERE 'C0' <= t0.c0; --{kER}
      DROP INDEX i0 ON t0;
      SELECT ALL t0.c0 FROM t0 WHERE 'C0' <= t0.c0; --{꙰dcF,kER}
      

      Attachments

        Issue Links

          Activity

            People

              raghunandan.bhat Raghunandan Bhat
              liufan liufan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Time Spent - 1d 5.25h Remaining Estimate - 2.75h
                  2.75h
                  Logged:
                  Time Spent - 1d 5.25h Remaining Estimate - 2.75h
                  1d 5.25h

                  Git Integration

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