Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-6074

NO_PAD collations should not use the space padded encoding

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 8.0.12-2rc1, Not 5.6.x, Not 5.7.x
    • Fix Version/s: None
    • Component/s: MyRocks
    • Labels:
      None

      Description

      The new NO_PAD collations should not use the space padded encoding. Instead, it should use the NO_PAD encodings.

       

      In 5.6, only binary was NO_PAD and the NO_PAD encoding callback was called `Rdb_key_def::pack_variable_format`. The space padded encoding was called `Rdb_key_def::pack_with_varchar_encoding`. For varchars, NO_PAD collations should call `Rdb_key_def::pack_variable_format`

       

      I only demonstrate unique key violations below, but the encoding also has implications for sort order as well (they are slightly different).

       

      varchar:

       

      mysql> create table t (v varchar(100) primary key) engine=rocksdb;
      Query OK, 0 rows affected, 1 warning (0.01 sec)
      mysql> insert into t values ("a");
      Query OK, 1 row affected (0.01 sec)
      // Not expected for NO_PAD collations
      mysql> insert into t values ("a ");
      ERROR 1062 (23000): Duplicate entry 'a ' for key 'PRIMARY'
      

       

       

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  mung Manuel
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated: