From 5fe8b747e9e3440f2f746accca0eb11e287a6713 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 17 Aug 2015 15:53:43 +0400 Subject: [PATCH] Adding EXPLAIN SELECT tests for: MDEV-7649 wrong result when comparing utf8 column with an invalid literal This is a preparatory patch for: MDEV-8433 Make field<'broken-string' use indexes --- mysql-test/include/ctype_utf8_ilseq.inc | 18 +++++ mysql-test/r/ctype_uca.result | 64 +++++++++++++++ mysql-test/r/ctype_uca_innodb.result | 36 +++++++++ mysql-test/r/ctype_utf8.result | 100 ++++++++++++++++++++++++ 4 files changed, 218 insertions(+) diff --git a/mysql-test/include/ctype_utf8_ilseq.inc b/mysql-test/include/ctype_utf8_ilseq.inc index c400731c07f..1bb009f2a8b 100644 --- a/mysql-test/include/ctype_utf8_ilseq.inc +++ b/mysql-test/include/ctype_utf8_ilseq.inc @@ -28,17 +28,35 @@ INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; +--replace_column 9 # +EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; +--replace_column 9 # +EXPLAIN +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; +--replace_column 9 # +EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; +--replace_column 9 # +EXPLAIN +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; +--replace_column 9 # +EXPLAIN SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; +--replace_column 9 # +EXPLAIN +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ALTER TABLE t1 DROP KEY ch; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 8dd86fc5f1e..c531aa226e4 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -6506,10 +6506,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch +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 '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 '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 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch Warnings: @@ -6552,6 +6564,12 @@ ab az aЀ aր +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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -6573,6 +6591,12 @@ aЀ aր Warnings: Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column '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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -6600,11 +6624,23 @@ z SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z +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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column '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 '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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z @@ -6714,10 +6750,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch +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 '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 '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 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch Warnings: @@ -6760,6 +6808,10 @@ ab az aЀ aր +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 ALL ch NULL NULL NULL # Using where; Using filesort SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -6779,6 +6831,10 @@ ab az aЀ aր +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 ALL ch NULL NULL NULL # Using where; Using filesort SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -6804,9 +6860,17 @@ z SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z +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 ALL ch NULL NULL NULL # Using where; Using filesort SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; ch z +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 ALL ch NULL NULL NULL # Using where; Using filesort SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z diff --git a/mysql-test/r/ctype_uca_innodb.result b/mysql-test/r/ctype_uca_innodb.result index a4e1ae09130..8b507d9fd85 100644 --- a/mysql-test/r/ctype_uca_innodb.result +++ b/mysql-test/r/ctype_uca_innodb.result @@ -42,10 +42,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch +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 '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 '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 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch Warnings: @@ -88,6 +100,12 @@ ab az aЀ aր +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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -109,6 +127,12 @@ aЀ aր Warnings: Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column '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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -136,11 +160,23 @@ z SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z +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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column '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 '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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 7bd37ede962..216cea3c60f 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -5460,10 +5460,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch +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 '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 '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 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch Warnings: @@ -5506,6 +5518,12 @@ ab az aЀ aր +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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -5527,6 +5545,12 @@ aЀ aր Warnings: Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column '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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -5554,11 +5578,23 @@ z SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z +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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column '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 '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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z @@ -5668,10 +5704,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch +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 '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 '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 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch Warnings: @@ -5714,6 +5762,12 @@ ab az aЀ aր +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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -5735,6 +5789,12 @@ aЀ aր Warnings: Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column '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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -5762,11 +5822,23 @@ z SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z +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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column '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 '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 182 NULL # Using where; Using index +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z @@ -5876,10 +5948,22 @@ SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆' ORDER BY ch; ch SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch +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 '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 '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 'ch' at row 1 SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='a𝌆b' ORDER BY ch; ch Warnings: @@ -5922,6 +6006,10 @@ ab az aЀ aր +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 ALL ch NULL NULL NULL # Using where; Using filesort SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆' ORDER BY ch; ch a @@ -5941,6 +6029,10 @@ ab az aЀ aր +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 ALL ch NULL NULL NULL # Using where; Using filesort SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'a𝌆b' ORDER BY ch; ch a @@ -5966,9 +6058,17 @@ z SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z +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 ALL ch NULL NULL NULL # Using where; Using filesort SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆' ORDER BY ch; ch z +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 ALL ch NULL NULL NULL # Using where; Using filesort SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'a𝌆b' ORDER BY ch; ch z