Commit a8cd030e authored by Alexander Barkov's avatar Alexander Barkov

Adding LIKE range tests for tricky characters U+0425, U+045F, U+2525, U+5F5F.

They have bytes 0x25 and 0x5F. Testing that these bytes are treated as parts
of multi-byte characters rather than underscore and percent sign.
parent 683b88e6
SET NAMES utf8;
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a VARBINARY(32));
......@@ -284,6 +285,8 @@ id name val
32 mx 63616161616161616161616161616161
32 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8;
INSERT INTO t1 (a) VALUES (_ucs2 0x0425),(_ucs2 0x045F);
INSERT INTO t1 (a) VALUES (_ucs2 0x2525),(_ucs2 0x5F5F);
SELECT * FROM v1;
id name val
1 a
......@@ -414,6 +417,22 @@ id name val
32 mn 6361616161
32 mx 6361616161
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
SELECT * FROM v1;
id name val
......@@ -545,6 +564,22 @@ id name val
32 mn 6361616161
32 mx 6361616161
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_czech_ci;
SELECT * FROM v1;
id name val
......@@ -676,6 +711,22 @@ id name val
32 mn 6361616161
32 mx 6361616161
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci;
SELECT * FROM v1;
id name val
......@@ -807,6 +858,22 @@ id name val
32 mn 6361616161
32 mx 6361616161
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4;
SELECT * FROM v1;
id name val
......@@ -938,6 +1005,22 @@ id name val
32 mn 63616161
32 mx 63616161
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
SELECT * FROM v1;
id name val
......@@ -1069,6 +1152,22 @@ id name val
32 mn 63616161
32 mx 63616161
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_czech_ci;
SELECT * FROM v1;
id name val
......@@ -1200,6 +1299,22 @@ id name val
32 mn 63616161
32 mx 63616161
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_danish_ci;
SELECT * FROM v1;
id name val
......@@ -1331,6 +1446,22 @@ id name val
32 mn 63616109090909090909090909090909
32 mx 636161EFBFBFEFBFBFEFBFBFEFBFBF20
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
SELECT * FROM v1;
id name val
......@@ -1462,6 +1593,22 @@ id name val
32 mn 63616161
32 mx 63616161
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2;
SELECT * FROM v1;
id name val
......@@ -1593,6 +1740,22 @@ id name val
32 mn 00630061006100610061006100610061
32 mx 00630061006100610061006100610061
32 sp --------------------------------
33 a Х
33 mn 0425
33 mx 0425
33 sp --------------------------------
34 a џ
34 mn 045F
34 mx 045F
34 sp --------------------------------
35 a ┥
35 mn 2525
35 mx 2525
35 sp --------------------------------
36 a 彟
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci;
SELECT * FROM v1;
id name val
......@@ -1724,6 +1887,22 @@ id name val
32 mn 00630061006100610061006100610061
32 mx 00630061006100610061006100610061
32 sp --------------------------------
33 a Х
33 mn 0425
33 mx 0425
33 sp --------------------------------
34 a џ
34 mn 045F
34 mx 045F
34 sp --------------------------------
35 a ┥
35 mn 2525
35 mx 2525
35 sp --------------------------------
36 a 彟
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
SELECT * FROM v1;
id name val
......@@ -1855,6 +2034,22 @@ id name val
32 mn 00630061006100610061006100610061
32 mx 00630061006100610061006100610061
32 sp --------------------------------
33 a Х
33 mn 0425
33 mx 0425
33 sp --------------------------------
34 a џ
34 mn 045F
34 mx 045F
34 sp --------------------------------
35 a ┥
35 mn 2525
35 mx 2525
35 sp --------------------------------
36 a 彟
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci;
SELECT * FROM v1;
id name val
......@@ -1986,6 +2181,22 @@ id name val
32 mn 00630061006100610061006100610009
32 mx 0063006100610061006100610061FFFF
32 sp --------------------------------
33 a Х
33 mn 0425
33 mx 0425
33 sp --------------------------------
34 a џ
34 mn 045F
34 mx 045F
34 sp --------------------------------
35 a ┥
35 mn 2525
35 mx 2525
35 sp --------------------------------
36 a 彟
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16;
SELECT * FROM v1;
id name val
......@@ -2117,6 +2328,22 @@ id name val
32 mn 0063006100610061
32 mx 0063006100610061
32 sp --------------------------------
33 a Х
33 mn 0425
33 mx 0425
33 sp --------------------------------
34 a џ
34 mn 045F
34 mx 045F
34 sp --------------------------------
35 a ┥
35 mn 2525
35 mx 2525
35 sp --------------------------------
36 a 彟
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_ci;
SELECT * FROM v1;
id name val
......@@ -2248,6 +2475,22 @@ id name val
32 mn 0063006100610061
32 mx 0063006100610061
32 sp --------------------------------
33 a Х
33 mn 0425
33 mx 0425
33 sp --------------------------------
34 a џ
34 mn 045F
34 mx 045F
34 sp --------------------------------
35 a ┥
35 mn 2525
35 mx 2525
35 sp --------------------------------
36 a 彟
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_czech_ci;
SELECT * FROM v1;
id name val
......@@ -2379,6 +2622,22 @@ id name val
32 mn 0063006100610061
32 mx 0063006100610061
32 sp --------------------------------
33 a Х
33 mn 0425
33 mx 0425
33 sp --------------------------------
34 a џ
34 mn 045F
34 mx 045F
34 sp --------------------------------
35 a ┥
35 mn 2525
35 mx 2525
35 sp --------------------------------
36 a 彟
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci;
SELECT * FROM v1;
id name val
......@@ -2510,6 +2769,22 @@ id name val
32 mn 00630061006100090009000900090009
32 mx 006300610061FFFFFFFFFFFFFFFFFFFF
32 sp --------------------------------
33 a Х
33 mn 0425
33 mx 0425
33 sp --------------------------------
34 a џ
34 mn 045F
34 mx 045F
34 sp --------------------------------
35 a ┥
35 mn 2525
35 mx 2525
35 sp --------------------------------
36 a 彟
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci;
SELECT * FROM v1;
id name val
......@@ -2641,6 +2916,22 @@ id name val
32 mn 0063006100610061
32 mx 0063006100610061
32 sp --------------------------------
33 a Х
33 mn 0425
33 mx 0425
33 sp --------------------------------
34 a џ
34 mn 045F
34 mx 045F
34 sp --------------------------------
35 a ┥
35 mn 2525
35 mx 2525
35 sp --------------------------------
36 a 彟
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32;
SELECT * FROM v1;
id name val
......@@ -2772,6 +3063,22 @@ id name val
32 mn 00000063000000610000006100000061
32 mx 00000063000000610000006100000061
32 sp --------------------------------
33 a Х
33 mn 00000425
33 mx 00000425
33 sp --------------------------------
34 a џ
34 mn 0000045F
34 mx 0000045F
34 sp --------------------------------
35 a ┥
35 mn 00002525
35 mx 00002525
35 sp --------------------------------
36 a 彟
36 mn 00005F5F
36 mx 00005F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_ci;
SELECT * FROM v1;
id name val
......@@ -2903,6 +3210,22 @@ id name val
32 mn 00000063000000610000006100000061
32 mx 00000063000000610000006100000061
32 sp --------------------------------
33 a Х
33 mn 00000425
33 mx 00000425
33 sp --------------------------------
34 a џ
34 mn 0000045F
34 mx 0000045F
34 sp --------------------------------
35 a ┥
35 mn 00002525
35 mx 00002525
35 sp --------------------------------
36 a 彟
36 mn 00005F5F
36 mx 00005F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_czech_ci;
SELECT * FROM v1;
id name val
......@@ -3034,6 +3357,22 @@ id name val
32 mn 00000063000000610000006100000061
32 mx 00000063000000610000006100000061
32 sp --------------------------------
33 a Х
33 mn 00000425
33 mx 00000425
33 sp --------------------------------
34 a џ
34 mn 0000045F
34 mx 0000045F
34 sp --------------------------------
35 a ┥
35 mn 00002525
35 mx 00002525
35 sp --------------------------------
36 a 彟
36 mn 00005F5F
36 mx 00005F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci;
SELECT * FROM v1;
id name val
......@@ -3165,6 +3504,22 @@ id name val
32 mn 00000063000000610000006100000009
32 mx 0000006300000061000000610000FFFF
32 sp --------------------------------
33 a Х
33 mn 00000425
33 mx 00000425
33 sp --------------------------------
34 a џ
34 mn 0000045F
34 mx 0000045F
34 sp --------------------------------
35 a ┥
35 mn 00002525
35 mx 00002525
35 sp --------------------------------
36 a 彟
36 mn 00005F5F
36 mx 00005F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_520_ci;
SELECT * FROM v1;
id name val
......@@ -3296,5 +3651,21 @@ id name val
32 mn 00000063000000610000006100000061
32 mx 00000063000000610000006100000061
32 sp --------------------------------
33 a Х
33 mn 00000425
33 mx 00000425
33 sp --------------------------------
34 a џ
34 mn 0000045F
34 mx 0000045F
34 sp --------------------------------
35 a ┥
35 mn 00002525
35 mx 00002525
35 sp --------------------------------
36 a 彟
36 mn 00005F5F
36 mx 00005F5F
36 sp --------------------------------
DROP VIEW v1;
DROP TABLE t1;
......@@ -4,6 +4,8 @@
--source include/have_utf32.inc
--source include/have_utf8mb4.inc
SET NAMES utf8;
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
......@@ -38,6 +40,8 @@ ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET latin1;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8;
INSERT INTO t1 (a) VALUES (_ucs2 0x0425),(_ucs2 0x045F);
INSERT INTO t1 (a) VALUES (_ucs2 0x2525),(_ucs2 0x5F5F);
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment