diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2012-01-04 04:57:01 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2012-01-04 04:57:01 +0400 |
commit | ee40ee9cb8c9bc673ba345abe260c9da7a05e45a (patch) | |
tree | 8a43ac07e3bf5ecde5f4fc1ee524083f61e47edc /mysql-test/t/show_explain.test | |
parent | b01348879d066c3207ac70aa630ed021a2552920 (diff) | |
download | mariadb-git-ee40ee9cb8c9bc673ba345abe260c9da7a05e45a.tar.gz |
Apply earlier patch: correct handling of subqueries that
were not yet optimized or already executed and deleted.
Diffstat (limited to 'mysql-test/t/show_explain.test')
-rw-r--r-- | mysql-test/t/show_explain.test | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/mysql-test/t/show_explain.test b/mysql-test/t/show_explain.test index 5ed78be1ea4..4f04447d039 100644 --- a/mysql-test/t/show_explain.test +++ b/mysql-test/t/show_explain.test @@ -12,17 +12,17 @@ drop table if exists t0, t1; # is that we use the following commands for synchronization: # # set @show_explain_probe_select_id=1; -# set debug='d,show_explain_probe_1'; +# set debug='d,show_explain_probe_join_exec_start'; # send select count(*) from t1 where a < 100000; # # When ran with mysqltest_embedded, this translates into: # -# Thread1> DBUG_PUSH("d,show_explain_probe_1"); +# Thread1> DBUG_PUSH("d,show_explain_probe_join_exec_start"); # Thread1> create another thread for doing "send ... reap" # Thread2> mysql_parse("select count(*) from t1 where a < 100000"); # # That is, "select count(*) ..." is ran in a thread for which DBUG_PUSH(...) -# has not been called. As a result, show_explain_probe_1 does not fire, and +# has not been called. As a result, show_explain_probe_join_exec_start does not fire, and # "select count(*) ..." does not wait till its SHOW EXPLAIN command, and the # test fails. # @@ -70,7 +70,7 @@ let $wait_condition= select State='show_explain_trap' from information_schema.pr # connection con1; set @show_explain_probe_select_id=1; -set debug='d,show_explain_probe_1'; +set debug='d,show_explain_probe_join_exec_start'; send select count(*) from t1 where a < 100000; connection default; @@ -102,7 +102,7 @@ set optimizer_switch= @show_expl_tmp; --echo # UNION, first branch set @show_explain_probe_select_id=1; -set debug='d,show_explain_probe_1'; +set debug='d,show_explain_probe_join_exec_start'; send explain select a from t0 A union select a+1 from t0 B; connection default; --source include/wait_condition.inc @@ -113,7 +113,7 @@ reap; --echo # UNION, second branch set @show_explain_probe_select_id=1; -set debug='d,show_explain_probe_1'; +set debug='d,show_explain_probe_join_exec_start'; send explain select a from t0 A union select a+1 from t0 B; connection default; --source include/wait_condition.inc @@ -124,7 +124,7 @@ reap; --echo # Uncorrelated subquery, select set @show_explain_probe_select_id=1; -set debug='d,show_explain_probe_1'; +set debug='d,show_explain_probe_join_exec_start'; send select a, (select max(a) from t0 B) from t0 A where a<1; connection default; --source include/wait_condition.inc @@ -135,7 +135,7 @@ reap; --echo # Uncorrelated subquery, explain set @show_explain_probe_select_id=1; -set debug='d,show_explain_probe_1'; +set debug='d,show_explain_probe_join_exec_start'; send explain select a, (select max(a) from t0 B) from t0 A where a<1; connection default; --source include/wait_condition.inc @@ -145,7 +145,7 @@ reap; --echo # correlated subquery, select set @show_explain_probe_select_id=1; -set debug='d,show_explain_probe_1'; +set debug='d,show_explain_probe_join_exec_start'; send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; connection default; --source include/wait_condition.inc @@ -155,7 +155,7 @@ reap; --echo # correlated subquery, explain set @show_explain_probe_select_id=1; -set debug='d,show_explain_probe_1'; +set debug='d,show_explain_probe_join_exec_start'; send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; connection default; --source include/wait_condition.inc @@ -165,7 +165,7 @@ reap; --echo # correlated subquery, select, while inside the subquery set @show_explain_probe_select_id=2; # <--- -set debug='d,show_explain_probe_1'; +set debug='d,show_explain_probe_join_exec_start'; send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; connection default; --source include/wait_condition.inc @@ -175,7 +175,7 @@ reap; --echo # correlated subquery, explain, while inside the subquery set @show_explain_probe_select_id=2; -set debug='d,show_explain_probe_1'; +set debug='d,show_explain_probe_join_exec_start'; send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; connection default; --source include/wait_condition.inc @@ -184,6 +184,16 @@ connection con1; reap; +--echo # correlated subquery, explain, while inside the subquery +set @show_explain_probe_select_id=1; +set debug='d,show_explain_probe_join_exec_end'; +send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; + # TODO: explain in the parent subuqery when the un-correlated child has been # run (and have done irreversible cleanups) @@ -195,4 +205,7 @@ reap; ## TODO: Test this: have several SHOW EXPLAIN requests be queued up for a ## thread and served together. +## TODO: SHOW EXPLAIN while the primary query is running EXPLAIN EXTENDED/PARTITIONS +## + drop table t0,t1; |