Skip to content

Commit 6d5ebe8

Browse files
author
Tor Didriksen
committed
Bug#25474239 MISC MTR TESTS FAIL WHEN CHANGING DEFAULT CHARACTER SET FOR DATABASE
Patch #9 Also: Some tests failed in debug mode due to some DBUG_PRINT in the range optimizer. Fix: check _db_enabled_() before doing any tree traversal To repeat: ./mtr --charset-for-testdb=utf8mb4 --defaults-file=include/utf8mb4_my.cnf locking_part innodb_icp innodb_icp_all innodb_icp_none myisam_icp myisam_icp_all myisam_icp_none optimizer_bug12837084 subselect_innodb.test select_all select_all_bka select_all_bka_nixbnl select_icp_mrr select_icp_mrr_bka select_icp_mrr_bka_nixbnl select_none select_none_bka select_none_bka_nixbnl Change-Id: I480fac2801e4135aa6d06c9ee8eb86d3f1f935d8
1 parent b10ec1b commit 6d5ebe8

39 files changed

+567
-919
lines changed

mysql-test/include/icp_tests.inc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ DROP TABLE t1;
2626
# the pushed index condition it is still evaluated.
2727
#
2828

29-
CREATE TABLE t1 (a INT);
29+
CREATE TABLE t1 (a INT) charset latin1;
3030
INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
3131

32-
CREATE TABLE t2 (a INT);
32+
CREATE TABLE t2 (a INT) charset latin1;
3333
INSERT INTO t2 SELECT A.a + 10*(B.a + 10*C.a) FROM t1 A, t1 B, t1 C;
3434

3535
CREATE TABLE t3 (
@@ -424,7 +424,7 @@ CREATE TABLE t3 (
424424
c1 TINYTEXT NOT NULL,
425425
i1 INT NOT NULL,
426426
KEY (c1(6),i1)
427-
);
427+
) charset utf8mb4;
428428

429429
-- disable_query_log
430430
-- disable_result_log
@@ -526,7 +526,7 @@ CREATE TABLE t1 (
526526
c2 INT NOT NULL,
527527
PRIMARY KEY (c2),
528528
KEY id1 (c1(4))
529-
);
529+
) charset utf8mb4;
530530

531531
INSERT INTO t1 VALUES ('Anastasia', 5);
532532
INSERT INTO t1 VALUES ('Karianne', 4);
@@ -555,7 +555,7 @@ CREATE TABLE t1 (
555555

556556
KEY (col_int_key),
557557
KEY (col_varchar_key, col_int_key)
558-
) stats_persistent=0;
558+
) charset utf8mb4 stats_persistent=0;
559559

560560
INSERT INTO t1 VALUES (NULL,2,'w');
561561
INSERT INTO t1 VALUES (7,9,'m');
@@ -644,7 +644,7 @@ DROP TABLE t1, t2;
644644
CREATE TABLE t1 (
645645
i1 INTEGER NOT NULL,
646646
c1 VARCHAR(1) NOT NULL
647-
);
647+
) charset latin1;
648648

649649
INSERT INTO t1 VALUES (2,'w');
650650

@@ -653,14 +653,14 @@ CREATE TABLE t2 (
653653
c1 VARCHAR(1) NOT NULL,
654654
c2 VARCHAR(1) NOT NULL,
655655
KEY (c1, i1)
656-
);
656+
) charset latin1;
657657

658658
INSERT INTO t2 VALUES (8,'d','d');
659659
INSERT INTO t2 VALUES (4,'v','v');
660660

661661
CREATE TABLE t3 (
662662
c1 VARCHAR(1) NOT NULL
663-
);
663+
) charset latin1;
664664

665665
INSERT INTO t3 VALUES ('v');
666666

@@ -965,7 +965,7 @@ CREATE TABLE t1 (
965965
i1 INTEGER,
966966
c1 VARCHAR(1),
967967
KEY col_varchar_key (c1)
968-
);
968+
) charset utf8mb4;
969969

970970
INSERT INTO t1 VALUES (1,'j'), (0,'e'), (210,'f'), (8,'v'), (7,'x'),
971971
(5,'m'), (NULL,'c');
@@ -974,15 +974,15 @@ CREATE TABLE t2 (
974974
i1 INTEGER,
975975
c1 VARCHAR(1),
976976
KEY col_varchar_key (c1)
977-
);
977+
) charset utf8mb4;
978978

979979
INSERT INTO t2 VALUES (8,NULL);
980980

