diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-10-04 19:09:39 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-10-04 19:09:39 +0400 |
commit | f5fba6564b447369575bc129aac89d347368957e (patch) | |
tree | ce46030b796f248961d416d2e8de9ef358469df7 /mysql-test/t/show_explain.test | |
parent | 5e4044e92c748c69965bd9b22f231815c9fa8e51 (diff) | |
download | mariadb-git-f5fba6564b447369575bc129aac89d347368957e.tar.gz |
MDEV-411: (different results for EXPLAIN and SHOW EXPLAIN)
- Added a testcase
Diffstat (limited to 'mysql-test/t/show_explain.test')
-rw-r--r-- | mysql-test/t/show_explain.test | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/mysql-test/t/show_explain.test b/mysql-test/t/show_explain.test index 8ab1813f5bb..91e3be34408 100644 --- a/mysql-test/t/show_explain.test +++ b/mysql-test/t/show_explain.test @@ -1128,9 +1128,44 @@ set names default; --error ER_SET_CONSTANTS_ONLY show explain for foo; +--echo # +--echo # MDEV-411: SHOW EXPLAIN: For dependent subquery EXPLAIN produces type=index, key, 'Using where; Using index', +--echo # while SHOW EXPLAIN says type=ALL, no key, 'Range checked for each record' +--echo # +CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (7),(0); + +CREATE TABLE t2 (b INT NOT NULL) ENGINE=MyISAM; +INSERT INTO t2 VALUES (0),(8); + +explain +SELECT SUM(b) FROM ( SELECT * FROM t1 ) AS alias1, t2 +WHERE b <= ANY ( + SELECT a FROM t1 + WHERE a = b + SLEEP(0.2) OR a >= ( SELECT SUM(b) FROM t2 )); + + +set @show_explain_probe_select_id=1; +set debug_dbug='+d,show_explain_probe_join_exec_start'; + +send +SELECT SUM(b) FROM ( SELECT * FROM t1 ) AS alias1, t2 +WHERE b <= ANY ( + SELECT a FROM t1 + WHERE a = b + SLEEP(0.2) OR a >= ( SELECT SUM(b) FROM t2 )); + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; + +connection con1; +reap; + +set debug_dbug=@old_debug; +DROP TABLE t1,t2; + --echo # End drop table t0; - connection default; disconnect con1; set debug_sync='RESET'; |