diff options
author | Sergei Petrunia <sergey@mariadb.com> | 2022-12-22 15:49:10 +0300 |
---|---|---|
committer | Sergei Petrunia <sergey@mariadb.com> | 2023-01-04 16:50:12 +0300 |
commit | 0bef50e50b59ea1d85fea027f45cc51ca74e4074 (patch) | |
tree | b358f442e3e4a48a443a7cf732ab2a37bbac04d6 | |
parent | 5db970fc760d4cfebdff236ba5bb382f0419b9f1 (diff) | |
download | mariadb-git-bb-10.4-mdev20501-v2.tar.gz |
MDEV-20501: Assertion `maybe_null || !null_value' failed in Item_func_round::date_opbb-10.4-mdev20501-v2
When the optimizer finds a constant (or system) table $TBL which is empty
or has no matching row, it would set table->null_row=true. This is done
even for tables with table->maybe_null==0.
Then, it would proceed to perform query optimization phases (what for?)
which will attempt to evaluate Item expressions referring to $TBL.
Eventually some Item expression will get the value of $TBL.not_null_field,
get SQL NULL and fail an assertion.
Fixed by not performing any query optimization steps after we've got
constant/empty tables with no matching rows.
Test result changes contain a lot of changes like
- ... Impossible WHERE noticed after reading const tables
+ ... no matching row in const table
as well as other changes caused by slightly-different processing of
the special case of empty constant tables.
57 files changed, 441 insertions, 433 deletions
diff --git a/mysql-test/main/analyze_stmt_privileges2.result b/mysql-test/main/analyze_stmt_privileges2.result index 2b75f736a22..da7dcca0c07 100644 --- a/mysql-test/main/analyze_stmt_privileges2.result +++ b/mysql-test/main/analyze_stmt_privileges2.result @@ -1452,15 +1452,14 @@ id select_type table type possible_keys key key_len ref rows r_rows filtered r_f DELETE FROM t1 USING t1, t2; EXPLAIN DELETE FROM t1 USING t1, t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table ANALYZE DELETE FROM t1 USING t1, t2; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a; EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table @@ -1797,15 +1796,14 @@ id select_type table type possible_keys key key_len ref rows r_rows filtered r_f DELETE FROM t1 USING t1, t2; EXPLAIN DELETE FROM t1 USING t1, t2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found -1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table ANALYZE DELETE FROM t1 USING t1, t2; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a; EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table ANALYZE DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table @@ -1813,7 +1811,7 @@ SELECT * FROM t1; a b EXPLAIN SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table ANALYZE SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table @@ -1821,7 +1819,7 @@ SELECT * FROM t1 WHERE a = 10; a b EXPLAIN SELECT * FROM t1 WHERE a = 10; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table ANALYZE SELECT * FROM t1 WHERE a = 10; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table @@ -1829,7 +1827,7 @@ SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 ); a b EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 ); id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table diff --git a/mysql-test/main/derived.result b/mysql-test/main/derived.result index bee77be2e11..7c75a234ebd 100644 --- a/mysql-test/main/derived.result +++ b/mysql-test/main/derived.result @@ -907,34 +907,7 @@ WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_N A.DIVISION=C1.DIVISION AND A.RECEIVABLE_GROUP=C1.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=C1.CREDIT_LIMIT ORDER BY TOTAL DESC; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived3> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived4> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived5> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived6> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived7> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived8> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived9> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived10> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived11> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived12> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived13> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived14> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived15> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived16> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived17> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived18> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived19> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived20> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived21> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived22> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived23> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived24> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived25> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived26> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived27> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived28> system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY <derived29> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 29 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table 28 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table 27 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index 2c2d959a953..402a4f98e32 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -16845,7 +16845,7 @@ pk EXPLAIN EXTENDED WITH cte AS ( SELECT pk FROM t1 WHERE pk IS NULL GROUP BY pk ) SELECT * FROM cte; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: Note 1003 with cte as (/* select#2 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where 0 group by `test`.`t1`.`pk`)/* select#1 */ select NULL AS `pk` from `cte` @@ -16937,10 +16937,10 @@ f f EXPLAIN EXTENDED SELECT * FROM v1 JOIN v2 ON v1.f = v2.f; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 /* select#1 */ select NULL AS `f`,`v2`.`f` AS `f` from `test`.`t1` `a` straight_join `test`.`t1` `b` join `test`.`v2` where 0 +Note 1003 /* select#1 */ select NULL AS `f`,NULL AS `f` from `test`.`t1` `a` straight_join `test`.`t1` `b` join `test`.`v2` where multiple equal(NULL, NULL) DROP VIEW v1,v2; DROP TABLE t1; # @@ -18207,7 +18207,7 @@ select * from v1; f explain select * from v1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using temporary drop view v1; diff --git a/mysql-test/main/derived_opt.result b/mysql-test/main/derived_opt.result index 907c97e92d4..28acd620d53 100644 --- a/mysql-test/main/derived_opt.result +++ b/mysql-test/main/derived_opt.result @@ -161,25 +161,25 @@ set @stmt= ' explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0 prepare stmt1 from @stmt ; execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table deallocate prepare stmt1; drop tables t1,t2; set @@optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/main/explain.result b/mysql-test/main/explain.result index 8a9fd3c5390..5aff685780f 100644 --- a/mysql-test/main/explain.result +++ b/mysql-test/main/explain.result @@ -2,7 +2,7 @@ drop table if exists t1; create table t1 (id int not null, str char(10), unique(str)); explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table insert into t1 values (1, null),(2, null),(3, "foo"),(4, "bar"); select * from t1 where str is null; id str @@ -217,11 +217,10 @@ SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 SUBQUERY t system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where 0 +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` where <not>(<in_optimizer>(NULL,(/* select#2 */ select max(NULL) from `test`.`t1` join `test`.`t1` `t`) >= <cache>(NULL))) SET SESSION sql_mode=@old_sql_mode; DROP TABLE t1; End of 5.0 tests. @@ -299,7 +298,7 @@ INSERT INTO t2 VALUES ('1'), ('2'), ('3'); FLUSH TABLES; EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT 1 FROM t1 t JOIN t2 WHERE b <= 1 AND t.a); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table DROP TABLE t1, t2; # @@ -393,7 +392,7 @@ set optimizer_switch='derived_merge=off,derived_with_keys=off'; EXPLAIN EXTENDED SELECT * FROM ( SELECT t1.a FROM t1,t2 WHERE t2.a = t1.a ) AS t; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select NULL AS `a` from (/* select#2 */ select NULL AS `a` from `test`.`t1` where 0) `t` @@ -459,3 +458,21 @@ id select_type table type possible_keys key key_len ref rows Extra NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL Warnings: Note 1249 Select 4 was reduced during optimization +# +# MDEV-20501: Assertion `maybe_null || !null_value' failed in Item_func_round::date_op +# +CREATE TABLE t1 (t TIMESTAMP NOT NULL) ENGINE=MyISAM; +SELECT * FROM t1 WHERE TRUNCATE( t, 1 ); +t +DROP TABLE t1; +# +# MDEV-26536: Assertion `maybe_null() || !null_value' failed in Item_func_ceiling::time_op +# +CREATE TABLE t1 (a INT,b TIME NOT NULL DEFAULT 1) ENGINE=MyISAM; +SELECT b FROM t1 GROUP BY b HAVING CEILING (b)>0; +b +drop table t1; +create table t1 (b time not null ) engine=myisam; +select floor(b) as f from t1 group by b having f=1; +f +drop table t1; diff --git a/mysql-test/main/explain.test b/mysql-test/main/explain.test index 0c31f94f8f9..245b10e183c 100644 --- a/mysql-test/main/explain.test +++ b/mysql-test/main/explain.test @@ -370,3 +370,23 @@ drop table t1; explain VALUES ( (VALUES (2))) UNION VALUES ( (SELECT 3)); + +--echo # +--echo # MDEV-20501: Assertion `maybe_null || !null_value' failed in Item_func_round::date_op +--echo # + +CREATE TABLE t1 (t TIMESTAMP NOT NULL) ENGINE=MyISAM; +SELECT * FROM t1 WHERE TRUNCATE( t, 1 ); +DROP TABLE t1; + +--echo # +--echo # MDEV-26536: Assertion `maybe_null() || !null_value' failed in Item_func_ceiling::time_op +--echo # +CREATE TABLE t1 (a INT,b TIME NOT NULL DEFAULT 1) ENGINE=MyISAM; +SELECT b FROM t1 GROUP BY b HAVING CEILING (b)>0; +drop table t1; + +create table t1 (b time not null ) engine=myisam; +select floor(b) as f from t1 group by b having f=1; +drop table t1; + diff --git a/mysql-test/main/explain_json.result b/mysql-test/main/explain_json.result index 17f83fe5362..a87a56a05cc 100644 --- a/mysql-test/main/explain_json.result +++ b/mysql-test/main/explain_json.result @@ -1203,7 +1203,7 @@ create table t1 (i int) engine=myisam; explain select * from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain format=json select * from t1; EXPLAIN @@ -1211,11 +1211,7 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "t1", - "access_type": "system", - "rows": 0, - "filtered": 0, - "const_row_not_found": true + "message": "no matching row in const table" } } } diff --git a/mysql-test/main/explain_non_select.result b/mysql-test/main/explain_non_select.result index 111b4c8ae50..852f3d19d18 100644 --- a/mysql-test/main/explain_non_select.result +++ b/mysql-test/main/explain_non_select.result @@ -173,7 +173,7 @@ partition p2 values less than (30) insert into t1 values (9,9), (19,19), (29,29); explain partitions select * from t1 where a in (32,33); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions delete from t1 where a in (32,33); id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No matching rows after partition pruning diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result index 5908b41c61a..84a61c5a22f 100644 --- a/mysql-test/main/func_group.result +++ b/mysql-test/main/func_group.result @@ -2069,7 +2069,7 @@ HAVING ('m') IN ( SELECT v FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table set optimizer_switch=@tmp_optimizer_switch; diff --git a/mysql-test/main/func_group_innodb.result b/mysql-test/main/func_group_innodb.result index a4c9b574585..f00c0cad995 100644 --- a/mysql-test/main/func_group_innodb.result +++ b/mysql-test/main/func_group_innodb.result @@ -130,15 +130,13 @@ select 1, max(1) from t1i where 1=99; 1 NULL explain select count(*), min(7), max(7) from t1m, t1i; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1m system NULL NULL NULL NULL 0 Const row not found -1 SIMPLE t1i ALL NULL NULL NULL NULL 1 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table select count(*), min(7), max(7) from t1m, t1i; count(*) min(7) max(7) 0 NULL NULL explain select count(*), min(7), max(7) from t1m, t2i; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1m system NULL NULL NULL NULL 0 Const row not found -1 SIMPLE t2i ALL NULL NULL NULL NULL 1 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table select count(*), min(7), max(7) from t1m, t2i; count(*) min(7) max(7) 0 NULL NULL diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result index 2f692f9135e..425b93a7f9f 100644 --- a/mysql-test/main/func_str.result +++ b/mysql-test/main/func_str.result @@ -1341,12 +1341,12 @@ DROP TABLE t1; create table t1(f1 varchar(4)); explain extended select encode(f1,'zxcv') as 'enc' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select encode(NULL,'zxcv') AS `enc` from `test`.`t1` explain extended select decode(f1,'zxcv') as 'enc' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select decode(NULL,'zxcv') AS `enc` from `test`.`t1` drop table t1; diff --git a/mysql-test/main/group_min_max.result b/mysql-test/main/group_min_max.result index fd9b5be4260..43d70888e11 100644 --- a/mysql-test/main/group_min_max.result +++ b/mysql-test/main/group_min_max.result @@ -2982,7 +2982,7 @@ NULL EXPLAIN SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); id select_type table type possible_keys key key_len ref rows Extra -x x x x x x x x x Impossible WHERE noticed after reading const tables +x x x x x x x x x no matching row in const table x x x x x x x x x Using where; Using index SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); MIN( a ) diff --git a/mysql-test/main/join_outer.result b/mysql-test/main/join_outer.result index b7fcb55e4fe..8eaebe9d635 100644 --- a/mysql-test/main/join_outer.result +++ b/mysql-test/main/join_outer.result @@ -2488,9 +2488,9 @@ ON t1.pk = t2.pk AND t2.v2 = tb1.v1 WHERE tb1.pk = 40 ORDER BY tb1.i1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(NULL, NULL)) where 0 order by NULL +Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(NULL, NULL)) where multiple equal(40, NULL) and multiple equal(10) and multiple equal('p', NULL) order by NULL EXPLAIN EXTENDED SELECT STRAIGHT_JOIN t2.v2 FROM @@ -2501,9 +2501,9 @@ ON t1.pk = t2.pk AND t2.v2 = tb1.v1 WHERE tb1.pk = 40 ORDER BY tb1.i1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(NULL, NULL)) where 0 order by NULL +Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(NULL, NULL)) where multiple equal(40, NULL) and multiple equal(10) and multiple equal('p', NULL) order by NULL SELECT STRAIGHT_JOIN DISTINCT t2.v2 FROM (t1 as tb1 LEFT JOIN t1 AS tb2 ON tb2.v1 = tb1.v2) diff --git a/mysql-test/main/join_outer_innodb.result b/mysql-test/main/join_outer_innodb.result index a0358094baa..12b6952ee86 100644 --- a/mysql-test/main/join_outer_innodb.result +++ b/mysql-test/main/join_outer_innodb.result @@ -40,7 +40,7 @@ WHERE t1.col_int_key BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk IN (5) ORDER BY pk; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT t1.pk FROM t2 LEFT JOIN t1 ON t2.pk = t1.col_int diff --git a/mysql-test/main/join_outer_jcl6.result b/mysql-test/main/join_outer_jcl6.result index 3cb846426fe..0ca383db604 100644 --- a/mysql-test/main/join_outer_jcl6.result +++ b/mysql-test/main/join_outer_jcl6.result @@ -2495,9 +2495,9 @@ ON t1.pk = t2.pk AND t2.v2 = tb1.v1 WHERE tb1.pk = 40 ORDER BY tb1.i1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(NULL, NULL)) where 0 order by NULL +Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(NULL, NULL)) where multiple equal(40, NULL) and multiple equal(10) and multiple equal('p', NULL) order by NULL EXPLAIN EXTENDED SELECT STRAIGHT_JOIN t2.v2 FROM @@ -2508,9 +2508,9 @@ ON t1.pk = t2.pk AND t2.v2 = tb1.v1 WHERE tb1.pk = 40 ORDER BY tb1.i1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(NULL, NULL)) where 0 order by NULL +Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(NULL, NULL)) where multiple equal(40, NULL) and multiple equal(10) and multiple equal('p', NULL) order by NULL SELECT STRAIGHT_JOIN DISTINCT t2.v2 FROM (t1 as tb1 LEFT JOIN t1 AS tb2 ON tb2.v1 = tb1.v2) diff --git a/mysql-test/main/limit_rows_examined.result b/mysql-test/main/limit_rows_examined.result index e87dd25cac9..67f5286c523 100644 --- a/mysql-test/main/limit_rows_examined.result +++ b/mysql-test/main/limit_rows_examined.result @@ -100,11 +100,11 @@ create table t0 (c0 int); explain select * from t0 LIMIT ROWS EXAMINED 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain select * from t0 LIMIT ROWS EXAMINED 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table select * from t0 LIMIT ROWS EXAMINED 1; c0 drop table t0; @@ -595,7 +595,7 @@ create table t3_empty like t3; explain select max(c1) from t3_empty LIMIT ROWS EXAMINED 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3_empty system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table select max(c1) from t3_empty LIMIT ROWS EXAMINED 0; max(c1) NULL diff --git a/mysql-test/main/mrr_icp_extra.result b/mysql-test/main/mrr_icp_extra.result index 1e98036fcbc..d2345b6f13a 100644 --- a/mysql-test/main/mrr_icp_extra.result +++ b/mysql-test/main/mrr_icp_extra.result @@ -61,7 +61,7 @@ SELECT d FROM t1, t2 WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE' ORDER BY t2.c LIMIT 1; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT d FROM t1, t2 WHERE t2.b=14 AND t2.a=t1.a AND 5.1<t2.c AND t1.b='DE' ORDER BY t2.c LIMIT 1; diff --git a/mysql-test/main/myisam_explain_non_select_all.result b/mysql-test/main/myisam_explain_non_select_all.result index 7f24cb4896d..90106e7536c 100644 --- a/mysql-test/main/myisam_explain_non_select_all.result +++ b/mysql-test/main/myisam_explain_non_select_all.result @@ -765,9 +765,9 @@ FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE t1.a > 0 ORDER BY t1.a; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select NULL AS `a` from `test`.`t1` where 0 order by NULL +Note 1003 select NULL AS `a` from `test`.`t1` where NULL > 0 order by NULL # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution Variable_name Value Handler_read_key 3 @@ -3021,12 +3021,12 @@ Warnings: Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead EXPLAIN INSERT INTO v1 SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED INSERT INTO v1 SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -3035,7 +3035,7 @@ FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select NULL AS `a` from `test`.`t1` # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution @@ -3247,7 +3247,7 @@ JOIN t1 AS a12 ON a12.c1 = a11.c1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table DROP TABLE t1, t2, t3; #73 CREATE TABLE t1 (id INT); @@ -3367,7 +3367,7 @@ CALL p16(); DROP PROCEDURE p16; CALL p15(); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table DROP PROCEDURE p15; CALL p14(); DROP PROCEDURE p14; @@ -3379,7 +3379,7 @@ CALL p12(); DROP PROCEDURE p12; CALL p11(); 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table DROP PROCEDURE p11; CALL p10(); DROP PROCEDURE p10; diff --git a/mysql-test/main/outfile.result b/mysql-test/main/outfile.result Binary files differindex 4c439c37e4d..02db378d23d 100644 --- a/mysql-test/main/outfile.result +++ b/mysql-test/main/outfile.result diff --git a/mysql-test/main/partition_explicit_prune.result b/mysql-test/main/partition_explicit_prune.result index 90e59681b7e..eb8bae6fbd1 100644 --- a/mysql-test/main/partition_explicit_prune.result +++ b/mysql-test/main/partition_explicit_prune.result @@ -473,10 +473,10 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p10-99_subp4,p10-99_subp5 index NULL PRIMARY 4 NULL 2 Using index EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 1000000; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 PARTITION (pNeg) WHERE a = 100; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table # Test how it changes the alias/keywords/reserved words SELECT * FROM t1 PARTITION; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 @@ -1626,7 +1626,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 partition (p2) where a=1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table drop table t1; # # Bug#59864: Crash if table empty: DELETE FROM t2 PARTITION (subp3). diff --git a/mysql-test/main/partition_innodb.result b/mysql-test/main/partition_innodb.result index 17d0c20ec99..7b8d655df31 100644 --- a/mysql-test/main/partition_innodb.result +++ b/mysql-test/main/partition_innodb.result @@ -205,13 +205,13 @@ insert INTO t1 VALUES (110); ERROR HY000: Table has no partition for value 110 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 90; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 90; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 90; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 89; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p90 ALL NULL NULL NULL NULL 3 Using where @@ -220,16 +220,16 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p90 ALL NULL NULL NULL NULL 3 Using where EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 89; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 100; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 100; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 100; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table DROP TABLE t1; # # Bug#50104: Partitioned table with just 1 partion works with fk diff --git a/mysql-test/main/partition_pruning.result b/mysql-test/main/partition_pruning.result index f8ae65fbcea..f4ab9f003e1 100644 --- a/mysql-test/main/partition_pruning.result +++ b/mysql-test/main/partition_pruning.result @@ -1811,7 +1811,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra @@ -1858,7 +1858,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index @@ -1891,7 +1891,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra @@ -1911,7 +1911,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra @@ -2111,7 +2111,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra @@ -2158,7 +2158,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where @@ -2191,7 +2191,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra @@ -2211,7 +2211,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra @@ -2235,7 +2235,7 @@ INSERT INTO t1 VALUES (1, '2009-01-01'), (2, NULL); # test with an invalid date, which lead to item->null_value is set. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-99' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Warning 1292 Incorrect datetime value: '2009-04-99' DROP TABLE t1; @@ -2300,10 +2300,10 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables explain partitions select * from t3 where a=20; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t3 where a=30; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table create table t4 (a int not null, b int not null) partition by LIST (a+b) ( partition p0 values in (12), partition p1 values in (14) @@ -2370,22 +2370,22 @@ partition p9 values in (9) insert into t6 values (1),(3),(5); explain partitions select * from t6 where a < 1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t6 where a <= 1; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t6 p1 system NULL NULL NULL NULL 1 explain partitions select * from t6 where a > 9; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t6 where a >= 9; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t6 where a > 0 and a < 5; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t6 p1,p3 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t6 where a > 5 and a < 12; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t6 where a > 3 and a < 8 ; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t6 p5,p7 system NULL NULL NULL NULL 1 @@ -2400,7 +2400,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t6 where a > 3 and a < 5; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table drop table t6; create table t6 (a int unsigned not null) partition by LIST(a) ( partition p1 values in (1), @@ -2412,22 +2412,22 @@ partition p9 values in (9) insert into t6 values (1),(3),(5); explain partitions select * from t6 where a < 1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t6 where a <= 1; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t6 p1 system NULL NULL NULL NULL 1 explain partitions select * from t6 where a > 9; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t6 where a >= 9; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t6 where a > 0 and a < 5; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t6 p1,p3 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t6 where a > 5 and a < 12; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t6 where a > 3 and a < 8 ; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t6 p5,p7 system NULL NULL NULL NULL 1 @@ -2442,7 +2442,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t6 where a > 3 and a < 5; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table create table t7 (a int not null) partition by RANGE(a) ( partition p10 values less than (10), partition p30 values less than (30), @@ -2453,16 +2453,16 @@ partition p90 values less than (90) insert into t7 values (10),(30),(50); explain partitions select * from t7 where a < 5; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a < 9; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a <= 9; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a = 9; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a >= 9; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where @@ -2471,7 +2471,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t7 where a < 10; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a <= 10; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p10,p30 system NULL NULL NULL NULL 1 @@ -2492,13 +2492,13 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t7 where a = 89; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a > 89; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a >= 89; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a < 90; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where @@ -2507,16 +2507,16 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t7 where a = 90; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a > 90; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a >= 90; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a > 91; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a > 11 and a < 29; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables @@ -2531,16 +2531,16 @@ partition p90 values less than (90) insert into t7 values (10),(30),(50); explain partitions select * from t7 where a < 5; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a < 9; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a <= 9; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a = 9; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a >= 9; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where @@ -2549,7 +2549,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t7 where a < 10; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a <= 10; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p10,p30 system NULL NULL NULL NULL 1 @@ -2570,13 +2570,13 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t7 where a = 89; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a > 89; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a >= 89; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a < 90; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where @@ -2585,16 +2585,16 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t7 where a = 90; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a > 90; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a >= 90; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a > 91; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t7 where a > 11 and a < 29; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables @@ -2615,7 +2615,7 @@ partition p2 values less than (732664) -- 2005-12-19 insert into t9 values ('2005-05-05'), ('2005-04-04'); explain partitions select * from t9 where a < '2004-12-19'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t9 where a <= '2004-12-19'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t9 p0,p1 ALL NULL NULL NULL NULL 2 Using where @@ -2637,7 +2637,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1,p2 system NULL NULL NULL NULL 1 explain partitions select * from t1 where a1 < 3 and a1 > 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table drop table t1; create table t3 (a int, b int) partition by list(a) subpartition by hash(b) subpartitions 4 ( @@ -3138,7 +3138,7 @@ drop table t2; create table t1 (s1 int); explain partitions select 1 from t1 union all select 2; id select_type table partitions type possible_keys key key_len ref rows Extra -1 PRIMARY t1 NULL system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used drop table t1; create table t1 (a bigint unsigned not null) partition by range(a) ( @@ -3170,7 +3170,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 where a = 18446744073709551614; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table drop table t1; create table t1 (a int) partition by range(a) ( @@ -3200,10 +3200,10 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 where a > 0xFE AND a <= 0xFF; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t2 where a > 0xFE AND a <= 0xFF; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where @@ -3239,7 +3239,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra explain partitions select * from t1 where a > 0xFFFFFFFFFFFFFFEC and a < 0xFFFFFFFFFFFFFFEE; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain partitions select * from t1 where a>=0 and a <= 0xFFFFFFFFFFFFFFFF; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1,p2,p3,p4 ALL NULL NULL NULL NULL 8 Using where @@ -3369,7 +3369,7 @@ SELECT * FROM t1 WHERE c1 = 2 AND c2 > 4; c1 c2 c3 c4 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 < 1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 1; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1 range PRIMARY PRIMARY 8 NULL 1 Using where @@ -3414,7 +3414,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p2 range PRIMARY PRIMARY 8 NULL 1 Using where EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 > 4; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table DROP TABLE t1; # # MDEV-6239: Partition pruning is not working as expected in an inner query diff --git a/mysql-test/main/partition_range.result b/mysql-test/main/partition_range.result index 15c65cefa34..f5d57604f4b 100644 --- a/mysql-test/main/partition_range.result +++ b/mysql-test/main/partition_range.result @@ -212,7 +212,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 pnull,p0 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 where a > 1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table drop table t1; create table t1 (a int unsigned, b int unsigned) partition by range (a) @@ -254,7 +254,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t1 where a > 1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table drop table t1; CREATE TABLE t1 ( a int not null, diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result index 6f5fc9d09ac..028aa2387bb 100644 --- a/mysql-test/main/ps.result +++ b/mysql-test/main/ps.result @@ -159,28 +159,28 @@ set @stmt= ' explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0 prepare stmt1 from @stmt ; execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table -5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table execute stmt1 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table -5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table -5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +4 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table deallocate prepare stmt1; set optimizer_switch=@tmp_optimizer_switch; drop tables t1,t2; @@ -4505,12 +4505,10 @@ CREATE TABLE t2 (b INT); PREPARE stmt FROM 'EXPLAIN UPDATE t1, t2 SET a = 1'; EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found -1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found -1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table deallocate prepare stmt; DROP TABLE t1, t2; # @@ -5507,14 +5505,13 @@ CREATE TABLE t1(c1 CHAR(255) PRIMARY KEY); PREPARE stmt FROM 'EXPLAIN DELETE b FROM t1 AS a JOIN t1 AS b'; EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE a system NULL NULL NULL NULL 0 Const row not found -1 SIMPLE b system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table DROP TABLE t1; CREATE TABLE t1(a INT); PREPARE stmt FROM 'EXPLAIN DELETE FROM t1.* USING t1'; EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table DEALLOCATE PREPARE stmt; DROP TABLE t1; # @@ -5526,15 +5523,15 @@ CREATE TABLE t2 (d int); # EXPLAIN EXTENDED in regular way (not PS mode) EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` +Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where multiple equal(NULL, NULL)) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` SHOW WARNINGS; Level Code Message Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` +Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where multiple equal(NULL, NULL)) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` # Now run the same EXPLAIN EXTENDED in PS mode. Number of warnings # and their content must be the same as in case running the statement # in regular way @@ -5543,15 +5540,15 @@ Warnings: Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 EXECUTE stmt; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` +Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where multiple equal(NULL, NULL)) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` SHOW WARNINGS; Level Code Message Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` +Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where multiple equal(NULL, NULL)) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1` DEALLOCATE PREPARE stmt; DROP TABLE t1, t2; # @@ -5565,12 +5562,12 @@ CREATE TABLE t3 (c3 INT) ENGINE=MyISAM; EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table PREPARE stmt FROM "EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 )"; EXECUTE stmt; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00 -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table DEALLOCATE PREPARE stmt; DROP TABLE t1, t2, t3; # @@ -5594,7 +5591,7 @@ CREATE TABLE t1 (a INT); PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1 HAVING 6 IN ( SELECT 6 UNION SELECT 5 )'; EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL @@ -5602,7 +5599,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL # would result in server crash. EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL diff --git a/mysql-test/main/query_cache.result b/mysql-test/main/query_cache.result index fc7ca726c48..500d6a9e64d 100644 --- a/mysql-test/main/query_cache.result +++ b/mysql-test/main/query_cache.result @@ -236,7 +236,7 @@ select benchmark(1,1) from t1; benchmark(1,1) explain extended select benchmark(1,1) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select benchmark(1,1) AS `benchmark(1,1)` from `test`.`t1` show status like "Qcache_queries_in_cache"; diff --git a/mysql-test/main/select.result b/mysql-test/main/select.result index d638f539dc2..497180173d4 100644 --- a/mysql-test/main/select.result +++ b/mysql-test/main/select.result @@ -4094,12 +4094,12 @@ join_7.c1, join_1.c1, join_0.c1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL +Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) or NULL < '?' and NULL < '?' and NULL > '?' and NULL < '!' and NULL > '?' and NULL <> '?' and NULL <> '?' and NULL >= '?' and multiple equal('?', NULL) and multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) group by NULL,NULL,NULL,NULL,NULL SHOW WARNINGS; Level Code Message -Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL +Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) or NULL < '?' and NULL < '?' and NULL > '?' and NULL < '!' and NULL > '?' and NULL <> '?' and NULL <> '?' and NULL >= '?' and multiple equal('?', NULL) and multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) group by NULL,NULL,NULL,NULL,NULL DROP TABLE t1; SELECT 1 AS ` `; @@ -4706,17 +4706,17 @@ DROP TABLE t1; CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1 EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1 EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1 DROP TABLE t1; @@ -5191,7 +5191,7 @@ LEFT OUTER JOIN ON t1.pk=t2.pk WHERE t2.pk <> 2; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 @@ -5209,7 +5209,7 @@ LEFT OUTER JOIN ON t1.pk=t2.pk WHERE t2.pk <> 2; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 @@ -5227,7 +5227,7 @@ LEFT OUTER JOIN ON t1.pk=t2.pk WHERE t2.pk <> 2; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 diff --git a/mysql-test/main/select_jcl6.result b/mysql-test/main/select_jcl6.result index fb73186ee5a..e8300299fdc 100644 --- a/mysql-test/main/select_jcl6.result +++ b/mysql-test/main/select_jcl6.result @@ -4105,12 +4105,12 @@ join_7.c1, join_1.c1, join_0.c1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL +Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) or NULL < '?' and NULL < '?' and NULL > '?' and NULL < '!' and NULL > '?' and NULL <> '?' and NULL <> '?' and NULL >= '?' and multiple equal('?', NULL) and multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) group by NULL,NULL,NULL,NULL,NULL SHOW WARNINGS; Level Code Message -Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL +Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) or NULL < '?' and NULL < '?' and NULL > '?' and NULL < '!' and NULL > '?' and NULL <> '?' and NULL <> '?' and NULL >= '?' and multiple equal('?', NULL) and multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) group by NULL,NULL,NULL,NULL,NULL DROP TABLE t1; SELECT 1 AS ` `; @@ -4717,17 +4717,17 @@ DROP TABLE t1; CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1 EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1 EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1 DROP TABLE t1; @@ -5202,7 +5202,7 @@ LEFT OUTER JOIN ON t1.pk=t2.pk WHERE t2.pk <> 2; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 @@ -5220,7 +5220,7 @@ LEFT OUTER JOIN ON t1.pk=t2.pk WHERE t2.pk <> 2; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 @@ -5238,7 +5238,7 @@ LEFT OUTER JOIN ON t1.pk=t2.pk WHERE t2.pk <> 2; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 diff --git a/mysql-test/main/select_pkeycache.result b/mysql-test/main/select_pkeycache.result index d638f539dc2..497180173d4 100644 --- a/mysql-test/main/select_pkeycache.result +++ b/mysql-test/main/select_pkeycache.result @@ -4094,12 +4094,12 @@ join_7.c1, join_1.c1, join_0.c1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL +Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) or NULL < '?' and NULL < '?' and NULL > '?' and NULL < '!' and NULL > '?' and NULL <> '?' and NULL <> '?' and NULL >= '?' and multiple equal('?', NULL) and multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) group by NULL,NULL,NULL,NULL,NULL SHOW WARNINGS; Level Code Message -Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL +Note 1003 select NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) or NULL < '?' and NULL < '?' and NULL > '?' and NULL < '!' and NULL > '?' and NULL <> '?' and NULL <> '?' and NULL >= '?' and multiple equal('?', NULL) and multiple equal(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) group by NULL,NULL,NULL,NULL,NULL DROP TABLE t1; SELECT 1 AS ` `; @@ -4706,17 +4706,17 @@ DROP TABLE t1; CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1 EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1 EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 select NULL AS `a`,NULL AS `b`,NULL AS `c` from `test`.`t1` where 1 DROP TABLE t1; @@ -5191,7 +5191,7 @@ LEFT OUTER JOIN ON t1.pk=t2.pk WHERE t2.pk <> 2; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 @@ -5209,7 +5209,7 @@ LEFT OUTER JOIN ON t1.pk=t2.pk WHERE t2.pk <> 2; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 @@ -5227,7 +5227,7 @@ LEFT OUTER JOIN ON t1.pk=t2.pk WHERE t2.pk <> 2; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result index 7e3202337ec..e34cc729395 100644 --- a/mysql-test/main/selectivity.result +++ b/mysql-test/main/selectivity.result @@ -869,18 +869,18 @@ set optimizer_use_condition_selectivity=1; EXPLAIN EXTENDED SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where 0 +Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where multiple equal(6, NULL) and multiple equal(2, NULL) and multiple equal(10, `test`.`t2`.`b`) SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; 1 set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where 0 +Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where multiple equal(6, NULL) and multiple equal(2, NULL) and multiple equal(10, `test`.`t2`.`b`) SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; 1 DROP TABLE t1,t2; @@ -935,9 +935,9 @@ set optimizer_switch='index_condition_pushdown=off'; EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a > 9; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select NULL AS `a`,NULL AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where 0 +Note 1003 select NULL AS `a`,NULL AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where NULL > 9 SELECT * FROM t1, t2 WHERE a > 9; a b c set optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result index 2159989597a..a51fd6494c9 100644 --- a/mysql-test/main/selectivity_innodb.result +++ b/mysql-test/main/selectivity_innodb.result @@ -878,18 +878,18 @@ set optimizer_use_condition_selectivity=1; EXPLAIN EXTENDED SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where 0 +Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where multiple equal(6, NULL) and multiple equal(2, NULL) and multiple equal(10, `test`.`t2`.`b`) SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; 1 set optimizer_use_condition_selectivity=3; EXPLAIN EXTENDED SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where 0 +Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` where multiple equal(6, NULL) and multiple equal(2, NULL) and multiple equal(10, `test`.`t2`.`b`) SELECT 1 FROM t1, t2 WHERE pk = 6 AND a = 2 AND b = 10; 1 DROP TABLE t1,t2; diff --git a/mysql-test/main/show_explain.result b/mysql-test/main/show_explain.result index 69dc506527b..f85ea5aec6b 100644 --- a/mysql-test/main/show_explain.result +++ b/mysql-test/main/show_explain.result @@ -582,7 +582,7 @@ WHERE a1 IN ( SELECT a1 FROM t2, t4 ) id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a1 5 NULL 20 Using where; Using index 1 PRIMARY t3 ALL NULL NULL NULL NULL 87 Using join buffer (flat, BNL join) -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table set @show_explain_probe_select_id=1; SET debug_dbug='+d,show_explain_probe_do_select'; SELECT count(*) FROM t2, t3 diff --git a/mysql-test/main/subselect.result b/mysql-test/main/subselect.result index c57cae70965..e655c03f187 100644 --- a/mysql-test/main/subselect.result +++ b/mysql-test/main/subselect.result @@ -1163,20 +1163,20 @@ drop table t1; CREATE TABLE t1 (a int(1)); EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select rand() from `test`.`t1`) AS `(SELECT RAND() FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select encrypt('test') from `test`.`t1`) AS `(SELECT ENCRYPT('test') FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select benchmark(1,1) from `test`.`t1`) AS `(SELECT BENCHMARK(1,1) FROM t1)` from `test`.`t1` drop table t1; @@ -1646,7 +1646,7 @@ a explain extended select * from t3 where a >= all (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); @@ -1654,7 +1654,7 @@ a explain extended select * from t3 where a >= some (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); @@ -1665,7 +1665,7 @@ a explain extended select * from t3 where a >= all (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); @@ -1673,7 +1673,7 @@ a explain extended select * from t3 where a >= some (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); @@ -3737,14 +3737,14 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL @@ -4598,7 +4598,7 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 @@ -6141,7 +6141,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6155,7 +6155,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6178,7 +6178,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6200,7 +6200,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6741,8 +6741,7 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result index 262adc51d3a..094f2646011 100644 --- a/mysql-test/main/subselect4.result +++ b/mysql-test/main/subselect4.result @@ -21,7 +21,7 @@ ORDER BY count(*); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL a 5 NULL 2 Using index 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t3 system NULL NULL NULL NULL 0 Const row not found +3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table # should not crash the next statement SELECT 1 FROM t1 WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE 1 = (SELECT MIN(t2.b) FROM t3)) @@ -778,21 +778,21 @@ EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2); f1 f2 EXPLAIN @@ -807,14 +807,14 @@ EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2); f1 f2 EXPLAIN @@ -2193,7 +2193,7 @@ INSERT INTO t2 VALUES (1); EXPLAIN SELECT MAX(a), ( SELECT 1 FROM t2 ) AS bb FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY t2 system NULL NULL NULL NULL 1 SELECT MAX(a), ( SELECT 1 FROM t2 ) AS bb FROM t1; MAX(a) bb @@ -2201,7 +2201,7 @@ NULL 1 EXPLAIN SELECT MAX(a), 1 in ( SELECT b FROM t2 ) AS bb FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY t2 system NULL NULL NULL NULL 1 SELECT MAX(a), 1 in ( SELECT b FROM t2 ) AS bb FROM t1; MAX(a) bb @@ -2209,7 +2209,7 @@ NULL 1 EXPLAIN SELECT MAX(a), 1 >= ALL ( SELECT b FROM t2 ) AS bb FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(a), 1 >= ALL ( SELECT b FROM t2 ) AS bb FROM t1; MAX(a) bb @@ -2217,7 +2217,7 @@ NULL 1 EXPLAIN SELECT MAX(a), ( SELECT 1 FROM t2 where b = a) AS bb FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(a), ( SELECT 1 FROM t2 where b = a) AS bb FROM t1; MAX(a) bb @@ -2225,7 +2225,7 @@ NULL NULL EXPLAIN SELECT MAX(a), a in ( SELECT b FROM t2 ) AS bb FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 SELECT MAX(a), a in ( SELECT b FROM t2 ) AS bb FROM t1; MAX(a) bb @@ -2233,7 +2233,7 @@ NULL NULL EXPLAIN SELECT MAX(a), a >= ALL ( SELECT b FROM t2 ) AS bb FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 SELECT MAX(a), a >= ALL ( SELECT b FROM t2 ) AS bb FROM t1; MAX(a) bb diff --git a/mysql-test/main/subselect_innodb.result b/mysql-test/main/subselect_innodb.result index a32c9ebe09c..aa518c0b6ce 100644 --- a/mysql-test/main/subselect_innodb.result +++ b/mysql-test/main/subselect_innodb.result @@ -373,7 +373,7 @@ SELECT SUM( c ) FROM t2 WHERE (SELECT DISTINCT b FROM t3) > 0); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using temporary SELECT * @@ -402,7 +402,7 @@ GROUP BY 1 ) ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY t3 ALL NULL NULL NULL NULL 1 SELECT MAX( f1 ) FROM t2 @@ -696,10 +696,10 @@ WHERE a = b AND (a,b) IN (SELECT t2.x, COUNT(t2.y) FROM t2 WHERE 1=2 GROUP BY t2.x);"; execute stmt; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (/* select#2 */ select `test`.`t2`.`x`,count(`test`.`t2`.`y`) from `test`.`t2` where 0 group by `test`.`t2`.`x` having `COUNT(t2.y)` = `test`.`t2`.`x`) join `test`.`t1` where 0 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (/* select#2 */ select `test`.`t2`.`x`,count(`test`.`t2`.`y`) from `test`.`t2` where 0 group by `test`.`t2`.`x` having `COUNT(t2.y)` = `test`.`t2`.`x`) join `test`.`t1` where multiple equal(`test`.`t1`.`a`, `test`.`t1`.`b`) # here re-execution of the pushdown does not crash: prepare stmt from " SELECT * FROM t1 diff --git a/mysql-test/main/subselect_mat.result b/mysql-test/main/subselect_mat.result index c30d425eeda..d1680be5720 100644 --- a/mysql-test/main/subselect_mat.result +++ b/mysql-test/main/subselect_mat.result @@ -1406,7 +1406,7 @@ explain SELECT a FROM ( SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.a > 3 OR t2.b IN (SELECT a FROM t1) ) table1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT a FROM ( @@ -1888,7 +1888,7 @@ FROM t2 AS alias3, t2 AS alias4 WHERE alias4.c = alias3.b ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 MATERIALIZED alias3 ALL NULL NULL NULL NULL 2 3 MATERIALIZED alias4 index c c 11 NULL 2 Using where; Using index; Using join buffer (flat, BNL join) DROP TABLE t1,t2; @@ -2757,7 +2757,7 @@ SELECT i FROM t1 LEFT JOIN t2 ON (j) IN (SELECT k FROM t3); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where -2 MATERIALIZED t3 system NULL NULL NULL NULL 0 Const row not found +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT i FROM t1 LEFT JOIN t2 ON (j) IN (SELECT k FROM t3); i 10 @@ -2766,7 +2766,7 @@ SELECT i FROM t1 LEFT JOIN t2 ON (j) IN (SELECT max(k) FROM t3); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where -2 MATERIALIZED t3 system NULL NULL NULL NULL 0 Const row not found +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT i FROM t1 LEFT JOIN t2 ON (j) IN (SELECT max(k) FROM t3); i 10 diff --git a/mysql-test/main/subselect_mat_cost_bugs.result b/mysql-test/main/subselect_mat_cost_bugs.result index 1b5f94c427b..ce7b688ad98 100644 --- a/mysql-test/main/subselect_mat_cost_bugs.result +++ b/mysql-test/main/subselect_mat_cost_bugs.result @@ -123,8 +123,8 @@ SELECT t1.* FROM t3 RIGHT JOIN t1 ON t1.pk = t3.f1 WHERE t3.f3 OR ( 3 ) IN ( SELECT f2 FROM t2 ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT t1.* FROM t3 RIGHT JOIN t1 ON t1.pk = t3.f1 WHERE t3.f3 OR ( 3 ) IN ( SELECT f2 FROM t2 ); @@ -146,7 +146,7 @@ FROM t2 GROUP BY f1 ) ) IS NULL ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY t1 system NULL NULL NULL NULL 1 3 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using temporary drop table t1, t2, t3; @@ -162,7 +162,7 @@ EXPLAIN SELECT * FROM (SELECT * FROM t2) AS a2 WHERE (SELECT distinct SUM(distinct f3 ) FROM t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 SUBQUERY t1 index NULL f3 5 NULL 2 Using index 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table insert into t2 values (1),(2); diff --git a/mysql-test/main/subselect_no_exists_to_in.result b/mysql-test/main/subselect_no_exists_to_in.result index 8746f7278c3..2242be67db4 100644 --- a/mysql-test/main/subselect_no_exists_to_in.result +++ b/mysql-test/main/subselect_no_exists_to_in.result @@ -1167,20 +1167,20 @@ drop table t1; CREATE TABLE t1 (a int(1)); EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select rand() from `test`.`t1`) AS `(SELECT RAND() FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select encrypt('test') from `test`.`t1`) AS `(SELECT ENCRYPT('test') FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select benchmark(1,1) from `test`.`t1`) AS `(SELECT BENCHMARK(1,1) FROM t1)` from `test`.`t1` drop table t1; @@ -1650,7 +1650,7 @@ a explain extended select * from t3 where a >= all (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); @@ -1658,7 +1658,7 @@ a explain extended select * from t3 where a >= some (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); @@ -1669,7 +1669,7 @@ a explain extended select * from t3 where a >= all (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); @@ -1677,7 +1677,7 @@ a explain extended select * from t3 where a >= some (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); @@ -3740,14 +3740,14 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL @@ -4600,7 +4600,7 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 @@ -6141,7 +6141,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6155,7 +6155,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6178,7 +6178,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6200,7 +6200,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6741,8 +6741,7 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL diff --git a/mysql-test/main/subselect_no_mat.result b/mysql-test/main/subselect_no_mat.result index f0d788d6b4a..c2a1c4e7f7e 100644 --- a/mysql-test/main/subselect_no_mat.result +++ b/mysql-test/main/subselect_no_mat.result @@ -1170,20 +1170,20 @@ drop table t1; CREATE TABLE t1 (a int(1)); EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select rand() from `test`.`t1`) AS `(SELECT RAND() FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select encrypt('test') from `test`.`t1`) AS `(SELECT ENCRYPT('test') FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select benchmark(1,1) from `test`.`t1`) AS `(SELECT BENCHMARK(1,1) FROM t1)` from `test`.`t1` drop table t1; @@ -1653,7 +1653,7 @@ a explain extended select * from t3 where a >= all (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); @@ -1661,7 +1661,7 @@ a explain extended select * from t3 where a >= some (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); @@ -1672,7 +1672,7 @@ a explain extended select * from t3 where a >= all (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); @@ -1680,7 +1680,7 @@ a explain extended select * from t3 where a >= some (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); @@ -3740,14 +3740,14 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL @@ -4598,7 +4598,7 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 @@ -6136,7 +6136,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6150,7 +6150,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6173,7 +6173,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6195,7 +6195,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6736,8 +6736,7 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL diff --git a/mysql-test/main/subselect_no_opts.result b/mysql-test/main/subselect_no_opts.result index 91e82ca838f..8553d7456e2 100644 --- a/mysql-test/main/subselect_no_opts.result +++ b/mysql-test/main/subselect_no_opts.result @@ -1166,20 +1166,20 @@ drop table t1; CREATE TABLE t1 (a int(1)); EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select rand() from `test`.`t1`) AS `(SELECT RAND() FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select encrypt('test') from `test`.`t1`) AS `(SELECT ENCRYPT('test') FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select benchmark(1,1) from `test`.`t1`) AS `(SELECT BENCHMARK(1,1) FROM t1)` from `test`.`t1` drop table t1; @@ -1649,7 +1649,7 @@ a explain extended select * from t3 where a >= all (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); @@ -1657,7 +1657,7 @@ a explain extended select * from t3 where a >= some (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); @@ -1668,7 +1668,7 @@ a explain extended select * from t3 where a >= all (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); @@ -1676,7 +1676,7 @@ a explain extended select * from t3 where a >= some (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); @@ -3736,14 +3736,14 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL @@ -4594,7 +4594,7 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 @@ -6132,7 +6132,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6146,7 +6146,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6169,7 +6169,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6191,7 +6191,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6732,8 +6732,7 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL diff --git a/mysql-test/main/subselect_no_scache.result b/mysql-test/main/subselect_no_scache.result index 1cc69ef4e85..1f5c896e8ab 100644 --- a/mysql-test/main/subselect_no_scache.result +++ b/mysql-test/main/subselect_no_scache.result @@ -1169,20 +1169,20 @@ drop table t1; CREATE TABLE t1 (a int(1)); EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select rand() from `test`.`t1`) AS `(SELECT RAND() FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select encrypt('test') from `test`.`t1`) AS `(SELECT ENCRYPT('test') FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select benchmark(1,1) from `test`.`t1`) AS `(SELECT BENCHMARK(1,1) FROM t1)` from `test`.`t1` drop table t1; @@ -1652,7 +1652,7 @@ a explain extended select * from t3 where a >= all (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); @@ -1660,7 +1660,7 @@ a explain extended select * from t3 where a >= some (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); @@ -1671,7 +1671,7 @@ a explain extended select * from t3 where a >= all (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); @@ -1679,7 +1679,7 @@ a explain extended select * from t3 where a >= some (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); @@ -3743,14 +3743,14 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL @@ -4604,7 +4604,7 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 @@ -6147,7 +6147,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6161,7 +6161,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6184,7 +6184,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6206,7 +6206,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6747,8 +6747,7 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result index 7dbee3ff882..bb3e9ac250b 100644 --- a/mysql-test/main/subselect_no_semijoin.result +++ b/mysql-test/main/subselect_no_semijoin.result @@ -1166,20 +1166,20 @@ drop table t1; CREATE TABLE t1 (a int(1)); EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select rand() from `test`.`t1`) AS `(SELECT RAND() FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select encrypt('test') from `test`.`t1`) AS `(SELECT ENCRYPT('test') FROM t1)` from `test`.`t1` EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select (/* select#2 */ select benchmark(1,1) from `test`.`t1`) AS `(SELECT BENCHMARK(1,1) FROM t1)` from `test`.`t1` drop table t1; @@ -1649,7 +1649,7 @@ a explain extended select * from t3 where a >= all (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2); @@ -1657,7 +1657,7 @@ a explain extended select * from t3 where a >= some (select b from t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where a >= all (select b from t2 group by 1); @@ -1668,7 +1668,7 @@ a explain extended select * from t3 where a >= all (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`))) select * from t3 where a >= some (select b from t2 group by 1); @@ -1676,7 +1676,7 @@ a explain extended select * from t3 where a >= some (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 Const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,(/* select#2 */ select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`))) select * from t3 where NULL >= any (select b from t2); @@ -3736,14 +3736,14 @@ i explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL explain select * from t1 where not exists ((select t11.i from t1 t11) union (select t12.i from t1 t12)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL @@ -4594,7 +4594,7 @@ SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 WHERE a = 230; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) FROM t1 @@ -6132,7 +6132,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE sq4_alias1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR @@ -6146,7 +6146,7 @@ FROM t1 AS sq4_alias1 WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR sq4_alias1.col_varchar_key = @var3 ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6169,7 +6169,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6191,7 +6191,7 @@ FROM t2 AS c_sq1_alias1 WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 SELECT * FROM ( SELECT sq4_alias1.* FROM t1 AS sq4_alias1 @@ -6732,8 +6732,7 @@ CREATE TABLE t2 (b INT); EXPLAIN SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL diff --git a/mysql-test/main/subselect_sj.result b/mysql-test/main/subselect_sj.result index a3eefb8c354..9868d1f007b 100644 --- a/mysql-test/main/subselect_sj.result +++ b/mysql-test/main/subselect_sj.result @@ -31,7 +31,7 @@ a b A confluent case of dependency explain select * from t1 where a in (select a from t10 where pk=12); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table select * from t1 where a in (select a from t10 where pk=12); a b explain select * from t1 where a in (select a from t10 where pk=9); @@ -43,7 +43,7 @@ a b An empty table inside explain select * from t1 where a in (select a from t11); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table select * from t1 where a in (select a from t11); a b explain select * from t1 where a in (select pk from t10) and b in (select pk from t10); @@ -2293,14 +2293,8 @@ CREATE TABLE t3 (a int, b int) ; PREPARE st1 FROM "SELECT * FROM t2 LEFT JOIN t1 ON t2.a != 0 AND ('j','r') IN ( SELECT b,a FROM t3)"; EXECUTE st1; a a -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: 'j' -Warning 1292 Truncated incorrect DECIMAL value: 'r' EXECUTE st1; a a -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: 'j' -Warning 1292 Truncated incorrect DECIMAL value: 'r' DROP TABLE t1, t2, t3; # # BUG#849776: Wrong result with semijoin + "Impossible where" diff --git a/mysql-test/main/subselect_sj_jcl6.result b/mysql-test/main/subselect_sj_jcl6.result index 2547d9bd487..cf99d246773 100644 --- a/mysql-test/main/subselect_sj_jcl6.result +++ b/mysql-test/main/subselect_sj_jcl6.result @@ -42,7 +42,7 @@ a b A confluent case of dependency explain select * from t1 where a in (select a from t10 where pk=12); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table select * from t1 where a in (select a from t10 where pk=12); a b explain select * from t1 where a in (select a from t10 where pk=9); @@ -54,7 +54,7 @@ a b An empty table inside explain select * from t1 where a in (select a from t11); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table select * from t1 where a in (select a from t11); a b explain select * from t1 where a in (select pk from t10) and b in (select pk from t10); @@ -2304,14 +2304,8 @@ CREATE TABLE t3 (a int, b int) ; PREPARE st1 FROM "SELECT * FROM t2 LEFT JOIN t1 ON t2.a != 0 AND ('j','r') IN ( SELECT b,a FROM t3)"; EXECUTE st1; a a -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: 'j' -Warning 1292 Truncated incorrect DECIMAL value: 'r' EXECUTE st1; a a -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: 'j' -Warning 1292 Truncated incorrect DECIMAL value: 'r' DROP TABLE t1, t2, t3; # # BUG#849776: Wrong result with semijoin + "Impossible where" diff --git a/mysql-test/main/subselect_sj_mat.result b/mysql-test/main/subselect_sj_mat.result index ae96ec0adce..6cb375ea76b 100644 --- a/mysql-test/main/subselect_sj_mat.result +++ b/mysql-test/main/subselect_sj_mat.result @@ -1246,8 +1246,7 @@ create table t2 (b1 int); insert into t1 values (5); explain select min(a1) from t1 where 7 in (select max(b1) from t2 group by b1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table select min(a1) from t1 where 7 in (select max(b1) from t2 group by b1); min(a1) @@ -1267,7 +1266,7 @@ set @@optimizer_switch='semijoin=off'; explain select min(a1) from t1 where 7 in (select b1 from t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table select min(a1) from t1 where 7 in (select b1 from t2); min(a1) NULL @@ -1276,7 +1275,7 @@ set @@optimizer_switch='materialization=off,in_to_exists=on'; # with MariaDB and MWL#90, this particular case is solved: explain select min(a1) from t1 where 7 in (select b1 from t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table select min(a1) from t1 where 7 in (select b1 from t2); min(a1) NULL @@ -1441,7 +1440,7 @@ explain SELECT a FROM ( SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.a > 3 OR t2.b IN (SELECT a FROM t1) ) table1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table 3 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT a FROM ( @@ -1922,7 +1921,7 @@ FROM t2 AS alias3, t2 AS alias4 WHERE alias4.c = alias3.b ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table DROP TABLE t1,t2; # # BUG#928048: Query containing IN subquery with OR in the where clause returns a wrong result diff --git a/mysql-test/main/type_date.result b/mysql-test/main/type_date.result index e22b15c88cf..f5a66eed583 100644 --- a/mysql-test/main/type_date.result +++ b/mysql-test/main/type_date.result @@ -185,7 +185,7 @@ COUNT(*) 0 EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW() AND b = 1; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table ALTER TABLE t1 DROP PRIMARY KEY; SELECT COUNT(*) FROM t1 WHERE a = NOW(); COUNT(*) diff --git a/mysql-test/main/union.result b/mysql-test/main/union.result index 3ad3d9aa2f8..ecdec3a7918 100644 --- a/mysql-test/main/union.result +++ b/mysql-test/main/union.result @@ -1640,8 +1640,8 @@ UNION SELECT a FROM t1 ORDER BY a; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found -2 UNION t1 system NULL NULL NULL NULL 0 0.00 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 UNION NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort Warnings: Note 1003 /* select#1 */ select NULL AS `a` from `test`.`t1` union /* select#2 */ select NULL AS `a` from `test`.`t1` order by `a` @@ -2179,8 +2179,8 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 func 1 Using where 3 SUBQUERY t2 ref PRIMARY PRIMARY 4 const 4 Using index 4 UNION t2 ref PRIMARY PRIMARY 4 func 1 Using where; Using index -5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -6 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +5 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +6 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL select ( @@ -2320,9 +2320,9 @@ GROUP BY i HAVING i = 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used -2 UNION NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 UNION NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table Warnings: -Note 1003 /* select#1 */ select 1 AS `1`,2 AS `2` union all /* select#2 */ select 1 AS `i`,count(0) AS `COUNT(*)` from `test`.`t2` where 0 group by 1 having 1 +Note 1003 /* select#1 */ select 1 AS `1`,2 AS `2` union all /* select#2 */ select 1 AS `i`,count(0) AS `COUNT(*)` from (`test`.`t2`) where 0 group by 1 having 1 DROP TABLE t1,t2; # # MDEV-10120: Wrong result of UNION .. ORDER BY GROUP_CONCAT() diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result index 12214ca8bc8..b7a4d84a992 100644 --- a/mysql-test/main/view.result +++ b/mysql-test/main/view.result @@ -2948,10 +2948,10 @@ CREATE TABLE t1 (s1 int); CREATE VIEW v1 AS SELECT * FROM t1; EXPLAIN SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table EXPLAIN SELECT * FROM v1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table INSERT INTO t1 VALUES (1), (3), (2); EXPLAIN SELECT * FROM t1 t WHERE t.s1+1 < (SELECT MAX(t1.s1) FROM t1); id select_type table type possible_keys key key_len ref rows Extra @@ -5735,7 +5735,7 @@ LEFT JOIN v60 ON t36.f36 = v60.f60 ; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, diff --git a/mysql-test/main/view_grant.result b/mysql-test/main/view_grant.result index bfce546e182..9217b8f60f6 100644 --- a/mysql-test/main/view_grant.result +++ b/mysql-test/main/view_grant.result @@ -144,7 +144,7 @@ revoke select on mysqltest.v5 from mysqltest_1@localhost; connection user1; explain select c from mysqltest.v1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table show create view mysqltest.v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select `mysqltest`.`t1`.`a` + 1 AS `c`,`mysqltest`.`t1`.`b` + 1 AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci @@ -167,13 +167,13 @@ grant show view on mysqltest.* to mysqltest_1@localhost; connection user1; explain select c from mysqltest.v1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table show create view mysqltest.v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v1` AS select `mysqltest`.`t1`.`a` + 1 AS `c`,`mysqltest`.`t1`.`b` + 1 AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci explain select c from mysqltest.v2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> system NULL NULL NULL NULL 0 Const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table show create view mysqltest.v2; View Create View character_set_client collation_connection @@ -1190,7 +1190,7 @@ select * from v1; i explain select * from v1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table disconnect test11765687; ... as eugene connect test11765687,localhost,eugene,,mysqltest1; @@ -1238,12 +1238,12 @@ select k from t3; k explain select k from t3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table select * from v3; k explain select * from v3; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table disconnect test11765687; ... as inga connect test11765687,localhost,inga,,mysqltest1; @@ -1284,8 +1284,7 @@ select * from v2; i j explain select * from v2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found -1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table disconnect test11765687; ... as noam connect test11765687,localhost,noam,,mysqltest1; diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result index c9a651c7e5e..73c9dec0f08 100644 --- a/mysql-test/main/win.result +++ b/mysql-test/main/win.result @@ -3392,7 +3392,7 @@ create table t1 (a int); explain select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup; 1 row_number() over (order by 1) drop table t1; @@ -3663,7 +3663,7 @@ CREATE TABLE t1 (a INT); explain SELECT row_number() over(), sum(1) FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found; Using temporary +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT row_number() over(), sum(1) FROM t1; row_number() over() sum(1) 1 NULL diff --git a/mysql-test/suite/encryption/r/tempfiles_encrypted.result b/mysql-test/suite/encryption/r/tempfiles_encrypted.result index 077b770b9d2..eeecf3f2a4f 100644 --- a/mysql-test/suite/encryption/r/tempfiles_encrypted.result +++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result @@ -3398,7 +3398,7 @@ create table t1 (a int); explain select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup; 1 row_number() over (order by 1) drop table t1; @@ -3669,7 +3669,7 @@ CREATE TABLE t1 (a INT); explain SELECT row_number() over(), sum(1) FROM t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found; Using temporary +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT row_number() over(), sum(1) FROM t1; row_number() over() sum(1) 1 NULL diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result index 56ea46a8052..aac5632a935 100644 --- a/mysql-test/suite/gcol/r/gcol_bugfixes.result +++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result @@ -170,7 +170,7 @@ ON ( p1 . gcol_int_key = p2 . pk ) AND gp1 . col_varchar_nokey = 'b' HAVING g1 > 6; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Const row not found SELECT gp1 . gcol_datetime_key AS g1 FROM cc AS gp1 LEFT JOIN c AS gp2 ON ( gp2 . gcol_datetime_key <> gp1 . @@ -374,7 +374,7 @@ EXPLAIN SELECT 1 FROM t WHERE ( SELECT 1 FROM t ) >=ANY( SELECT c FROM v ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Const row not found SELECT 1 FROM t WHERE ( SELECT 1 FROM t ) >=ANY( SELECT c FROM v ); 1 EXPLAIN SELECT (SELECT MAX(c) FROM v); diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index 48f3da81e72..88fb1bcae8e 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -238,15 +238,13 @@ select 1, max(1) from t1i where 1=99; 1 NULL explain select count(*), min(7), max(7) from t1m, t1i; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1m system NULL NULL NULL NULL 0 Const row not found -1 SIMPLE t1i ALL NULL NULL NULL NULL 0 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table select count(*), min(7), max(7) from t1m, t1i; count(*) min(7) max(7) 0 NULL NULL explain select count(*), min(7), max(7) from t1m, t2i; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1m system NULL NULL NULL NULL 0 Const row not found -1 SIMPLE t2i ALL NULL NULL NULL NULL 1 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table select count(*), min(7), max(7) from t1m, t2i; count(*) min(7) max(7) 0 NULL NULL @@ -1867,9 +1865,8 @@ set @@optimizer_switch='in_to_exists=on,materialization=off'; explain select b from t1 where a not in (select max(b) from t1,t2 group by a) group by a; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 0 Const row not found -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table set optimizer_switch=@save_optimizer_switch; DROP TABLE t1,t2; End of 5.0 tests diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 6a441c5047b..57ffd58f8b4 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2382,6 +2382,9 @@ int JOIN::optimize_stage2() if (subq_exit_fl) goto setup_subq_exit; + if (zero_result_cause) + goto setup_subq_exit; + if (unlikely(thd->check_killed())) DBUG_RETURN(1); @@ -2418,6 +2421,8 @@ int JOIN::optimize_stage2() DBUG_PRINT("error",("Error: initialize_tables() failed")); DBUG_RETURN(1); // error == -1 } + + /* ConstRowNotFoundShortcut-2: */ if (const_table_map != found_const_table_map && !(select_options & SELECT_DESCRIBE)) { @@ -2603,6 +2608,7 @@ int JOIN::optimize_stage2() } } + /* ConstRowNotFoundShortcut-3: */ if (conds && const_table_map != found_const_table_map && (select_options & SELECT_DESCRIBE)) { @@ -5392,7 +5398,32 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, } } } while (ref_changed); - + + /* + ConstRowNotFoundShortcut-1: + Some constant/system tables have mo matching rows. This means that + the join operation output will be empty. + Short-cut further optimization steps. + Note that some query plan steps will still be performed to handle + implicit grouping, join result setup, etc. + See also: ConstRowNotFoundShortcut-{2,3}. + + Do not do this if we're optimizing for some UNION's fake_select_lex. + We might be running UglySubqueryReoptimization (grep for name) and + in this case constant tables are not reliable. + */ + if ((join->const_table_map & ~found_const_table_map) && + !(join->select_lex->master_unit() && + join->select_lex->master_unit()->fake_select_lex == join->select_lex)) + { + join->zero_result_cause= "no matching row in const table"; + join->table_count=0; + join->const_tables= 0; + join->join_tab= NULL; + + DBUG_RETURN(0); + } + join->sort_by_table= get_sort_by_table(join->order, join->group_list, join->select_lex->leaf_tables, join->const_table_map); diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 0f218b73b16..286adb8b257 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -1740,6 +1740,7 @@ bool st_select_lex_unit::exec() if (describe) { /* + UglySubqueryReoptimization: In EXPLAIN command, constant subqueries that do not use any tables are executed two times: - 1st time is a real evaluation to get the subquery value diff --git a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result index ccf2d9cd27f..16778453981 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result @@ -71,7 +71,7 @@ a b 2 2 explain select * from t2 where a='no-such-key'; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain select * from t2 where a='abc'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 12 const # diff --git a/storage/sequence/mysql-test/sequence/simple.result b/storage/sequence/mysql-test/sequence/simple.result index b8bc0eadc76..907cdc4efd8 100644 --- a/storage/sequence/mysql-test/sequence/simple.result +++ b/storage/sequence/mysql-test/sequence/simple.result @@ -141,7 +141,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE seq_1_to_15_step_2 range PRIMARY PRIMARY 8 NULL 1 Using where; Using index explain select * from seq_1_to_15_step_2 where seq between 4 and 4; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table explain select * from seq_1_to_15_step_2 where seq between 5 and 5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE seq_1_to_15_step_2 const PRIMARY PRIMARY 8 const 1 Using index diff --git a/storage/tokudb/mysql-test/tokudb/r/type_date.result b/storage/tokudb/mysql-test/tokudb/r/type_date.result index 70281843ac6..378420fc844 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_date.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_date.result @@ -176,7 +176,7 @@ COUNT(*) 0 EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW() AND b = 1; 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 +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table ALTER TABLE t1 DROP PRIMARY KEY; SELECT COUNT(*) FROM t1 WHERE a = NOW(); COUNT(*) |