981981
CREATE TABLE t3 (
982982
i1 INTEGER,
983983
c1 VARCHAR(1),
984984
KEY col_varchar_key (c1)
985-
) ENGINE=InnoDB;
985+
) charset utf8mb4 ENGINE=InnoDB;
986986

987987
INSERT INTO t3 VALUES (NULL,'w'), (1,NULL), (2,'d');
988988

@@ -1029,7 +1029,7 @@ CREATE TABLE t1 (
10291029
a INTEGER NOT NULL,
10301030
b CHAR(1),
10311031
KEY(b)
1032-
);
1032+
) charset utf8mb4;
10331033

10341034
INSERT INTO t1 VALUES (23,5,'d');
10351035

mysql-test/include/select.inc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ CREATE TABLE t2 (
3939
UNIQUE fld1 (fld1),
4040
KEY fld3 (fld3),
4141
PRIMARY KEY (auto)
42-
);
42+
) charset utf8mb4;
4343

4444
#
4545
# Populate table
@@ -1997,7 +1997,7 @@ DROP TABLE t1, t2;
19971997
# Test case for bug 7098: substitution of a constant for a string field
19981998
#
19991999

2000-
CREATE TABLE t1 ( city char(30) );
2000+
CREATE TABLE t1 ( city char(30) ) charset utf8mb4;
20012001
INSERT INTO t1 VALUES ('London');
20022002
INSERT INTO t1 VALUES ('Paris');
20032003

@@ -2241,7 +2241,7 @@ create table t1 (f1 int not null auto_increment primary key, f2 varchar(10));
22412241
create table t11 like t1;
22422242
insert into t1 values(1,""),(2,"");
22432243
analyze table t1, t11;
2244-
--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
2244+
--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X 15 X
22452245
show table status like 't1%';
22462246
select 123 as a from t1 where f1 is null;
22472247
drop table t1,t11;
@@ -2613,7 +2613,7 @@ SELECT IFNULL(NULL, NULL);
26132613
SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE='';
26142614
SHOW LOCAL VARIABLES LIKE 'SQL_MODE';
26152615

2616-
CREATE TABLE BUG_12595(a varchar(100));
2616+
CREATE TABLE BUG_12595(a varchar(100)) charset latin1;
26172617
INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an");
26182618
SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%';
26192619
SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*';
@@ -3088,8 +3088,8 @@ drop table t1;
30883088
# Bug #22735: no equality propagation for BETWEEN and IN with STRING arguments
30893089
#
30903090

3091-
CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16));
3092-
CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10));
3091+
CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)) charset utf8mb4;
3092+
CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)) charset utf8mb4;
30933093

30943094
INSERT INTO t1 VALUES
30953095
('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'),
@@ -3116,9 +3116,9 @@ DROP TABLE t1,t2;
31163116
# Bug #22367: Optimizer uses ref join type instead of eq_ref for simple
31173117
# join on strings
31183118
#
3119-
CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a));
3119+
CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a)) charset utf8mb4;
31203120
CREATE TABLE t2 (a int, b varchar(20) NOT NULL,
3121-
PRIMARY KEY (a), UNIQUE KEY (b));
3121+
PRIMARY KEY (a), UNIQUE KEY (b)) charset utf8mb4;
31223122
INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c');
31233123
INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c');
31243124

@@ -3309,7 +3309,7 @@ insert into t1 values
33093309
(coalesce(9223372036854775808, 1));
33103310
select * from t1;
33113311
drop table t1;
3312-
create table t1 select
3312+
create table t1 charset utf8mb4 select
33133313
if(1, 9223372036854775808, 1) i,
33143314
case when 1 then 9223372036854775808 else 1 end c,
33153315
coalesce(9223372036854775808, 1) co;
@@ -3325,8 +3325,8 @@ select
33253325
# Bug #22971: indexes on text columns are ignored for ref accesses
33263326
#
33273327

3328-
CREATE TABLE t1 (name varchar(255));
3329-
CREATE TABLE t2 (name varchar(255), n int, KEY (name(3)));
3328+
CREATE TABLE t1 (name varchar(255)) charset latin1;
3329+
CREATE TABLE t2 (name varchar(255), n int, KEY (name(3))) charset latin1;
33303330
INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa');
33313331
INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3);
33323332
INSERT INTO t2 VALUES (concat('cc ', 0x06), 4);
@@ -3347,8 +3347,8 @@ SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
33473347

33483348
DROP TABLE t1,t2;
33493349

