#At file:///home/mikael/mysql_clones/mysql-trunk-bug48737/ based on revid:alik@ibmvm-20091112022039-0oy0n7ns4ctd1zpp
2922 Mikael Ronstrom 2009-11-24
BUG#48737, Wrong LIKE range for ucs2 with partitions
modified:
mysql-test/r/partition_column.result
mysql-test/t/partition_column.test
strings/ctype-ucs2.c
=== modified file 'mysql-test/r/partition_column.result'
--- a/mysql-test/r/partition_column.result 2009-11-10 08:34:26 +0000
+++ b/mysql-test/r/partition_column.result 2009-11-24 11:25:28 +0000
@@ -1,4 +1,28 @@
drop table if exists t1;
+create table t1 (a varchar(5) character set ucs2 collate ucs2_bin)
+partition by range columns (a)
+(partition p0 values less than (0x0041));
+insert into t1 values (0x00410000);
+select hex(a) from t1 where a like 'A_';
+hex(a)
+00410000
+explain partitions select hex(a) from t1 where a like 'A_';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
+alter table t1 remove partitioning;
+select hex(a) from t1 where a like 'A_';
+hex(a)
+00410000
+create index a on t1 (a);
+select hex(a) from t1 where a like 'A_';
+hex(a)
+00410000
+insert into t1 values ('A_');
+select hex(a) from t1;
+hex(a)
+00410000
+0041005F
+drop table t1;
create table t1 (a varchar(1) character set latin1 collate latin1_general_ci)
partition by range columns(a)
( partition p0 values less than ('a'),
=== modified file 'mysql-test/t/partition_column.test'
--- a/mysql-test/t/partition_column.test 2009-11-06 10:49:27 +0000
+++ b/mysql-test/t/partition_column.test 2009-11-24 11:25:28 +0000
@@ -9,6 +9,23 @@ drop table if exists t1;
--enable_warnings
#
+# BUG#48737, Search fails with ucs2
+#
+create table t1 (a varchar(5) character set ucs2 collate ucs2_bin)
+partition by range columns (a)
+(partition p0 values less than (0x0041));
+insert into t1 values (0x00410000);
+select hex(a) from t1 where a like 'A_';
+explain partitions select hex(a) from t1 where a like 'A_';
+alter table t1 remove partitioning;
+select hex(a) from t1 where a like 'A_';
+create index a on t1 (a);
+select hex(a) from t1 where a like 'A_';
+insert into t1 values ('A_');
+select hex(a) from t1;
+drop table t1;
+
+#
# BUG#48161, Delivering too few records using collate syntax with partitions
#
# Test case from BUG#48447 with some extension
=== modified file 'strings/ctype-ucs2.c'
--- a/strings/ctype-ucs2.c 2009-09-30 05:09:28 +0000
+++ b/strings/ctype-ucs2.c 2009-11-24 11:25:28 +0000
@@ -1602,16 +1602,6 @@ fill_max_and_min:
*min_str++= *max_str++ = ptr[1];
}
- /* Temporary fix for handling w_one at end of string (key compression) */
- {
- char *tmp;
- for (tmp= min_str ; tmp-1 > min_org && tmp[-1] == '\0' && tmp[-2]=='\0';)
- {
- *--tmp=' ';
- *--tmp='\0';
- }
- }
-
*min_length= *max_length = (size_t) (min_str - min_org);
while (min_str + 1 < min_end)
{
Attachment: [text/bzr-bundle] bzr/mikael@mysql.com-20091124112528-25rdl7mj7qs619dg.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5-trunk branch (mikael:2922) Bug#48737 | Mikael Ronstrom | 24 Nov |