diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-05-08 17:18:55 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-05-08 17:18:55 +0300 |
commit | 1b8749f73b86c4e8adc14d20b29c48d0608d8914 (patch) | |
tree | 216d379028b81a577d704ff2ea9d2519e9305890 /mysql-test/main | |
parent | 4513de3127df61fa2030690110bb34b7e1c40849 (diff) | |
parent | bd1d152d05ba75bd1bdd2d9bc0358d8508df307a (diff) | |
download | mariadb-git-1b8749f73b86c4e8adc14d20b29c48d0608d8914.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main')
-rw-r--r-- | mysql-test/main/cte_recursive.result | 32 | ||||
-rw-r--r-- | mysql-test/main/cte_recursive.test | 32 |
2 files changed, 64 insertions, 0 deletions
diff --git a/mysql-test/main/cte_recursive.result b/mysql-test/main/cte_recursive.result index 93fe8a99c16..6fccd39e59d 100644 --- a/mysql-test/main/cte_recursive.result +++ b/mysql-test/main/cte_recursive.result @@ -3207,6 +3207,38 @@ a 1 3 drop table t1; +# +# MDEV-16086: tmp table for CTE is created as ARIA tables +# +CREATE TABLE t1 ( +Id int(11) not null AUTO_INCREMENT, +Parent varchar(15) not null, +Child varchar(15) not null, +PRIMARY KEY (Id) +) ENGINE = MyISAM; +INSERT INTO t1 (Parent, Child) VALUES +('123', '456'),('456', '789'),('321', '654'),('654', '987'); +WITH RECURSIVE cte AS +( SELECT b.Parent, +b.Child, +CAST(CONCAT(b.Child,',') AS CHAR(513)) Path +FROM t1 b +LEFT OUTER JOIN t1 bc ON b.Child = bc.Parent +WHERE bc.Id IS NULL +UNION ALL SELECT c.Parent, +c.Child, +CONCAT(p.Path,c.Child,',') Path +FROM t1 c +INNER JOIN cte p ON c.Child = p.Parent) +SELECT * +FROM cte +ORDER BY Path; +Parent Child Path +456 789 789, +123 456 789,456, +654 987 987, +321 654 987,654, +DROP TABLE t1; # Start of 10.3 tests # # MDEV-14217 [db crash] Recursive CTE when SELECT includes new field diff --git a/mysql-test/main/cte_recursive.test b/mysql-test/main/cte_recursive.test index 0647e6c15c3..9d7f23a2258 100644 --- a/mysql-test/main/cte_recursive.test +++ b/mysql-test/main/cte_recursive.test @@ -2215,6 +2215,38 @@ select * from qn; drop table t1; +--echo # +--echo # MDEV-16086: tmp table for CTE is created as ARIA tables +--echo # + +CREATE TABLE t1 ( + Id int(11) not null AUTO_INCREMENT, + Parent varchar(15) not null, + Child varchar(15) not null, + PRIMARY KEY (Id) +) ENGINE = MyISAM; + +INSERT INTO t1 (Parent, Child) VALUES + ('123', '456'),('456', '789'),('321', '654'),('654', '987'); + +WITH RECURSIVE cte AS + ( SELECT b.Parent, + b.Child, + CAST(CONCAT(b.Child,',') AS CHAR(513)) Path + FROM t1 b + LEFT OUTER JOIN t1 bc ON b.Child = bc.Parent + WHERE bc.Id IS NULL + UNION ALL SELECT c.Parent, + c.Child, + CONCAT(p.Path,c.Child,',') Path + FROM t1 c + INNER JOIN cte p ON c.Child = p.Parent) +SELECT * +FROM cte +ORDER BY Path; + +DROP TABLE t1; + --echo # Start of 10.3 tests --echo # |