summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorlars/lthalmann@mysql.com/dl145h.mysql.com <>2006-10-25 17:08:57 +0200
committerlars/lthalmann@mysql.com/dl145h.mysql.com <>2006-10-25 17:08:57 +0200
commit31abddb5e1c8e092895414dede87e25daad2fd78 (patch)
tree57d9243f53489b77fb5dfd83e2d17f5278d73d89 /mysql-test
parent0612a212d129501436025403787c48f74879b00a (diff)
parenta55b0cbc348651c74a040a7495a495fea1267961 (diff)
downloadmariadb-git-31abddb5e1c8e092895414dede87e25daad2fd78.tar.gz
Merge mysql.com:/users/lthalmann/bkroot/mysql-4.1-rpl
into mysql.com:/users/lthalmann/bk/MERGE/mysql-4.1-merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ctype_ucs.result22
-rw-r--r--mysql-test/t/ctype_ucs.test18
2 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 642a0fc13b5..bf827209795 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -715,6 +715,28 @@ lily
river
drop table t1;
deallocate prepare stmt;
+create table t1 (
+a char(10) unicode not null,
+index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x201f, 10));
+insert into t1 values (repeat(0x2020, 10));
+insert into t1 values (repeat(0x2021, 10));
+explain select hex(a) from t1 order by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 20 NULL 3 Using index
+select hex(a) from t1 order by a;
+hex(a)
+201F201F201F201F201F201F201F201F201F201F
+2020202020202020202020202020202020202020
+2021202120212021202120212021202120212021
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+hex(a)
+201F201F201F201F201F201F201F201F201F201F
+2020202020202020202020202020202020202020
+2021202120212021202120212021202120212021
+drop table t1;
CREATE TABLE t1 (id int, s char(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci);
INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
SELECT id, MIN(s) FROM t1 GROUP BY id;
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 641080f48ab..10559d33eb3 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -453,6 +453,24 @@ drop table t1;
deallocate prepare stmt;
#
+# Bug#22052 Trailing spaces are not removed from UNICODE fields in an index
+#
+create table t1 (
+ a char(10) unicode not null,
+ index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x201f, 10));
+insert into t1 values (repeat(0x2020, 10));
+insert into t1 values (repeat(0x2021, 10));
+# make sure "index read" is used
+explain select hex(a) from t1 order by a;
+select hex(a) from t1 order by a;
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+drop table t1;
+
+
+#
# Bug #20076: server crashes for a query with GROUP BY if MIN/MAX aggregation
# over a 'ucs2' field uses a temporary table
#