From 979974c53ba88f66c2c00b803159599b6856ab21 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 9 Dec 2008 20:35:02 +0200 Subject: backported the fix for bug #34773 to 5.0 --- mysql-test/t/explain.test | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'mysql-test/t/explain.test') diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index c9ae8aceaf6..0247aca82df 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -94,4 +94,33 @@ EXPLAIN SELECT 1 FROM DROP TABLE t2; DROP TABLE t1; +# +# Bug #34773: query with explain extended and derived table / other table +# crashes server +# + +CREATE TABLE t1(a INT); +CREATE TABLE t2(a INT); +INSERT INTO t1 VALUES (1),(2); +INSERT INTO t2 VALUES (1),(2); + +EXPLAIN EXTENDED SELECT 1 + FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1; + +EXPLAIN EXTENDED SELECT 1 + FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1; + +prepare s1 from +'EXPLAIN EXTENDED SELECT 1 + FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1'; +execute s1; + +prepare s1 from +'EXPLAIN EXTENDED SELECT 1 + FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1'; +execute s1; +execute s1; + +DROP TABLE t1,t2; + # End of 5.0 tests. -- cgit v1.2.1