summaryrefslogtreecommitdiff
path: root/mysql-test/t/explain.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/explain.test')
-rw-r--r--mysql-test/t/explain.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index 162a310c0a6..7e2a9bdc811 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -167,6 +167,25 @@ flush tables;
SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' );
drop tables t1, t2;
+--echo #
+--echo # Bug#48295:
+--echo # explain extended crash with subquery and ONLY_FULL_GROUP_BY sql_mode
+--echo #
+
+CREATE TABLE t1 (f1 INT);
+
+SELECT @@session.sql_mode INTO @old_sql_mode;
+SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
+
+# EXPLAIN EXTENDED (with subselect). used to crash. should give NOTICE.
+--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+EXPLAIN EXTENDED SELECT 1 FROM t1
+ WHERE f1 > ALL( SELECT t.f1 FROM t1,t1 AS t );
+SHOW WARNINGS;
+
+SET SESSION sql_mode=@old_sql_mode;
+
+DROP TABLE t1;
--echo #
--echo # Bug#30302: Tables that were optimized away are printed in the
@@ -179,4 +198,5 @@ insert into t2 values(1),(2);
explain extended select * from t1 where f1=1;
explain extended select * from t1 join t2 on f1=f2 where f1=1;
drop table t1,t2;
+
--echo End of 5.1 tests.