Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
9bcd0f5f
Commit
9bcd0f5f
authored
May 07, 2018
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the test case from MDEV-16086 tfixed by the patch for MDEV-15575
parent
e44ca6cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
mysql-test/r/cte_recursive.result
mysql-test/r/cte_recursive.result
+32
-0
mysql-test/t/cte_recursive.test
mysql-test/t/cte_recursive.test
+32
-0
No files found.
mysql-test/r/cte_recursive.result
View file @
9bcd0f5f
...
...
@@ -3201,3 +3201,35 @@ 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;
mysql-test/t/cte_recursive.test
View file @
9bcd0f5f
...
...
@@ -2214,3 +2214,35 @@ with recursive qn as
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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment