diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2012-05-11 18:13:06 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2012-05-11 18:13:06 +0400 |
commit | 6bce336624e84f5ec377926b105ec2002b38c96b (patch) | |
tree | 403415304e99e5f25617e4b75f401938aaae7d83 /mysql-test/t/show_explain.test | |
parent | 6fae4447f0873c159d94d1a3d8deafbd224d8100 (diff) | |
download | mariadb-git-6bce336624e84f5ec377926b105ec2002b38c96b.tar.gz |
MDEV-240: SHOW EXPLAIN: Assertion `this->optimized == 2' failed
- Fix the bug: SHOW EXPLAIN may hit a case where a join is partially
optimized.
- Change JOIN::optimized to use enum instead of numeric constants
Diffstat (limited to 'mysql-test/t/show_explain.test')
-rw-r--r-- | mysql-test/t/show_explain.test | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/show_explain.test b/mysql-test/t/show_explain.test index 02850efedd8..36c34c8df5c 100644 --- a/mysql-test/t/show_explain.test +++ b/mysql-test/t/show_explain.test @@ -5,6 +5,7 @@ --disable_warnings drop table if exists t0, t1, t2; +drop view if exists v1; --enable_warnings # @@ -346,6 +347,30 @@ set debug=''; DROP TABLE t2; +--echo # +--echo # MDEV-240: SHOW EXPLAIN: Assertion `this->optimized == 2' failed in +--echo # JOIN::print_explain on query with a JOIN, TEMPTABLE view, +--echo # +CREATE TABLE t3 (a INT); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t3; +INSERT INTO t3 VALUES (8); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (4),(5),(6),(7),(8),(9); +explain SELECT * FROM v1, t2; + +set @show_explain_probe_select_id=2; +set debug='d,show_explain_probe_join_exec_end'; +send SELECT * FROM v1, t2; + +connection default; +--source include/wait_condition.inc +evalp show explain for $thr2; +connection con1; +reap; +set debug=''; +DROP VIEW v1; +DROP TABLE t2, t3; + ## TODO: Test this: have several SHOW EXPLAIN requests be queued up for a ## thread and served together. |