1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

- Testing: add DBUG_EXECUTE_IF("show_explain_probe_2"... which fires

only for selects with given select_id.
- Steps towards making SHOW EXPLAIN work for UNIONs.
This commit is contained in:
Sergey Petrunya
2011-09-25 13:05:58 +04:00
parent 203bbfe569
commit 27f760143c
6 changed files with 46 additions and 9 deletions

View File

@ -14,6 +14,7 @@ show explain for $thr2;
ERROR HY000: Error when executing command SHOW EXPLAIN: Target is not running EXPLAINable command
show explain for $thr1;
ERROR HY000: Error when executing command SHOW EXPLAIN: Target is not running EXPLAINable command
set @show_explain_probe_select_id=1;
set debug='d,show_explain_probe_1';
select count(*) from t1 where a < 100000;
show explain for $thr2;
@ -21,7 +22,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index a a 5 NULL 1000 Using where; Using index
count(*)
1000
set debug='d,show_explain_probe_1';
select max(c) from t1 where a < 10;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@ -29,7 +29,6 @@ id select_type table type possible_keys key key_len ref rows Extra
max(c)
9
set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_sort_keys=on';
set debug='d,show_explain_probe_1';
explain select max(c) from t1 where a < 10;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra

View File

@ -1,6 +1,8 @@
#
# Tests for SHOW EXPLAIN FOR functionality
#
--source include/have_debug.inc
--disable_warnings
drop table if exists t0, t1;
--enable_warnings
@ -45,6 +47,7 @@ let $wait_condition= select State='show_explain_trap' from information_schema.pr
# Test SHOW EXPLAIN for simple queries
#
connection con1;
set @show_explain_probe_select_id=1;
set debug='d,show_explain_probe_1';
send select count(*) from t1 where a < 100000;
@ -55,7 +58,6 @@ connection con1;
reap;
set debug='d,show_explain_probe_1';
send select max(c) from t1 where a < 10;
connection default;
--source include/wait_condition.inc
@ -65,7 +67,6 @@ reap;
# We can catch EXPLAIN, too.
set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_sort_keys=on';
set debug='d,show_explain_probe_1';
send explain select max(c) from t1 where a < 10;
connection default;
--source include/wait_condition.inc
@ -73,6 +74,8 @@ evalp show explain for $thr2;
connection con1;
reap;
# Let's try with a subquery
## TODO: Test this: multiple SHOW EXPLAIN calls in course of running of one select
##