summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-09-21 23:10:51 +0500
committerunknown <bar@mysql.com>2005-09-21 23:10:51 +0500
commit14912660c39354c366419d65899bc95061d63e6e (patch)
tree519dad549da8beab9748d94f1ae4894caf051d8f /mysql-test/include
parent4014d76cd1a7bbab348f2e47d852518e11526777 (diff)
downloadmariadb-git-14912660c39354c366419d65899bc95061d63e6e.tar.gz
Bug#13046: LIKE pattern matching using prefix
index doesn't return correct result item_cmpfunc.cc: Use charset of LIKE to decide whether to use 8bit or Unicode "escape" value. But use charset of "escape" to scan escape character. strings/ctype-xxx.c: We cannot reduce "end" pointer using charpos(), because of possible escape characters in the string. Limit the loop using count of written characters instead. ctype_like_escape.inc: new file mysql-test/t/ctype_xxx: mysql-test/r/ctype_xxx: Adding test case. strings/ctype-big5.c: Bug#13046: LIKE pattern matching using prefix index doesn't return correct result We cannot change "end" pointer using charpos(), because of possible escape characters. Use limit by count of written characters instead. strings/ctype-cp932.c: Bug#13046: LIKE pattern matching using prefix index doesn't return correct result We cannot change "end" pointer using charpos(), because of possible escape characters. Use limit by count of written characters instead strings/ctype-gbk.c: Bug#13046: LIKE pattern matching using prefix index doesn't return correct result We cannot change "end" pointer using charpos(), because of possible escape characters. Use limit by count of written characters instead strings/ctype-mb.c: Bug#13046: LIKE pattern matching using prefix index doesn't return correct result We cannot change "end" pointer using charpos(), because of possible escape characters. Use limit by count of written characters instead strings/ctype-simple.c: Bug#13046: LIKE pattern matching using prefix index doesn't return correct result We cannot change "end" pointer using charpos(), because of possible escape characters. Use limit by count of written characters instead strings/ctype-sjis.c: Bug#13046: LIKE pattern matching using prefix index doesn't return correct result We cannot change "end" pointer using charpos(), because of possible escape characters. Use limit by count of written characters instead strings/ctype-tis620.c: Bug#13046: LIKE pattern matching using prefix index doesn't return correct result We cannot change "end" pointer using charpos(), because of possible escape characters. Use limit by count of written characters instead strings/ctype-ucs2.c: Bug#13046: LIKE pattern matching using prefix index doesn't return correct result We cannot change "end" pointer using charpos(), because of possible escape characters. Use limit by count of written characters instead mysql-test/t/ctype_big5.test: Adding test case. mysql-test/t/ctype_cp932.test: Adding test case. mysql-test/t/ctype_gbk.test: Adding test case. mysql-test/t/ctype_latin1.test: Adding test case. mysql-test/t/ctype_sjis.test: Adding test case. mysql-test/t/ctype_tis620.test: Adding test case. mysql-test/t/ctype_uca.test: Adding test case. mysql-test/t/ctype_ucs.test: Adding test case. mysql-test/t/ctype_ujis.test: Adding test case. mysql-test/t/ctype_utf8.test: Adding test case. mysql-test/r/ctype_big5.result: Adding test case. mysql-test/r/ctype_cp932.result: Adding test case. mysql-test/r/ctype_gbk.result: Adding test case. mysql-test/r/ctype_latin1.result: Adding test case. mysql-test/r/ctype_sjis.result: Adding test case. mysql-test/r/ctype_tis620.result: Adding test case. mysql-test/r/ctype_uca.result: Adding test case. mysql-test/r/ctype_ucs.result: Adding test case. mysql-test/r/ctype_ujis.result: Adding test case. mysql-test/r/ctype_utf8.result: Adding test case. sql/item_cmpfunc.cc: More fixes.
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/ctype_like_escape.inc18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/include/ctype_like_escape.inc b/mysql-test/include/ctype_like_escape.inc
new file mode 100644
index 00000000000..ac97fbaa1a0
--- /dev/null
+++ b/mysql-test/include/ctype_like_escape.inc
@@ -0,0 +1,18 @@
+#
+# Bugs: #13046:
+# LIKE pattern matching using prefix index doesn't return correct result
+#
+select @@collation_connection;
+create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
+insert into t1 values('abcdef');
+insert into t1 values('_bcdef');
+insert into t1 values('a_cdef');
+insert into t1 values('ab_def');
+insert into t1 values('abc_ef');
+insert into t1 values('abcd_f');
+insert into t1 values('abcde_');
+-- should return ab_def
+select c1 as c1u from t1 where c1 like 'ab\_def';
+-- should return ab_def
+select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
+drop table t1;