3350-
CREATE TABLE t1 (name text);
3351-
CREATE TABLE t2 (name text, n int, KEY (name(3)));
3350+
CREATE TABLE t1 (name text) charset latin1;
3351+
CREATE TABLE t2 (name text, n int, KEY (name(3))) charset latin1;
33523352
INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa');
33533353
INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3);
33543354
INSERT INTO t2 VALUES (concat('cc ', 0x06), 4);
@@ -3473,7 +3473,7 @@ CREATE TABLE t1 (
34733473
c3 bigint(20) DEFAULT NULL,
34743474
c4 bigint(20) DEFAULT NULL,
34753475
PRIMARY KEY (c1)
3476-
);
3476+
) charset utf8mb4;
34773477

34783478
EXPLAIN EXTENDED
34793479
SELECT join_2.c1
@@ -3751,15 +3751,15 @@ CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0',
37513751
f4 varchar(255) NOT NULL default '',
37523752
PRIMARY KEY (f1),
37533753
KEY key1 (f4),
3754-
KEY key2 (f2));
3754+
KEY key2 (f2)) charset latin1;
37553755
CREATE TABLE t2 (f1 int(11) NOT NULL default '0',
37563756
f2 enum('A1','A2','A3') NOT NULL default 'A1',
37573757
f3 int(11) NOT NULL default '0',
37583758
PRIMARY KEY (f1),
3759-
KEY key1 (f3));
3759+
KEY key1 (f3)) charset latin1;
37603760
CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0',
37613761
f2 datetime NOT NULL default '1980-01-01 00:00:00',
3762-
PRIMARY KEY (f1));
3762+
PRIMARY KEY (f1)) charset latin1;
37633763

37643764
insert into t1 values (1, 1, 1, 'abc');
37653765
insert into t1 values (2, 1, 2, 'def');
@@ -3866,7 +3866,7 @@ SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
38663866
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
38673867
DROP TABLE t1;
38683868

3869-
CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL);
3869+
CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL) charset utf8mb4;
38703870
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
38713871
SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
38723872
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
@@ -4169,7 +4169,7 @@ DROP TABLE t1;
41694169
--echo # Bug #54459: Assertion failed: param.sort_length,
41704170
--echo # file .\filesort.cc, line 149 (part II)
41714171
--echo #
4172-
CREATE TABLE t1(a ENUM('') NOT NULL);
4172+
CREATE TABLE t1(a ENUM('') NOT NULL) charset latin1;
41734173
INSERT INTO t1 VALUES (), (), ();
41744174
EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
41754175
SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;

