summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-07-19 16:48:12 +0500
committerunknown <bar@mysql.com>2005-07-19 16:48:12 +0500
commit300d34124c0d3e9e2e55651fe349dacea62baf6d (patch)
tree6fac0fdc2477ec6fe60af724110b498444342096 /mysql-test
parentddc3586495aa82f310b0e5c2127b77f28c711c27 (diff)
downloadmariadb-git-300d34124c0d3e9e2e55651fe349dacea62baf6d.tar.gz
ctype_utf8.result, ctype_utf8.test:
added test case ctype-utf8.c: bug#11754: SET NAMES utf8 followed by SELECT "A\\" LIKE "A\\" returns 0 strings/ctype-utf8.c: bug#11754: SET NAMES utf8 followed by SELECT "A\\" LIKE "A\\" returns 0 mysql-test/t/ctype_utf8.test: added test case mysql-test/r/ctype_utf8.result: added test case
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ctype_utf8.result39
-rw-r--r--mysql-test/t/ctype_utf8.test21
2 files changed, 60 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 150c06840c6..bb3222ca98b 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -954,6 +954,45 @@ char_length(a) length(a) a
2 2 12
2 4 ан
drop table t1;
+set names utf8;
+select 'a\\' like 'a\\';
+'a\\' like 'a\\'
+1
+select 'aa\\' like 'a%\\';
+'aa\\' like 'a%\\'
+1
+create table t1 (a char(10), key(a)) character set utf8;
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+select * from t1 where a like "abc%";
+a
+abc
+abcd
+select * from t1 where a like concat("abc","%");
+a
+abc
+abcd
+select * from t1 where a like "ABC%";
+a
+abc
+abcd
+select * from t1 where a like "test%";
+a
+test
+select * from t1 where a like "te_t";
+a
+test
+select * from t1 where a like "%a%";
+a
+a
+abc
+abcd
+select * from t1 where a like "%abcd%";
+a
+abcd
+select * from t1 where a like "%abc\d%";
+a
+abcd
+drop table t1;
CREATE TABLE t1 (
a varchar(255) NOT NULL default '',
KEY a (a)
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index a135c8e409d..de31ca79bde 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -810,6 +810,27 @@ alter table t1 modify a char(2) character set utf8;
select char_length(a), length(a), a from t1 order by a;
drop table t1;
+
+#
+# Bugs#11754: SET NAMES utf8 followed by SELECT "A\\" LIKE "A\\" returns 0
+#
+set names utf8;
+select 'a\\' like 'a\\';
+select 'aa\\' like 'a%\\';
+
+create table t1 (a char(10), key(a)) character set utf8;
+insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+select * from t1 where a like "abc%";
+select * from t1 where a like concat("abc","%");
+select * from t1 where a like "ABC%";
+select * from t1 where a like "test%";
+select * from t1 where a like "te_t";
+select * from t1 where a like "%a%";
+select * from t1 where a like "%abcd%";
+select * from t1 where a like "%abc\d%";
+drop table t1;
+
+
#
# Bug#9557 MyISAM utf8 table crash
#