Skip to content

Commit a2248f1

Browse files
author
Tor Didriksen
committed
Bug#25504662 FUNC_IN_XXX TESTS FAIL WHEN CHANGING DEFAULT CHARACTER SET
To repeat: ./mtr --mem --charset-for-testdb=utf8mb4 Fix for func_in_all func_in_icp func_in_icp_mrr func_in_mrr func_in_mrr_cost func_in_none opt_trace.filesort_pq opt_trace.filesort_pack main.filesort_pack fulltext fulltext_left_join
1 parent 62c7756 commit a2248f1

19 files changed

+75
-65
lines changed

mysql-test/include/func_in.inc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ insert into t2 select 'bazbazbaz', 'no' from t1 A, t1 B;
199199
insert into t2 values ('fon', '1'), ('fop','1'), ('barbaq','1'),
200200
('barbas','1'), ('bazbazbay', '1'),('zz','1');
201201

202+
# Ignore possible changes in key_len for different character sets
203+
--replace_column 8 13
202204
explain select * from t2 where a not in('foo','barbar', 'bazbazbaz');
203205

204206
drop table t2;
@@ -393,10 +395,16 @@ select f1 from t1 where f1 in ('a',1);
393395
select f1, case f1 when 'a' then '+' when 1 then '-' end from t1;
394396
create index t1f1_idx on t1(f1);
395397
select f1 from t1 where f1 in ('a',1);
398+
# Ignore possible changes in key_len for different character sets
399+
--replace_column 8 2
396400
explain select f1 from t1 where f1 in ('a',1);
397401
select f1 from t1 where f1 in ('a','b');
402+
# Ignore possible changes in key_len for different character sets
403+
--replace_column 8 2
398404
explain select f1 from t1 where f1 in ('a','b');
399405
select f1 from t1 where f1 in (2,1);
406+
# Ignore possible changes in key_len for different character sets
407+
--replace_column 8 2
400408
explain select f1 from t1 where f1 in (2,1);
401409
create table t2(f2 int, index t2f2(f2));
402410
insert into t2 values(0),(1),(2);
@@ -474,7 +482,7 @@ CREATE TABLE t1 (
474482
c_timestamp TIMESTAMP NOT NULL,
475483
c_time TIME NOT NULL,
476484
c_year YEAR NOT NULL,
477-
c_char CHAR(10) NOT NULL,
485+
c_char CHAR(10) character set utf8mb4 NOT NULL,
478486
INDEX(c_int), INDEX(c_decimal), INDEX(c_float), INDEX(c_bit), INDEX(c_date),
479487
INDEX(c_datetime), INDEX(c_timestamp), INDEX(c_time), INDEX(c_year),
480488
INDEX(c_char));

mysql-test/r/filesort_pack.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ c char(120) NOT NULL default '',
55
pad char(60) NOT NULL default '',
66
PRIMARY KEY (id),
77
KEY k (k)
8-
) engine=innodb;
8+
) charset latin1 engine=innodb;
99
ANALYZE TABLE t1;
1010
Table Op Msg_type Msg_text
1111
test.t1 analyze status OK

mysql-test/r/fulltext.result

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
drop table if exists t1,t2,t3;
2-
CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
2+
CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)) charset utf8mb4;
33
INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
44
('Full-text indexes', 'are called collections'),
55
('Only MyISAM tables','support collections'),
@@ -11,7 +11,7 @@ test.t1 analyze status OK
1111
SHOW INDEX FROM t1;
1212
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible
1313
t1 1 a 1 a NULL 5 NULL NULL YES FULLTEXT YES
14-
t1 1 a 2 b NULL 5 1 NULL YES FULLTEXT YES
14+
t1 1 a 2 b NULL 5 0 NULL YES FULLTEXT YES
1515
select * from t1 where MATCH(a,b) AGAINST ("collections");
1616
a b
1717
Only MyISAM tables support collections
@@ -242,14 +242,14 @@ id int(11),
242242
ticket int(11),
243243
KEY ti (id),
244244
KEY tit (ticket)
245-
);
245+
) charset utf8mb4;
246246
INSERT INTO t1 VALUES (2,3),(1,2);
247247
CREATE TABLE t2 (
248248
ticket int(11),
249249
inhalt text,
250250
KEY tig (ticket),
251251
fulltext index tix (inhalt)
252-
);
252+
) charset utf8mb4;
253253
INSERT INTO t2 VALUES (1,'foo'),(2,'bar'),(3,'foobar');
254254
select t1.id FROM t2 as ttxt,t1,t1 as ticket2
255255
WHERE ticket2.id = ttxt.ticket AND t1.id = ticket2.ticket and
@@ -269,15 +269,15 @@ id
269269
show keys from t2;
270270
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible
271271
t2 1 tig 1 ticket A NULL NULL NULL YES BTREE YES
272-
t2 1 tix 1 inhalt NULL NULL 1 NULL YES FULLTEXT YES
272+
t2 1 tix 1 inhalt NULL NULL 0 NULL YES FULLTEXT YES
273273
show create table t2;
274274
Table Create Table
275275
t2 CREATE TABLE `t2` (
276276
`ticket` int(11) DEFAULT NULL,
277277
`inhalt` text,
278278
KEY `tig` (`ticket`),
279279
FULLTEXT KEY `tix` (`inhalt`)
280-
) ENGINE=MyISAM DEFAULT CHARSET=latin1
280+
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4
281281
select * from t2 where MATCH inhalt AGAINST (NULL);
282282
ticket inhalt
283283
select * from t2 where MATCH inhalt AGAINST ('foobar');
@@ -479,13 +479,13 @@ SELECT a FROM t1 WHERE MATCH a AGAINST('test' IN BOOLEAN MODE);
479479
a
480480
test's
481481
DROP TABLE t1;
482-
CREATE TABLE t1 (a VARCHAR(10000), FULLTEXT(a));
482+
CREATE TABLE t1 (a VARCHAR(10000), FULLTEXT(a)) charset utf8mb4;
483483
SHOW CREATE TABLE t1;
484484
Table Create Table
485485
t1 CREATE TABLE `t1` (
486486
`a` varchar(10000) DEFAULT NULL,
487487
FULLTEXT KEY `a` (`a`)
488-
) ENGINE=MyISAM DEFAULT CHARSET=latin1
488+
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4
489489
DROP TABLE t1;
490490
CREATE TABLE t1 (a TEXT, FULLTEXT KEY(a));
491491
INSERT INTO t1 VALUES('test'),('test1'),('test');

