From f670b6d22f55401d4329f9ac9827a5145d1dd667 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 23 Oct 2010 21:28:58 +0300 Subject: MWL#89: Cost-based choice between Materialization and IN->EXISTS transformation Added missing logic to handle the case when subquery tables are optimized away early during optimization. --- mysql-test/include/subselect_mat_cost.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mysql-test/include') diff --git a/mysql-test/include/subselect_mat_cost.inc b/mysql-test/include/subselect_mat_cost.inc index 4ccbd08693a..04b116e9527 100644 --- a/mysql-test/include/subselect_mat_cost.inc +++ b/mysql-test/include/subselect_mat_cost.inc @@ -123,13 +123,13 @@ select a1 from t1 where a1 in (select b1 from t2 where b1 = b2 and b2 = '1 - 03' -- echo /* E.5 opt_sum_query detects no matching min/max row or substitutes MIN/MAX with a const. */ -- echo TODO this test produces wrong result due to missing logic to handle the case -- echo when JOIN::optimize detects an empty subquery result. -#explain -#select a1 from t1 where a1 in (select max(b1) from t2); -#select a1 from t1 where a1 in (select max(b1) from t2); +explain +select a1 from t1 where a1 in (select max(b1) from t2); +select a1 from t1 where a1 in (select max(b1) from t2); -- echo -#explain -#select a1 from t1 where a1 in (select max(b1) from t2 where b1 = '7 - 02'); -#select a1 from t1 where a1 in (select max(b1) from t2 where b1 = '7 - 02'); +explain +select a1 from t1 where a1 in (select max(b1) from t2 where b1 = '7 - 02'); +select a1 from t1 where a1 in (select max(b1) from t2 where b1 = '7 - 02'); -- echo /* E.6 make_join_select detects impossible WHERE. * -- cgit v1.2.1