Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL)
-
None
Description
MyRocks collation support assumes the collation has PAD attribute (except for BINARY/VARBINARY). It was actually quite difficult to achieve this.
Then, MariaDB got some collations that have NOPAD attribute. MyRocks code needs to be adjusted to handle that.
Probably the easiest first step is to just disallow indexed NOPAD columns for MyRocks tables.
Then, the second step would be to actually enable support for them
Steps to reproduce.
Let's take MyISAM to see how it is supposed to work:
create table t21 (pk varchar(10) collate latin1_nopad_bin , primary key(pk)) engine=myisam;
Query OK, 0 rows affected (0.06 sec)
MariaDB [test]> insert into t21 values ('a');
Query OK, 1 row affected (0.03 sec)
MariaDB [test]> insert into t21 values ('a ');
Query OK, 1 row affected (0.03 sec)
And this is what happens:
set global rocksdb_strict_collation_check=off;
create table t20 (pk varchar(10) collate latin1_nopad_bin , primary key(pk)) engine=rocksdb;
Query OK, 0 rows affected (0.16 sec)
MariaDB [test]> insert into t20 values ('a');
Query OK, 1 row affected (0.06 sec)
MariaDB [test]> insert into t20 values ('a ');
ERROR 1062 (23000): Duplicate entry 'a ' for key 'PRIMARY'
endspace is stripped, this is why we get an error.