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

Rocksdb text prefix indexes return wrong results

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3.22, 10.4.12, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5(EOL)
    • 10.6
    • None
    • Tested on 10.3 on Debian and 10.4 on Gentoo
    • Q2/2026 Server Maintenance

    Description

      Rows are missing from the output when searching by indexed text column when the value is longer than the index's prefix length. Using "like 'prefix%'" only works when the prefix is shorter than the index's length (or equal, if value=prefix).
      Deleting the index, using ignore index or converting the table to another engine gives expected results.
      The issue seems to only happen when using utf8/utf8mb4/utf16/utf32 collations, latin1/ascii/ucs2 collations work correctly.

      create table tt5 (tx text) engine=rocksdb;
      insert into tt5 values ('long text');
      select * from tt5 where tx='long text';      # returns the row
      create index z on tt5(tx(3));
      select * from tt5 where tx='long text';      # empty result
      select * from tt5 where tx like 'long text'; # also empty
      select * from tt5 where tx like 'lon%';      # empty
      select * from tt5 where tx like 'lo%';       # this returns the row again
      

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            antihutka Michal Povinsky
            Votes:
            1 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.