summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-10-10 20:30:32 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-10-10 20:30:32 +0400
commit094f70fd1908c17c0ebc4b6942e3bebed0a236ba (patch)
tree4058348c37c0ec18249690e111a9cb1a13c55b16 /mysql-test/r
parent582ecb2a253ed2c9e26a2e61102da4bf4ede72d3 (diff)
downloadmariadb-git-094f70fd1908c17c0ebc4b6942e3bebed0a236ba.tar.gz
MDEV-5106: Server crashes in Explain_union::print_explain on ER_TOO_BIG_SELECT
- Don't save UNION's EXPLAIN data if optimization failed with an error. We could end up saving incomplete plan, which will cause a crash when we attempt to print it.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/explain_slowquerylog.result13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/r/explain_slowquerylog.result b/mysql-test/r/explain_slowquerylog.result
index 62c742c5932..9d25cf06275 100644
--- a/mysql-test/r/explain_slowquerylog.result
+++ b/mysql-test/r/explain_slowquerylog.result
@@ -26,3 +26,16 @@ SELECT 1;
EXPLAIN PARTITIONS SELECT 1 ;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+#
+# MDEV-5106: Server crashes in Explain_union::print_explain on ER_TOO_BIG_SELECT with explain in slow log
+#
+CREATE TABLE t1 (i INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES
+(1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SET max_join_size = 10;
+( SELECT ta.* FROM t1 ta, t1 tb ) UNION ( SELECT * FROM t1 );
+ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
+SELECT 'Server still alive?' as 'Yes';
+Yes
+Server still alive?
+DROP TABLE t1;