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
501fc1a9
Commit
501fc1a9
authored
Aug 29, 2016
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Returned the test case that was removed by mistake.
parent
9ac235ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
mysql-test/r/cte_recursive.result
mysql-test/r/cte_recursive.result
+24
-0
mysql-test/t/cte_recursive.test
mysql-test/t/cte_recursive.test
+14
-0
No files found.
mysql-test/r/cte_recursive.result
View file @
501fc1a9
...
...
@@ -230,6 +230,30 @@ id name dob father mother
7 Grandma Sally 1943-08-23 NULL 6
8 Grandpa Ben 1940-10-21 NULL NULL
6 Grandgrandma Martha 1923-05-17 NULL NULL
# simple recursion with or in anchor and or in recursive part
with recursive
ancestors
as
(
select *
from folks
where name = 'Me' or name='Sister Amy'
union
select p.*
from folks as p, ancestors as a
where p.id = a.father or p.id = a.mother
)
select * from ancestors;
id name dob father mother
100 Me 2000-01-01 20 30
98 Sister Amy 2001-06-20 20 30
20 Dad 1970-02-02 10 9
30 Mom 1975-03-03 8 7
10 Grandpa Bill 1940-04-05 NULL NULL
9 Grandma Ann 1941-10-15 NULL NULL
7 Grandma Sally 1943-08-23 NULL 6
8 Grandpa Ben 1940-10-21 NULL NULL
6 Grandgrandma Martha 1923-05-17 NULL NULL
# two recursive definition, one uses another
with recursive
prev_gen
...
...
mysql-test/t/cte_recursive.test
View file @
501fc1a9
...
...
@@ -204,6 +204,20 @@ as
)
select
*
from
ancestors
;
--
echo
# simple recursion with or in anchor and or in recursive part
with
recursive
ancestors
as
(
select
*
from
folks
where
name
=
'Me'
or
name
=
'Sister Amy'
union
select
p
.*
from
folks
as
p
,
ancestors
as
a
where
p
.
id
=
a
.
father
or
p
.
id
=
a
.
mother
)
select
*
from
ancestors
;
--
echo
# two recursive definition, one uses another
with
recursive
...
...
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