Skip to content

Incorrect indexed lookup of strings when the last keys characters are part of collated contractions and there is multi-segment insensitive descending index #7094

@asfernandes

Description

@asfernandes

Test case:

create collation unicode_ci_cz for utf8 from unicode case insensitive 'LOCALE=cs_CZ';

create table t1 (
    c1 varchar(10) character set utf8 collate unicode_ci_cz,
    c2 varchar(10) character set utf8 collate unicode_ci_cz
);

insert into t1 (c1) values ('a');
insert into t1 (c1) values ('b');
insert into t1 (c1) values ('c');
insert into t1 (c1) values ('ch');
insert into t1 (c1) values ('d');
insert into t1 (c1) values ('e');
insert into t1 (c1) values ('f');
update t1 set c2 = c1;
commit;

create desc index t1_c1_c2_desc on t1 (c1, c2);


select * from t1 where c1 > 'c' order by c1, c2;

-- No data


select * from t1 where c1 > 'c' plan (t1 natural) order by c1, c2;

/*
C1         C2         
========== ========== 
d          d          
e          e          
f          f          
ch         ch         
*/

This relates to #7093

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions