diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2019-09-23 13:47:52 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2019-09-23 14:11:48 +0530 |
commit | ab9f378b0bed85f67cdaf5868af19f814e6bdfe1 (patch) | |
tree | 073c779b3bcbc03088e419b5bb67125b6fc3ba92 /mysql-test | |
parent | 2931fd2917cc130e34e5f3d9d6c571a2b013e49c (diff) | |
download | mariadb-git-ab9f378b0bed85f67cdaf5868af19f814e6bdfe1.tar.gz |
Backporting 273d8eb12c40a6dcd05a8148bdfba3f1fd96e764 Proper fix for disabling warnings in read_statistics_for_table()
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/include/ctype_utf8_ilseq.inc | 1 | ||||
-rw-r--r-- | mysql-test/r/compare.result | 20 | ||||
-rw-r--r-- | mysql-test/r/ctype_uca.result | 46 | ||||
-rw-r--r-- | mysql-test/r/ctype_uca_innodb.result | 31 | ||||
-rw-r--r-- | mysql-test/r/ctype_utf8.result | 77 | ||||
-rw-r--r-- | mysql-test/r/processlist.result | 4 | ||||
-rw-r--r-- | mysql-test/r/range.result | 10 | ||||
-rw-r--r-- | mysql-test/r/range_mrr_icp.result | 10 | ||||
-rw-r--r-- | mysql-test/t/compare.test | 14 |
9 files changed, 53 insertions, 160 deletions
diff --git a/mysql-test/include/ctype_utf8_ilseq.inc b/mysql-test/include/ctype_utf8_ilseq.inc index 1bb009f2a8b..3586946659e 100644 --- a/mysql-test/include/ctype_utf8_ilseq.inc +++ b/mysql-test/include/ctype_utf8_ilseq.inc @@ -14,6 +14,7 @@ SHOW CREATE TABLE t1; INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); SELECT ch FROM t1 WHERE ch='admin๐'; +EXPLAIN SELECT ch FROM t1 WHERE ch='admin๐'; SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin๐'; SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin๐'; DELETE FROM t1; diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index ea8111cc3ce..b06847f09ed 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -100,3 +100,23 @@ CREATE TABLE t1(a INT ZEROFILL); SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; 1 DROP TABLE t1; +CREATE TABLE t1 (a char(2), index (a)); +insert into t1 values ("aa"),("bb"); +select * from t1 where a="aa"; +a +aa +select * from t1 where a="aaa"; +a +select * from t1 where a="aa "; +a +aa +select * from t1 where a>="aaa"; +a +bb +explain select * from t1 where a="aaa"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 3 const 1 Using where; Using index +explain select * from t1 where a="aa "; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 3 const 1 Using where; Using index +drop table t1; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index d3a51c975a2..69611b2a7ed 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -6748,14 +6748,13 @@ t1 CREATE TABLE `t1` ( INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); SELECT ch FROM t1 WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 +EXPLAIN SELECT ch FROM t1 WHERE ch='admin๐'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin๐'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 DELETE FROM t1; INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); @@ -6771,22 +6770,14 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a๐' ORDER BY ch; ch a @@ -6829,8 +6820,6 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐' ORDER BY ch; ch a @@ -6850,14 +6839,10 @@ ab az aะ aึ -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐b' ORDER BY ch; ch a @@ -6877,8 +6862,6 @@ ab az aะ aึ -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a๐' ORDER BY ch; ch z @@ -6889,24 +6872,16 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐' ORDER BY ch; ch z -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐b' ORDER BY ch; ch z -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 ALTER TABLE t1 DROP KEY ch; # 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); @@ -6992,14 +6967,13 @@ t1 CREATE TABLE `t1` ( INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); SELECT ch FROM t1 WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 +EXPLAIN SELECT ch FROM t1 WHERE ch='admin๐'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin๐'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 DELETE FROM t1; INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); @@ -7015,22 +6989,14 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a๐' ORDER BY ch; ch a diff --git a/mysql-test/r/ctype_uca_innodb.result b/mysql-test/r/ctype_uca_innodb.result index bd6f3b8a21f..7c64f17190e 100644 --- a/mysql-test/r/ctype_uca_innodb.result +++ b/mysql-test/r/ctype_uca_innodb.result @@ -23,14 +23,13 @@ t1 CREATE TABLE `t1` ( INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); SELECT ch FROM t1 WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 +EXPLAIN SELECT ch FROM t1 WHERE ch='admin๐'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin๐'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 DELETE FROM t1; INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); @@ -46,22 +45,14 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a๐' ORDER BY ch; ch a @@ -104,8 +95,6 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐' ORDER BY ch; ch a @@ -125,14 +114,10 @@ ab az aะ aึ -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐b' ORDER BY ch; ch a @@ -152,8 +137,6 @@ ab az aะ aึ -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a๐' ORDER BY ch; ch z @@ -164,24 +147,16 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐' ORDER BY ch; ch z -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐b' ORDER BY ch; ch z -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 ALTER TABLE t1 DROP KEY ch; # 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index fe873a54edb..2f5b0eecc92 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -5467,14 +5467,13 @@ t1 CREATE TABLE `t1` ( INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); SELECT ch FROM t1 WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 +EXPLAIN SELECT ch FROM t1 WHERE ch='admin๐'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin๐'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 DELETE FROM t1; INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); @@ -5490,22 +5489,14 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a๐' ORDER BY ch; ch a @@ -5548,8 +5539,6 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐' ORDER BY ch; ch a @@ -5569,14 +5558,10 @@ ab az aะ aึ -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐b' ORDER BY ch; ch a @@ -5596,8 +5581,6 @@ ab az aะ aึ -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a๐' ORDER BY ch; ch z @@ -5608,24 +5591,16 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐' ORDER BY ch; ch z -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐b' ORDER BY ch; ch z -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 ALTER TABLE t1 DROP KEY ch; # 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); @@ -5711,14 +5686,13 @@ t1 CREATE TABLE `t1` ( INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); SELECT ch FROM t1 WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 +EXPLAIN SELECT ch FROM t1 WHERE ch='admin๐'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin๐'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 DELETE FROM t1; INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); @@ -5734,22 +5708,14 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a๐' ORDER BY ch; ch a @@ -5792,8 +5758,6 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐' ORDER BY ch; ch a @@ -5813,14 +5777,10 @@ ab az aะ aึ -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a๐b' ORDER BY ch; ch a @@ -5840,8 +5800,6 @@ ab az aะ aึ -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a๐' ORDER BY ch; ch z @@ -5852,24 +5810,16 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐' ORDER BY ch; ch z -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ch ch 183 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a๐b' ORDER BY ch; ch z -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 ALTER TABLE t1 DROP KEY ch; # 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); @@ -5955,14 +5905,13 @@ t1 CREATE TABLE `t1` ( INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); SELECT ch FROM t1 WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 +EXPLAIN SELECT ch FROM t1 WHERE ch='admin๐'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='admin๐'; ch SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='admin๐'; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 DELETE FROM t1; INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); @@ -5978,22 +5927,14 @@ EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column `test`.`t1`.`ch` at row 1 EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL # Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a๐b' ORDER BY ch; ch -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column `test`.`t1`.`ch` at row 1 SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a๐' ORDER BY ch; ch a diff --git a/mysql-test/r/processlist.result b/mysql-test/r/processlist.result index ab518d961ef..4be643c1790 100644 --- a/mysql-test/r/processlist.result +++ b/mysql-test/r/processlist.result @@ -36,10 +36,6 @@ SELECT INFO, INFO_BINARY, 'xxx๐yyy' AS utf8mb4_string FROM INFORMATION_SCHEMA INFO SELECT INFO, INFO_BINARY, 'xxx????yyy' AS utf8mb4_string FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%xxx%yyy%' INFO_BINARY SELECT INFO, INFO_BINARY, 'xxx๐yyy' AS utf8mb4_string FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%xxx%yyy%' utf8mb4_string xxx๐yyy -Warnings: -Level Warning -Code 1366 -Message Incorrect string value: '\xF0\x9F\x98\x8Eyy...' for column `information_schema`.`(temporary)`.`INFO` at row 1 # # End of 10.1 tests # diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 406e5c774cf..b55b462c8ef 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -2077,23 +2077,15 @@ explain SELECT * FROM t1 WHERE fd='๐'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81' for column `test`.`t1`.`fd` at row 1 SELECT * FROM t1 WHERE fd='๐'; id fd -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81' for column `test`.`t1`.`fd` at row 1 # The following must not use range access: explain select count(*) from t1 where fd <'๐'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ix_fd ix_fd 63 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81' for column `test`.`t1`.`fd` at row 1 select count(*) from t1 where fd <'๐'; count(*) 40960 -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81' for column `test`.`t1`.`fd` at row 1 select count(*) from t1 ignore index (ix_fd) where fd <'๐'; count(*) 40960 @@ -2314,8 +2306,6 @@ INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e'); EXPLAIN SELECT * FROM t1 WHERE a<=>'๐'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column `test`.`t1`.`a` at row 1 DROP TABLE t1; # # MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in diff --git a/mysql-test/r/range_mrr_icp.result b/mysql-test/r/range_mrr_icp.result index e31901fdb26..2584fc5a8bf 100644 --- a/mysql-test/r/range_mrr_icp.result +++ b/mysql-test/r/range_mrr_icp.result @@ -2079,23 +2079,15 @@ explain SELECT * FROM t1 WHERE fd='๐'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81' for column `test`.`t1`.`fd` at row 1 SELECT * FROM t1 WHERE fd='๐'; id fd -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81' for column `test`.`t1`.`fd` at row 1 # The following must not use range access: explain select count(*) from t1 where fd <'๐'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index ix_fd ix_fd 63 NULL # Using where; Using index -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81' for column `test`.`t1`.`fd` at row 1 select count(*) from t1 where fd <'๐'; count(*) 40960 -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9F\x98\x81' for column `test`.`t1`.`fd` at row 1 select count(*) from t1 ignore index (ix_fd) where fd <'๐'; count(*) 40960 @@ -2316,8 +2308,6 @@ INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e'); EXPLAIN SELECT * FROM t1 WHERE a<=>'๐'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Warning 1366 Incorrect string value: '\xF0\x9F\x98\x8E' for column `test`.`t1`.`a` at row 1 DROP TABLE t1; # # MDEV-10185: Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index d2b2a7e5523..38bda6754d8 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -94,3 +94,17 @@ DROP TABLE t1; CREATE TABLE t1(a INT ZEROFILL); SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; DROP TABLE t1; + +# +# Check what happens when comparing to long string +# + +CREATE TABLE t1 (a char(2), index (a)); +insert into t1 values ("aa"),("bb"); +select * from t1 where a="aa"; +select * from t1 where a="aaa"; +select * from t1 where a="aa "; +select * from t1 where a>="aaa"; +explain select * from t1 where a="aaa"; +explain select * from t1 where a="aa "; +drop table t1; |