diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-12-08 13:19:19 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-12-08 13:19:19 +0400 |
commit | 0e5eef886ac281599da2caa24e0a560b4f889c7d (patch) | |
tree | 8cab5bd78a286bda2830e9c8f9ce8458dbf074d7 /mysql-test/r | |
parent | dfafe15abbd552ed487b2b0f7188db9303b1fa1f (diff) | |
download | mariadb-git-0e5eef886ac281599da2caa24e0a560b4f889c7d.tar.gz |
MDEV-14350 Index use with collation utf8mb4_unicode_nopad_ci on LIKE pattern with wrong results
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/ctype_latin1.result | 25 | ||||
-rw-r--r-- | mysql-test/r/ctype_like_range.result | 45 | ||||
-rw-r--r-- | mysql-test/r/ctype_ucs2_uca.result | 26 | ||||
-rw-r--r-- | mysql-test/r/ctype_utf16_uca.result | 26 | ||||
-rw-r--r-- | mysql-test/r/ctype_utf32_uca.result | 26 | ||||
-rw-r--r-- | mysql-test/r/ctype_utf8_uca.result | 25 | ||||
-rw-r--r-- | mysql-test/r/ctype_utf8mb4_uca.result | 26 |
7 files changed, 199 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 0ca643f25fb..b60d711568c 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -8804,6 +8804,31 @@ DROP TABLE t1; # End of ctype_pad.inc # SET STORAGE_ENGINE=Default; +SET NAMES latin1; +# +# MDEV-14350 Index use with collation utf8mb4_unicode_nopad_ci on LIKE pattern with wrong results +# +CREATE OR REPLACE TABLE t1 AS SELECT SPACE(50) AS a, SPACE (50) AS b; +ALTER TABLE t1 ADD KEY(a), ADD KEY(b); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(50) DEFAULT NULL, + `b` varchar(50) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('111', '111'); +INSERT INTO t1 VALUES ('222', '222'); +INSERT INTO t1 VALUES ('333', '333'); +INSERT INTO t1 VALUES ('444', '444'); +SELECT * FROM t1 WHERE a LIKE '111%'; +a b +111 111 +SELECT * FROM t1 IGNORE INDEX (a) WHERE a LIKE '111%'; +a b +111 111 +DROP TABLE t1; # # End of 10.2 tests # diff --git a/mysql-test/r/ctype_like_range.result b/mysql-test/r/ctype_like_range.result index f8032d0ae86..d8e621fd056 100644 --- a/mysql-test/r/ctype_like_range.result +++ b/mysql-test/r/ctype_like_range.result @@ -4430,5 +4430,50 @@ a_ 6100 61FF a% 61000000000000000000 61FFFFFFFFFFFFFFFFFF DROP TABLE t1; # +# MDEV-14350 Index use with collation utf8mb4_unicode_nopad_ci on LIKE pattern with wrong results +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_swedish_nopad_ci); +INSERT INTO t1 VALUES ('111%'); +SELECT a, HEX(LIKE_RANGE_MIN(a,200)) FROM t1; +a HEX(LIKE_RANGE_MIN(a,200)) +111% 313131 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_nopad_ci); +INSERT INTO t1 VALUES ('111%'); +SELECT a, HEX(LIKE_RANGE_MIN(a,200)) FROM t1; +a HEX(LIKE_RANGE_MIN(a,200)) +111% 313131 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci); +INSERT INTO t1 VALUES ('111%'); +SELECT a, HEX(LIKE_RANGE_MIN(a,200)) FROM t1; +a HEX(LIKE_RANGE_MIN(a,200)) +111% 313131 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci); +INSERT INTO t1 VALUES ('111%'); +SELECT a, HEX(LIKE_RANGE_MIN(a,200)) FROM t1; +a HEX(LIKE_RANGE_MIN(a,200)) +111% 313131 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ucs2 COLLATE ucs2_unicode_nopad_ci); +INSERT INTO t1 VALUES ('111%'); +SELECT a, HEX(LIKE_RANGE_MIN(a,200)) FROM t1; +a HEX(LIKE_RANGE_MIN(a,200)) +111% 003100310031 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16 COLLATE utf16_unicode_nopad_ci); +INSERT INTO t1 VALUES ('111%'); +SELECT a, HEX(LIKE_RANGE_MIN(a,200)) FROM t1; +a HEX(LIKE_RANGE_MIN(a,200)) +111% 003100310031 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32 COLLATE utf32_unicode_nopad_ci); +INSERT INTO t1 VALUES ('111%'); +SELECT a, HEX(LIKE_RANGE_MIN(a,200)) FROM t1; +a HEX(LIKE_RANGE_MIN(a,200)) +111% 000000310000003100000031 +DROP TABLE t1; +# # End of 10.2 tests # diff --git a/mysql-test/r/ctype_ucs2_uca.result b/mysql-test/r/ctype_ucs2_uca.result index 48ec25b32e3..44a623842c6 100644 --- a/mysql-test/r/ctype_ucs2_uca.result +++ b/mysql-test/r/ctype_ucs2_uca.result @@ -559,6 +559,32 @@ DROP TABLE t1; # End of ctype_pad.inc # SET STORAGE_ENGINE=Default; +SET NAMES utf8, collation_connection=ucs2_unicode_520_nopad_ci; +# +# MDEV-14350 Index use with collation utf8mb4_unicode_nopad_ci on LIKE pattern with wrong results +# +CREATE OR REPLACE TABLE t1 AS SELECT SPACE(50) AS a, SPACE (50) AS b; +ALTER TABLE t1 ADD KEY(a), ADD KEY(b); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(50) CHARACTER SET ucs2 COLLATE ucs2_unicode_520_nopad_ci DEFAULT NULL, + `b` varchar(50) CHARACTER SET ucs2 COLLATE ucs2_unicode_520_nopad_ci DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('111', '111'); +INSERT INTO t1 VALUES ('222', '222'); +INSERT INTO t1 VALUES ('333', '333'); +INSERT INTO t1 VALUES ('444', '444'); +SELECT * FROM t1 WHERE a LIKE '111%'; +a b +111 111 +SELECT * FROM t1 IGNORE INDEX (a) WHERE a LIKE '111%'; +a b +111 111 +DROP TABLE t1; +SET NAMES utf8; # # End of 10.2 tests # diff --git a/mysql-test/r/ctype_utf16_uca.result b/mysql-test/r/ctype_utf16_uca.result index 1105225ed87..0cb9c4c74c1 100644 --- a/mysql-test/r/ctype_utf16_uca.result +++ b/mysql-test/r/ctype_utf16_uca.result @@ -7866,6 +7866,32 @@ DROP TABLE t1; # End of ctype_pad.inc # SET STORAGE_ENGINE=Default; +SET NAMES utf8, collation_connection=utf16_unicode_520_nopad_ci; +# +# MDEV-14350 Index use with collation utf8mb4_unicode_nopad_ci on LIKE pattern with wrong results +# +CREATE OR REPLACE TABLE t1 AS SELECT SPACE(50) AS a, SPACE (50) AS b; +ALTER TABLE t1 ADD KEY(a), ADD KEY(b); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(50) CHARACTER SET utf16 COLLATE utf16_unicode_520_nopad_ci DEFAULT NULL, + `b` varchar(50) CHARACTER SET utf16 COLLATE utf16_unicode_520_nopad_ci DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('111', '111'); +INSERT INTO t1 VALUES ('222', '222'); +INSERT INTO t1 VALUES ('333', '333'); +INSERT INTO t1 VALUES ('444', '444'); +SELECT * FROM t1 WHERE a LIKE '111%'; +a b +111 111 +SELECT * FROM t1 IGNORE INDEX (a) WHERE a LIKE '111%'; +a b +111 111 +DROP TABLE t1; +SET NAMES utf8; # # End of 10.2 tests # diff --git a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result index 097da3d7c16..a112918c0c3 100644 --- a/mysql-test/r/ctype_utf32_uca.result +++ b/mysql-test/r/ctype_utf32_uca.result @@ -7886,6 +7886,32 @@ DROP TABLE t1; # End of ctype_pad.inc # SET STORAGE_ENGINE=Default; +SET NAMES utf8, collation_connection=utf32_unicode_520_nopad_ci; +# +# MDEV-14350 Index use with collation utf8mb4_unicode_nopad_ci on LIKE pattern with wrong results +# +CREATE OR REPLACE TABLE t1 AS SELECT SPACE(50) AS a, SPACE (50) AS b; +ALTER TABLE t1 ADD KEY(a), ADD KEY(b); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(50) CHARACTER SET utf32 COLLATE utf32_unicode_520_nopad_ci DEFAULT NULL, + `b` varchar(50) CHARACTER SET utf32 COLLATE utf32_unicode_520_nopad_ci DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('111', '111'); +INSERT INTO t1 VALUES ('222', '222'); +INSERT INTO t1 VALUES ('333', '333'); +INSERT INTO t1 VALUES ('444', '444'); +SELECT * FROM t1 WHERE a LIKE '111%'; +a b +111 111 +SELECT * FROM t1 IGNORE INDEX (a) WHERE a LIKE '111%'; +a b +111 111 +DROP TABLE t1; +SET NAMES utf8; # # End of 10.2 tests # diff --git a/mysql-test/r/ctype_utf8_uca.result b/mysql-test/r/ctype_utf8_uca.result index c8107da3b6f..23e9802b61a 100644 --- a/mysql-test/r/ctype_utf8_uca.result +++ b/mysql-test/r/ctype_utf8_uca.result @@ -559,6 +559,31 @@ DROP TABLE t1; # End of ctype_pad.inc # SET STORAGE_ENGINE=Default; +SET NAMES utf8 COLLATE utf8_unicode_nopad_ci; +# +# MDEV-14350 Index use with collation utf8mb4_unicode_nopad_ci on LIKE pattern with wrong results +# +CREATE OR REPLACE TABLE t1 AS SELECT SPACE(50) AS a, SPACE (50) AS b; +ALTER TABLE t1 ADD KEY(a), ADD KEY(b); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + `b` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('111', '111'); +INSERT INTO t1 VALUES ('222', '222'); +INSERT INTO t1 VALUES ('333', '333'); +INSERT INTO t1 VALUES ('444', '444'); +SELECT * FROM t1 WHERE a LIKE '111%'; +a b +111 111 +SELECT * FROM t1 IGNORE INDEX (a) WHERE a LIKE '111%'; +a b +111 111 +DROP TABLE t1; # # End of 10.2 tests # diff --git a/mysql-test/r/ctype_utf8mb4_uca.result b/mysql-test/r/ctype_utf8mb4_uca.result index ca7f1a3d7d4..0712ca63abd 100644 --- a/mysql-test/r/ctype_utf8mb4_uca.result +++ b/mysql-test/r/ctype_utf8mb4_uca.result @@ -6576,6 +6576,32 @@ DROP TABLE t1; # End of ctype_pad.inc # SET STORAGE_ENGINE=Default; +SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_nopad_ci; +# +# MDEV-14350 Index use with collation utf8mb4_unicode_nopad_ci on LIKE pattern with wrong results +# +CREATE OR REPLACE TABLE t1 AS SELECT SPACE(50) AS a, SPACE (50) AS b; +ALTER TABLE t1 ADD KEY(a), ADD KEY(b); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_nopad_ci DEFAULT NULL, + `b` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_nopad_ci DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('111', '111'); +INSERT INTO t1 VALUES ('222', '222'); +INSERT INTO t1 VALUES ('333', '333'); +INSERT INTO t1 VALUES ('444', '444'); +SELECT * FROM t1 WHERE a LIKE '111%'; +a b +111 111 +SELECT * FROM t1 IGNORE INDEX (a) WHERE a LIKE '111%'; +a b +111 111 +DROP TABLE t1; +SET NAMES utf8mb4; # # End of 10.2 tests # |