summaryrefslogtreecommitdiffstats
path: root/mysql-test/include/ctype_like_range_f1f2.inc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
commit06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/include/ctype_like_range_f1f2.inc
parentInitial commit. (diff)
downloadmariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz
mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/include/ctype_like_range_f1f2.inc')
-rw-r--r--mysql-test/include/ctype_like_range_f1f2.inc28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/include/ctype_like_range_f1f2.inc b/mysql-test/include/ctype_like_range_f1f2.inc
new file mode 100644
index 00000000..def341e8
--- /dev/null
+++ b/mysql-test/include/ctype_like_range_f1f2.inc
@@ -0,0 +1,28 @@
+#
+# Bug#32510 LIKE search fails with indexed 'eucjpms' and 'ujis' char column
+#
+# Testing my_ctype_like_range_xxx
+# (used in LIKE optimization for an indexed column)
+#
+
+# Create table using @@character_set_connection and @@collation_connection
+# for the string columns.
+
+CREATE TABLE t1 AS
+SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
+ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
+
+INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
+INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
+INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
+INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
+
+#check after fix MDEV-29290
+--disable_view_protocol
+# Check pattern (important for ucs2, utf16, utf32)
+SELECT hex(concat(repeat(0xF1F2, 10), '%'));
+
+--echo 3 rows expected
+SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
+DROP TABLE t1;
+--enable_view_protocol