diff options
author | Michael Widenius <monty@mariadb.org> | 2018-03-09 14:05:35 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-03-29 13:59:44 +0300 |
commit | a7abddeffa6a760ce948c2dfb007cdf3f1a369d5 (patch) | |
tree | 70eb743fa965a17380bbc0ac88ae79ca1075b896 /mysql-test/main/show_explain_non_select.test | |
parent | ab1941266c59a19703a74b5593cf3f508a5752d7 (diff) | |
download | mariadb-git-a7abddeffa6a760ce948c2dfb007cdf3f1a369d5.tar.gz |
Create 'main' test directory and move 't' and 'r' there
Diffstat (limited to 'mysql-test/main/show_explain_non_select.test')
-rw-r--r-- | mysql-test/main/show_explain_non_select.test | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/mysql-test/main/show_explain_non_select.test b/mysql-test/main/show_explain_non_select.test new file mode 100644 index 00000000000..21b16739141 --- /dev/null +++ b/mysql-test/main/show_explain_non_select.test @@ -0,0 +1,78 @@ +# +# SHOW EXPLAIN tests for non-select subqueries +# +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/not_embedded.inc + +--disable_warnings +drop table if exists t0, t1; +--enable_warnings + +SET @old_debug= @@session.debug; +set debug_sync='RESET'; + +# +# Setup two threads and their ids +# +let $thr1=`select connection_id()`; +connect (con2, localhost, root,,); +connection con2; +let $thr2=`select connection_id()`; +connection default; + +# +# Create tables +# +create table t0 (a int) engine=myisam; +insert into t0 values (1),(2),(3),(4),(5),(6),(7),(8); + +create table t1 (a int, b int, filler char(100), key(a), key(b)); +insert into t1 +select A.a+10*B.a + 10*C.a, A.a+10*B.a + 10*C.a, 'filler' +from t0 A, t0 B, t0 C; + +let $wait_condition= select State='show_explain_trap' from information_schema.processlist where id=$thr2; + +--echo # +--echo # Test SHOW EXPLAIN for single-table DELETE +--echo # +connection con2; +set debug_dbug='+d,show_explain_probe_delete_exec_start'; +send delete from t1 where a<10 and b+1>1000; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con2; +reap; + +--echo # +--echo # Test SHOW EXPLAIN for multi-table DELETE +--echo # +set @show_explain_probe_select_id=1; +set debug_dbug='+d,show_explain_probe_do_select'; +send delete t1 from t1, t0 where t0.a=t1.a and t1.b +1 > 1000; +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con2; +reap; + +--echo # +--echo # Test SHOW EXPLAIN for single-table UPDATE +--echo # +connection con2; +set debug_dbug='+d,show_explain_probe_update_exec_start'; +send update t1 set filler='filler-data-2' where a<10 and b+1>1000; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con2; +reap; + +drop table t0,t1; + +set debug_dbug=@old_debug; +set debug_sync='RESET'; |