diff options
author | unknown <timour@askmonty.org> | 2011-02-10 22:53:30 +0200 |
---|---|---|
committer | unknown <timour@askmonty.org> | 2011-02-10 22:53:30 +0200 |
commit | ac6653aacc71b7b48dc1cd6f52124cd5382ae198 (patch) | |
tree | d29022101eff8f757b101f9e40f8305a1ae44744 /mysql-test/r/subselect_mat_cost.result | |
parent | 6a66bf318207d71502abad7521abe5f34302bbe4 (diff) | |
download | mariadb-git-ac6653aacc71b7b48dc1cd6f52124cd5382ae198.tar.gz |
Fix LP BUG#714999
Analysis:
The crash in EXPLAIN resulted from an attempt to print the
name of the internal temporary table created to compute
distinct for the innermost subquery of the test case.
Such tables do not have a corresponding TABLE_LIST (table
reference), hence the crash. The reason for this was that
the subquery was executed as part of constant condition
evaluation before EXPLAIN attempts to print the table name.
During the subquery execution, the subquery JOIN_TAB and
its table are substituted by a temporary table in
make_simple_join.
Solution:
Similar to the analogous case for other Items than the
IS NULL function, do not evaluate expensive constant
conditions.
Diffstat (limited to 'mysql-test/r/subselect_mat_cost.result')
-rw-r--r-- | mysql-test/r/subselect_mat_cost.result | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_mat_cost.result b/mysql-test/r/subselect_mat_cost.result index 87b0ca405c0..fd2b6bbb143 100644 --- a/mysql-test/r/subselect_mat_cost.result +++ b/mysql-test/r/subselect_mat_cost.result @@ -3895,3 +3895,23 @@ FROM t3 RIGHT JOIN t1 ON t1.pk = t3.f1 WHERE t3.f3 OR ( 3 ) IN ( SELECT f2 FROM t2 ); pk drop table t1,t2,t3; +# +# LP BUG#714999 Second crash in select_describe() with nested subqueries +# +CREATE TABLE t1 ( pk int(11)) ; +INSERT INTO t1 VALUES (29); +CREATE TABLE t2 ( f1 varchar(1)) ; +INSERT INTO t2 VALUES ('f'),('d'); +CREATE TABLE t3 ( f2 varchar(1)) ; +EXPLAIN SELECT f2 FROM t3 WHERE ( +SELECT MAX( pk ) FROM t1 +WHERE EXISTS ( +SELECT DISTINCT f1 +FROM t2 +) +) 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 +2 SUBQUERY t1 system NULL NULL NULL NULL 1 +3 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using temporary +drop table t1, t2; |