Skip to content

Commit a2b8bdf

Browse files
committed
Merge branch '10.2' into bb-10.2-mdev9864
2 parents 82626d7 + 4ec088f commit a2b8bdf

27 files changed

+3135
-1218
lines changed

mysql-test/r/cte_nonrecursive.result

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,3 +851,47 @@ a
851851
9
852852
drop view v1;
853853
drop table ten, one_k;
854+
#
855+
# MDEV-10057 : Crash with EXPLAIN + WITH + constant query
856+
#
857+
CREATE TABLE t1 (a INT);
858+
INSERT INTO t1 VALUES (1),(2),(3);
859+
SELECT * FROM (WITH a AS (SELECT * FROM t1) SELECT 1) AS t1;
860+
1
861+
1
862+
EXPLAIN SELECT * FROM (WITH a AS (SELECT * FROM t1) SELECT 1) AS t1;
863+
id select_type table type possible_keys key key_len ref rows Extra
864+
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
865+
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
866+
DROP TABLE t1;
867+
#
868+
# MDEV-10058: Suspicious EXPLAIN output for a derived table + WITH + joined table
869+
#
870+
CREATE TABLE t1 (a INT);
871+
CREATE TABLE t2 (a INT);
872+
CREATE TABLE t3 (a INT);
873+
INSERT INTO t1 VALUES (1),(2),(3);
874+
INSERT INTO t2 VALUES (1),(2),(3);
875+
INSERT INTO t3 VALUES (1),(2),(3);
876+
EXPLAIN SELECT * FROM (WITH a AS (SELECT * FROM t1) (t2 NATURAL JOIN t3));
877+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't2 NATURAL JOIN t3))' at line 1
878+
explain SELECT * FROM (WITH a AS (SELECT * FROM t1) SELECT * FROM t2 NATURAL JOIN t3) AS d1;
879+
id select_type table type possible_keys key key_len ref rows Extra
880+
1 PRIMARY t2 ALL NULL NULL NULL NULL 3
881+
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
882+
DROP TABLE t1,t2,t3;
883+
#
884+
# MDEV-10729: Server crashes in st_select_lex::set_explain_type
885+
#
886+
CREATE TABLE t1 (i1 INT, KEY(i1)) ENGINE=MyISAM;
887+
INSERT INTO t1 VALUES (4),(8);
888+
CREATE TABLE t2 (a2 INT, b2 INT, KEY(b2)) ENGINE=MyISAM;
889+
INSERT INTO t2 VALUES (8,7);
890+
CREATE TABLE t3 (i3 INT) ENGINE=MyISAM;
891+
INSERT INTO t3 VALUES (2),(6);
892+
SELECT * FROM t1, t2 WHERE a2 = i1 and b2 >= i1 AND i1 IN ( SELECT i3 FROM t3 )
893+
UNION
894+
SELECT * FROM t1, t2 WHERE a2 = i1 and b2 >= i1 AND i1 IN ( SELECT i3 FROM t3 )
895+
;
896+
i1 a2 b2
897+
DROP TABLE t1,t2,t3;

0 commit comments

Comments
 (0)