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

Bad result set when using prefix keys and characters less than space

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
    • 10.1, 10.3
    • Character Sets
    • None

    Description

      This script correctly returns one row:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
      INSERT INTO t1 VALUES ('a'),('a\t'),('az'),('b'),('c'),('d'),('e');
      SELECT * FROM t1 WHERE a<'a';

      +------+
      | a    |
      +------+
      | a	   |
      +------+
      1 row in set (0.00 sec)

      Now if I add a prefix index and re-run the select query:

      ALTER TABLE t1 ADD KEY a(a(1));
      SELECT * FROM t1 WHERE a<'a';

      it erroneously returns empty set.

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.