mysql-test/r/fulltext_left_join.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
drop table if exists t1, t2;
22
CREATE TABLE t1 (
3-
id VARCHAR(255) NOT NULL PRIMARY KEY,
4-
sujet VARCHAR(255),
3+
id VARCHAR(80) NOT NULL PRIMARY KEY,
4+
sujet VARCHAR(80),
55
motsclefs TEXT,
66
texte MEDIUMTEXT,
77
FULLTEXT(sujet, motsclefs, texte)

mysql-test/r/func_in_all.result

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ c_datetime DATETIME NOT NULL,
659659
c_timestamp TIMESTAMP NOT NULL,
660660
c_time TIME NOT NULL,
661661
c_year YEAR NOT NULL,
662-
c_char CHAR(10) NOT NULL,
662+
c_char CHAR(10) character set utf8mb4 NOT NULL,
663663
INDEX(c_int), INDEX(c_decimal), INDEX(c_float), INDEX(c_bit), INDEX(c_date),
664664
INDEX(c_datetime), INDEX(c_timestamp), INDEX(c_time), INDEX(c_year),
665665
INDEX(c_char));
@@ -844,19 +844,19 @@ Warnings:
844844
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_year` in (NULL,NULL))
845845
EXPLAIN SELECT * FROM t1 WHERE c_char IN ('1', '2', '3');
846846
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
847-
1 SIMPLE t1 NULL range c_char c_char 10 NULL 3 100.00 Using index condition; Using MRR
847+
1 SIMPLE t1 NULL range c_char c_char 40 NULL 3 100.00 Using index condition; Using MRR
848848
Warnings:
849849
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` in ('1','2','3'))
850850
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, '1', '2', '3');
851851
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
852-
1 SIMPLE t1 NULL range c_char c_char 10 NULL 3 100.00 Using index condition; Using MRR
852+
1 SIMPLE t1 NULL range c_char c_char 40 NULL 3 100.00 Using index condition; Using MRR
853853
Warnings:
854854
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` in (NULL,'1','2','3'))
855855
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL);
856856
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
857857
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
858858
Warnings:
859-
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where multiple equal(NULL, `test`.`t1`.`c_char`)
859+
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` = NULL)
860860
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, NULL);
861861
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
862862
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table

mysql-test/r/func_in_icp.result

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ c_datetime DATETIME NOT NULL,
659659
c_timestamp TIMESTAMP NOT NULL,
660660
c_time TIME NOT NULL,
661661
c_year YEAR NOT NULL,
662-
c_char CHAR(10) NOT NULL,
662+
c_char CHAR(10) character set utf8mb4 NOT NULL,
663663
INDEX(c_int), INDEX(c_decimal), INDEX(c_float), INDEX(c_bit), INDEX(c_date),
664664
INDEX(c_datetime), INDEX(c_timestamp), INDEX(c_time), INDEX(c_year),
665665
INDEX(c_char));
@@ -844,19 +844,19 @@ Warnings:
844844
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_year` in (NULL,NULL))
845845
EXPLAIN SELECT * FROM t1 WHERE c_char IN ('1', '2', '3');
846846
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
847-
1 SIMPLE t1 NULL range c_char c_char 10 NULL 3 100.00 Using index condition
847+
1 SIMPLE t1 NULL range c_char c_char 40 NULL 3 100.00 Using index condition
848848
Warnings:
849849
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` in ('1','2','3'))
850850
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, '1', '2', '3');
851851
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
852-
1 SIMPLE t1 NULL range c_char c_char 10 NULL 3 100.00 Using index condition
852+
1 SIMPLE t1 NULL range c_char c_char 40 NULL 3 100.00 Using index condition
853853
Warnings:
854854
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` in (NULL,'1','2','3'))
855855
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL);
856856
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
857857
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
858858
Warnings:
859-
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where multiple equal(NULL, `test`.`t1`.`c_char`)
859+
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` = NULL)
860860
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, NULL);
861861
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
862862
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table

