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

Rocksdb text prefix indexes return wrong results

    XMLWordPrintable

Details

    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:
            0 Vote for this issue
            Watchers:
            2 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.