Skip to content

Commit 4309b20

Browse files
author
Mattias Jonsson
committed
Bug#48737: Partitions: search fails with ucs2
Recommit of patch: http://lists.mysql.com/commits/91400 Test case only (code part was pushes as bug-49028)
1 parent 858cf55 commit 4309b20

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

mysql-test/r/partition_column.result

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,30 @@ partition by range columns (a,b,c)
99
( partition p0 values less than (1, maxvalue, 10),
1010
partition p1 values less than (1, maxvalue, maxvalue));
1111
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
12+
create table t1 (a varchar(5) character set ucs2 collate ucs2_bin)
13+
partition by range columns (a)
14+
(partition p0 values less than (0x0041));
15+
insert into t1 values (0x00410000);
16+
select hex(a) from t1 where a like 'A_';
17+
hex(a)
18+
00410000
19+
explain partitions select hex(a) from t1 where a like 'A_';
20+
id select_type table partitions type possible_keys key key_len ref rows Extra
21+
1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
22+
alter table t1 remove partitioning;
23+
select hex(a) from t1 where a like 'A_';
24+
hex(a)
25+
00410000
26+
create index a on t1 (a);
27+
select hex(a) from t1 where a like 'A_';
28+
hex(a)
29+
00410000
30+
insert into t1 values ('A_');
31+
select hex(a) from t1;
32+
hex(a)
33+
00410000
34+
0041005F
35+
drop table t1;
1236
create table t1 (a varchar(1) character set latin1 collate latin1_general_ci)
1337
partition by range columns(a)
1438
( partition p0 values less than ('a'),

mysql-test/t/partition_column.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ partition by range columns (a,b,c)
2323
( partition p0 values less than (1, maxvalue, 10),
2424
partition p1 values less than (1, maxvalue, maxvalue));
2525

26+
#
27+
# BUG#48737, Search fails with ucs2
28+
#
29+
create table t1 (a varchar(5) character set ucs2 collate ucs2_bin)
30+
partition by range columns (a)
31+
(partition p0 values less than (0x0041));
32+
insert into t1 values (0x00410000);
33+
select hex(a) from t1 where a like 'A_';
34+
explain partitions select hex(a) from t1 where a like 'A_';
35+
alter table t1 remove partitioning;
36+
select hex(a) from t1 where a like 'A_';
37+
create index a on t1 (a);
38+
select hex(a) from t1 where a like 'A_';
39+
insert into t1 values ('A_');
40+
select hex(a) from t1;
41+
drop table t1;
42+
2643
#
2744
# BUG#48161, Delivering too few records using collate syntax with partitions
2845
#

0 commit comments

Comments
 (0)