mysql-test/r/innodb_icp.result

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ SELECT * FROM t1 WHERE c1='3' FOR UPDATE;
1313
c1 c2
1414
3 NULL
1515
DROP TABLE t1;
16-
CREATE TABLE t1 (a INT);
16+
CREATE TABLE t1 (a INT) charset latin1;
1717
INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
18-
CREATE TABLE t2 (a INT);
18+
CREATE TABLE t2 (a INT) charset latin1;
1919
INSERT INTO t2 SELECT A.a + 10*(B.a + 10*C.a) FROM t1 A, t1 B, t1 C;
2020
CREATE TABLE t3 (
2121
c1 CHAR(10) NOT NULL,
@@ -389,11 +389,11 @@ CREATE TABLE t3 (
389389
c1 TINYTEXT NOT NULL,
390390
i1 INT NOT NULL,
391391
KEY (c1(6),i1)
392-
);
392+
) charset utf8mb4;
393393
INSERT INTO t3 SELECT CONCAT('c-',1000+t2.a,'=w'), 1 FROM t2;
394394
EXPLAIN SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2;
395395
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
396-
1 SIMPLE t3 NULL range c1 c1 12 NULL 2 33.33 Using index condition; Using where
396+
1 SIMPLE t3 NULL range c1 c1 30 NULL 2 33.33 Using index condition; Using where
397397
Warnings:
398398
Note 1003 /* select#1 */ select `test`.`t3`.`c1` AS `c1` from `test`.`t3` where ((`test`.`t3`.`c1` >= 'c-1004=w') and (`test`.`t3`.`c1` <= 'c-1006=w') and (`test`.`t3`.`i1` > 2))
399399
SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2;
@@ -475,14 +475,14 @@ c1 TINYTEXT NOT NULL,
475475
c2 INT NOT NULL,
476476
PRIMARY KEY (c2),
477477
KEY id1 (c1(4))
478-
);
478+
) charset utf8mb4;
479479
INSERT INTO t1 VALUES ('Anastasia', 5);
480480
INSERT INTO t1 VALUES ('Karianne', 4);
481481
SELECT * FROM t1 WHERE (c1 <= '6566-06-15' AND c2 <> 3);
482482
c1 c2
483483
EXPLAIN SELECT * FROM t1 WHERE (c1 <= '6566-06-15' AND c2 <> 3);
484484
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
485-
1 SIMPLE t1 NULL range PRIMARY,id1 id1 6 NULL 1 100.00 Using index condition; Using where
485+
1 SIMPLE t1 NULL range PRIMARY,id1 id1 18 NULL 1 100.00 Using index condition; Using where
486486
Warnings:
487487
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,`test`.`t1`.`c2` AS `c2` from `test`.`t1` where ((`test`.`t1`.`c1` <= '6566-06-15') and (`test`.`t1`.`c2` <> 3))
488488
DROP TABLE t1;
@@ -496,7 +496,7 @@ col_int_key INTEGER,
496496
col_varchar_key VARCHAR(1),
497497
KEY (col_int_key),
498498
KEY (col_varchar_key, col_int_key)
499-
) stats_persistent=0;
499+
) charset utf8mb4 stats_persistent=0;
500500
INSERT INTO t1 VALUES (NULL,2,'w');
501501
INSERT INTO t1 VALUES (7,9,'m');
502502
INSERT INTO t1 VALUES (9,3,'m');
@@ -528,7 +528,7 @@ WHERE table3.col_int_key != SOME ( SELECT c1 FROM t2 );
528528
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
529529
1 PRIMARY table1 NULL ALL col_int_key NULL NULL NULL 19 100.00 NULL
530530
1 PRIMARY table3 NULL ALL col_varchar_key NULL NULL NULL 19 10.00 Using where; Using join buffer (Block Nested Loop)
531-
1 PRIMARY table2 NULL ref col_varchar_key col_varchar_key 4 test.table3.col_varchar_key 1 100.00 Using index
531+
1 PRIMARY table2 NULL ref col_varchar_key col_varchar_key 7 test.table3.col_varchar_key 1 100.00 Using index
532532
2 DEPENDENT SUBQUERY t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where
533533
Warnings:
534534
Note 1003 /* select#1 */ select `test`.`table1`.`col_int_nokey` AS `col_int_nokey` from `test`.`t1` `table1` join `test`.`t1` `table2` join `test`.`t1` `table3` where ((`test`.`table2`.`col_varchar_key` = `test`.`table3`.`col_varchar_key`) and (`test`.`table3`.`col_int_nokey` = `test`.`table1`.`col_int_key`) and <nop>(<in_optimizer>(`test`.`table3`.`col_int_key`,<exists>(/* select#2 */ select 1 from `test`.`t2` where <if>(outer_field_is_not_null, (<cache>(`test`.`table3`.`col_int_key`) <> `test`.`t2`.`c1`), true)))))
@@ -574,19 +574,19 @@ DROP TABLE t1, t2;
574574
CREATE TABLE t1 (
575575
i1 INTEGER NOT NULL,
576576
c1 VARCHAR(1) NOT NULL
577-
);
577+
) charset latin1;
578578
INSERT INTO t1 VALUES (2,'w');
579579
CREATE TABLE t2 (
580580
i1 INTEGER NOT NULL,
581581
c1 VARCHAR(1) NOT NULL,
582582
c2 VARCHAR(1) NOT NULL,
583583
KEY (c1, i1)
584-
);
584+
) charset latin1;
585585
INSERT INTO t2 VALUES (8,'d','d');
586586
INSERT INTO t2 VALUES (4,'v','v');
587587
CREATE TABLE t3 (
588588
c1 VARCHAR(1) NOT NULL
589-
);
589+
) charset latin1;
590590
INSERT INTO t3 VALUES ('v');
591591
EXPLAIN SELECT i1
592592
FROM t1
@@ -865,20 +865,20 @@ CREATE TABLE t1 (
865865
i1 INTEGER,
866866
c1 VARCHAR(1),
867867
KEY col_varchar_key (c1)
868-
);
868+
) charset utf8mb4;
869869
INSERT INTO t1 VALUES (1,'j'), (0,'e'), (210,'f'), (8,'v'), (7,'x'),
870870
(5,'m'), (NULL,'c');
871871
CREATE TABLE t2 (
872872
i1 INTEGER,
873873
c1 VARCHAR(1),
874874
KEY col_varchar_key (c1)
875-
);
875+
) charset utf8mb4;
876876
INSERT INTO t2 VALUES (8,NULL);
877877
CREATE TABLE t3 (
878878
i1 INTEGER,
879879
c1 VARCHAR(1),
880880
KEY col_varchar_key (c1)
881-
) ENGINE=InnoDB;
881+
) charset utf8mb4 ENGINE=InnoDB;
882882
INSERT INTO t3 VALUES (NULL,'w'), (1,NULL), (2,'d');
883883
set @old_opt_switch=@@optimizer_switch;
884884
EXPLAIN SELECT i1
@@ -893,7 +893,7 @@ XOR i1;
893893
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
894894
1 PRIMARY t3 NULL ALL NULL NULL NULL NULL 3 100.00 Using where
895895
2 DEPENDENT SUBQUERY t2 NULL ALL col_varchar_key NULL NULL NULL 1 100.00 NULL
896-
2 DEPENDENT SUBQUERY t1 NULL ref_or_null col_varchar_key col_varchar_key 4 func 2 33.33 Using where; Full scan on NULL key
896+
2 DEPENDENT SUBQUERY t1 NULL ref_or_null col_varchar_key col_varchar_key 7 func 2 33.33 Using where; Full scan on NULL key
897897
Warnings:
898898
Note 1003 /* select#1 */ select `test`.`t3`.`i1` AS `i1` from `test`.`t3` where (<in_optimizer>(`test`.`t3`.`c1`,<exists>(/* select#2 */ select 1 from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`c1` > `test`.`t2`.`c1`) and <if>(outer_field_is_not_null, ((<cache>(`test`.`t3`.`c1`) = `test`.`t1`.`c1`) or isnull(`test`.`t1`.`c1`)), true) and (`test`.`t2`.`i1` >= `test`.`t1`.`i1`)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t1`.`c1`), true))) xor `test`.`t3`.`i1`)
899899
SELECT i1
@@ -918,16 +918,16 @@ pk INTEGER PRIMARY KEY,
918918
a INTEGER NOT NULL,
919919
b CHAR(1),
920920
KEY(b)
921-
);
921+
) charset utf8mb4;
922922
INSERT INTO t1 VALUES (23,5,'d');
923923
EXPLAIN SELECT a1.pk
924924
FROM t1 AS a1 JOIN (SELECT * FROM t1 LIMIT 1) AS a2 ON a2.b = a1.b
925925
WHERE a1.a = (SELECT pk FROM t1 LIMIT 1)
926926
AND (a1.a != a2.a OR a1.b IS NULL);
927927
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
928928
1 PRIMARY <derived2> NULL system NULL NULL NULL NULL 1 100.00 NULL
929-
1 PRIMARY a1 NULL ref b b 2 const 1 100.00 Using where
930-
3 SUBQUERY t1 NULL index NULL b 2 NULL 1 100.00 Using index
929+
1 PRIMARY a1 NULL ref b b 5 const 1 100.00 Using where
930+
3 SUBQUERY t1 NULL index NULL b 5 NULL 1 100.00 Using index
931931
2 DERIVED t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL
932932
Warnings:
933933
Note 1003 /* select#1 */ select `test`.`a1`.`pk` AS `pk` from `test`.`t1` `a1` where ((`test`.`a1`.`b` = 'd') and (`test`.`a1`.`a` = (/* select#3 */ select `test`.`t1`.`pk` from `test`.`t1` limit 1)) and (((/* select#3 */ select `test`.`t1`.`pk` from `test`.`t1` limit 1) <> '5') or isnull(`test`.`a1`.`b`)))
@@ -943,8 +943,8 @@ WHERE a1.a = (SELECT pk FROM v1 LIMIT 1)
943943
AND (a1.a != a2.a OR a1.b IS NULL);
944944
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
945945
1 PRIMARY <derived2> NULL system NULL NULL NULL NULL 1 100.00 NULL
946-
1 PRIMARY t1 NULL ref b b 2 const 1 100.00 Using where
947-
3 SUBQUERY t1 NULL index NULL b 2 NULL 1 100.00 Using index
946+
1 PRIMARY t1 NULL ref b b 5 const 1 100.00 Using where
947+
3 SUBQUERY t1 NULL index NULL b 5 NULL 1 100.00 Using index
948948
2 DERIVED t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL
949949
Warnings:
950950
Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where ((`test`.`t1`.`b` = 'd') and (`test`.`t1`.`a` = (/* select#3 */ select `test`.`t1`.`pk` from `test`.`t1` limit 1)) and ((`test`.`t1`.`a` <> '5') or isnull(`test`.`t1`.`b`)))

0 commit comments

Comments
 (0)