mysql-test/r/func_in_icp_mrr.result

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ c_datetime DATETIME NOT NULL,
659659
c_timestamp TIMESTAMP NOT NULL,
660660
c_time TIME NOT NULL,
661661
c_year YEAR NOT NULL,
662-
c_char CHAR(10) NOT NULL,
662+
c_char CHAR(10) character set utf8mb4 NOT NULL,
663663
INDEX(c_int), INDEX(c_decimal), INDEX(c_float), INDEX(c_bit), INDEX(c_date),
664664
INDEX(c_datetime), INDEX(c_timestamp), INDEX(c_time), INDEX(c_year),
665665
INDEX(c_char));
@@ -844,19 +844,19 @@ Warnings:
844844
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_year` in (NULL,NULL))
845845
EXPLAIN SELECT * FROM t1 WHERE c_char IN ('1', '2', '3');
846846
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
847-
1 SIMPLE t1 NULL range c_char c_char 10 NULL 3 100.00 Using index condition; Using MRR
847+
1 SIMPLE t1 NULL range c_char c_char 40 NULL 3 100.00 Using index condition; Using MRR
848848
Warnings:
849849
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` in ('1','2','3'))
850850
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, '1', '2', '3');
851851
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
852-
1 SIMPLE t1 NULL range c_char c_char 10 NULL 3 100.00 Using index condition; Using MRR
852+
1 SIMPLE t1 NULL range c_char c_char 40 NULL 3 100.00 Using index condition; Using MRR
853853
Warnings:
854854
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` in (NULL,'1','2','3'))
855855
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL);
856856
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
857857
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
858858
Warnings:
859-
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where multiple equal(NULL, `test`.`t1`.`c_char`)
859+
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` = NULL)
860860
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, NULL);
861861
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
862862
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table

mysql-test/r/func_in_mrr.result

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ c_datetime DATETIME NOT NULL,
659659
c_timestamp TIMESTAMP NOT NULL,
660660
c_time TIME NOT NULL,
661661
c_year YEAR NOT NULL,
662-
c_char CHAR(10) NOT NULL,
662+
c_char CHAR(10) character set utf8mb4 NOT NULL,
663663
INDEX(c_int), INDEX(c_decimal), INDEX(c_float), INDEX(c_bit), INDEX(c_date),
664664
INDEX(c_datetime), INDEX(c_timestamp), INDEX(c_time), INDEX(c_year),
665665
INDEX(c_char));
@@ -844,19 +844,19 @@ Warnings:
844844
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_year` in (NULL,NULL))
845845
EXPLAIN SELECT * FROM t1 WHERE c_char IN ('1', '2', '3');
846846
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
847-
1 SIMPLE t1 NULL range c_char c_char 10 NULL 3 100.00 Using where; Using MRR
847+
1 SIMPLE t1 NULL range c_char c_char 40 NULL 3 100.00 Using where; Using MRR
848848
Warnings:
849849
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` in ('1','2','3'))
850850
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, '1', '2', '3');
851851
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
852-
1 SIMPLE t1 NULL range c_char c_char 10 NULL 3 100.00 Using where; Using MRR
852+
1 SIMPLE t1 NULL range c_char c_char 40 NULL 3 100.00 Using where; Using MRR
853853
Warnings:
854854
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` in (NULL,'1','2','3'))
855855
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL);
856856
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
857857
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
858858
Warnings:
859-
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where multiple equal(NULL, `test`.`t1`.`c_char`)
859+
Note 1003 /* select#1 */ select `test`.`t1`.`c_int` AS `c_int`,`test`.`t1`.`c_decimal` AS `c_decimal`,`test`.`t1`.`c_float` AS `c_float`,`test`.`t1`.`c_bit` AS `c_bit`,`test`.`t1`.`c_date` AS `c_date`,`test`.`t1`.`c_datetime` AS `c_datetime`,`test`.`t1`.`c_timestamp` AS `c_timestamp`,`test`.`t1`.`c_time` AS `c_time`,`test`.`t1`.`c_year` AS `c_year`,`test`.`t1`.`c_char` AS `c_char` from `test`.`t1` where (`test`.`t1`.`c_char` = NULL)
860860
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, NULL);
861861
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
862862
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table

0 commit comments

Comments
 (0)