summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2015-04-08 03:33:48 +0300
committerSergei Petrunia <psergey@askmonty.org>2015-04-08 03:33:48 +0300
commit2b475b567e93c9a2438a835f2236ec3672e7769c (patch)
tree3eeae3d6b9e03f5b8d7e3a85accc17e3579677b3 /mysql-test
parent0df8c0aa5ed1a6d3869783a30cbe71521cffa4e4 (diff)
downloadmariadb-git-2b475b567e93c9a2438a835f2236ec3672e7769c.tar.gz
MDEV-7927: Server crashes in in Time_and_counter_tracker::incr_loops
- JOIN::save_explain_data should also set JOIN::tracker (it already sets join_tab[0].tracker). This is needed for UNIONs inside subqueries.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/explain_json.result12
-rw-r--r--mysql-test/t/explain_json.test8
2 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/r/explain_json.result b/mysql-test/r/explain_json.result
index 61d61323cb6..e1a09b82eff 100644
--- a/mysql-test/r/explain_json.result
+++ b/mysql-test/r/explain_json.result
@@ -894,3 +894,15 @@ EXPLAIN
}
}
DROP TABLE t1, t2;
+#
+# MDEV-7927: Server crashes in in Time_and_counter_tracker::incr_loops
+#
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+EXPLAIN SELECT * FROM t1 WHERE 3 IN ( SELECT 4 UNION SELECT 5 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
+3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+DROP TABLE t1;
diff --git a/mysql-test/t/explain_json.test b/mysql-test/t/explain_json.test
index 7fc1f568cec..4ca16c8c03c 100644
--- a/mysql-test/t/explain_json.test
+++ b/mysql-test/t/explain_json.test
@@ -200,3 +200,11 @@ INSERT INTO t2 VALUES (3),(4);
EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a <> ALL ( SELECT b FROM t2 );
DROP TABLE t1, t2;
+--echo #
+--echo # MDEV-7927: Server crashes in in Time_and_counter_tracker::incr_loops
+--echo #
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+EXPLAIN SELECT * FROM t1 WHERE 3 IN ( SELECT 4 UNION SELECT 5 );
+DROP TABLE t1;
+