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
0f7fe2a7
Commit
0f7fe2a7
authored
May 19, 2016
by
Galina Shalygina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes in test files
parent
46a2e413
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
89 deletions
+89
-89
mysql-test/r/cte_recursive.result
mysql-test/r/cte_recursive.result
+52
-52
mysql-test/t/cte_recursive.test
mysql-test/t/cte_recursive.test
+37
-37
No files found.
mysql-test/r/cte_recursive.result
View file @
0f7fe2a7
This diff is collapsed.
Click to expand it.
mysql-test/t/cte_recursive.test
View file @
0f7fe2a7
...
...
@@ -27,7 +27,7 @@ drop table t1;
create
table
folks
(
id
int
,
name
char
(
32
),
dob
date
,
father
int
,
mother
int
);
insert
into
folks
values
(
100
,
'
Vasya
'
,
'2000-01-01'
,
20
,
30
),
(
100
,
'
Me
'
,
'2000-01-01'
,
20
,
30
),
(
20
,
'Dad'
,
'1970-02-02'
,
10
,
9
),
(
30
,
'Mom'
,
'1975-03-03'
,
8
,
7
),
(
10
,
'Grandpa Bill'
,
'1940-04-05'
,
null
,
null
),
...
...
@@ -47,7 +47,7 @@ as
(
select
*
from
folks
where
name
=
'
Vasya
'
and
dob
=
'2000-01-01'
where
name
=
'
Me
'
and
dob
=
'2000-01-01'
union
select
p
.
id
,
p
.
name
,
p
.
dob
,
p
.
father
,
p
.
mother
from
folks
as
p
,
ancestors
AS
a
...
...
@@ -65,7 +65,7 @@ as
union
select
*
from
folks
where
name
=
'
Vasya
'
and
dob
=
'2000-01-01'
where
name
=
'
Me
'
and
dob
=
'2000-01-01'
)
select
*
from
ancestors
;
...
...
@@ -89,7 +89,7 @@ as
(
select
*
from
folks
where
name
=
'
Vasya
'
or
name
=
'Sister Amy'
where
name
=
'
Me
'
or
name
=
'Sister Amy'
union
select
p
.*
from
folks
as
p
,
ancestors
as
a
...
...
@@ -107,14 +107,14 @@ as
union
select
*
from
folks
where
name
=
'
Vasya
'
where
name
=
'
Me
'
),
ancestors
as
(
select
*
from
folks
where
name
=
'
Vasya
'
where
name
=
'
Me
'
union
select
*
from
ancestors
...
...
@@ -160,7 +160,7 @@ as
(
select
*
from
folks
where
name
=
'
Vasya
'
and
dob
=
'2000-01-01'
where
name
=
'
Me
'
and
dob
=
'2000-01-01'
union
select
p
.*
from
folks
as
p
,
ancestors
AS
a
...
...
@@ -181,7 +181,7 @@ as
(
select
*
from
folks
where
name
=
'
Vasya
'
where
name
=
'
Me
'
union
select
p
.*
from
folks
as
p
,
ancestors
AS
a
...
...
@@ -200,7 +200,7 @@ as
(
select
*
from
folks
where
name
=
'
Vasya
'
where
name
=
'
Me
'
union
select
p
.*
from
folks
as
p
,
ancestors
as
fa
...
...
@@ -223,7 +223,7 @@ as
union
select
h
.*
,
w
.*
from
folks
v
,
folks
h
,
folks
w
where
v
.
name
=
'
Vasya
'
and
where
v
.
name
=
'
Me
'
and
(
v
.
father
=
h
.
id
AND
v
.
mother
=
w
.
id
)
),
coupled_ancestors
(
id
,
name
,
dob
,
father
,
mother
)
...
...
@@ -246,7 +246,7 @@ as
(
select *
from folks
where name = '
Vasya
' and dob = '2000-01-01'
where name = '
Me
' and dob = '2000-01-01'
union
select p.id, p.name, p.dob, p.father, p.mother
from folks as p, ancestors AS a
...
...
@@ -268,7 +268,7 @@ as
(
select
*
from
folks
where
name
=
'
Vasya
'
and
dob
=
'2000-01-01'
where
name
=
'
Me
'
and
dob
=
'2000-01-01'
union
select
p
.
id
,
p
.
name
,
p
.
dob
,
p
.
father
,
p
.
mother
from
folks
as
p
,
ancestors
AS
a
...
...
@@ -287,7 +287,7 @@ as
(
select
*
from
folks
where
name
=
'
Vasya
'
where
name
=
'
Me
'
union
select
p
.*
from
folks
as
p
,
ancestors
as
fa
...
...
@@ -312,7 +312,7 @@ as
(
select
*
from
folks
where
name
=
'
Vasya
'
and
dob
=
'2000-01-01'
where
name
=
'
Me
'
and
dob
=
'2000-01-01'
union
select
p
.
id
,
p
.
name
,
p
.
dob
,
p
.
father
,
p
.
mother
from
folks
as
p
,
ancestors
AS
a
...
...
@@ -325,9 +325,9 @@ with recursive
ancestor_ids
(
id
)
as
(
select
father
from
folks
where
name
=
'
Vasya
'
select
father
from
folks
where
name
=
'
Me
'
union
select
mother
from
folks
where
name
=
'
Vasya
'
select
mother
from
folks
where
name
=
'
Me
'
union
select
father
from
folks
,
ancestor_ids
a
where
folks
.
id
=
a
.
id
union
...
...
@@ -347,7 +347,7 @@ as
(
select
*
from
folks
where
name
=
'
Vasya
'
where
name
=
'
Me
'
union
all
select
p
.*
from
folks
as
p
,
ancestors
as
fa
...
...
@@ -367,9 +367,9 @@ with recursive
ancestor_ids
(
id
,
generation
)
as
(
select
father
,
1
from
folks
where
name
=
'
Vasya
'
and
father
is
not
null
select
father
,
1
from
folks
where
name
=
'
Me
'
and
father
is
not
null
union
all
select
mother
,
1
from
folks
where
name
=
'
Vasya
'
and
mother
is
not
null
select
mother
,
1
from
folks
where
name
=
'
Me
'
and
mother
is
not
null
union
all
select
father
,
fa
.
generation
+
1
from
folks
,
ancestor_ids
fa
where
folks
.
id
=
fa
.
id
and
(
father
not
in
(
select
id
from
ancestor_ids
))
...
...
@@ -388,9 +388,9 @@ with recursive
ancestor_ids
(
id
,
generation
)
as
(
select
father
from
folks
where
name
=
'
Vasya
'
and
father
is
not
null
select
father
from
folks
where
name
=
'
Me
'
and
father
is
not
null
union
all
select
mother
from
folks
where
name
=
'
Vasya
'
and
mother
is
not
null
select
mother
from
folks
where
name
=
'
Me
'
and
mother
is
not
null
union
all
select
father
,
fa
.
generation
+
1
from
folks
,
ancestor_ids
fa
where
folks
.
id
=
fa
.
id
and
(
father
not
in
(
select
id
from
ancestor_ids
))
...
...
@@ -405,9 +405,9 @@ with recursive
ancestor_ids
(
id
,
generation
)
as
(
select
father
,
1
from
folks
where
name
=
'
Vasya
'
and
father
is
not
null
select
father
,
1
from
folks
where
name
=
'
Me
'
and
father
is
not
null
union
all
select
mother
,
1
from
folks
where
name
=
'
Vasya
'
and
mother
is
not
null
select
mother
,
1
from
folks
where
name
=
'
Me
'
and
mother
is
not
null
union
all
select
father
,
fa
.
generation
+
1
from
folks
,
ancestor_ids
fa
where
folks
.
id
=
fa
.
id
and
father
is
not
null
and
...
...
@@ -428,9 +428,9 @@ with recursive
coupled_ancestor_ids
(
id
)
as
(
select
father
from
folks
where
name
=
'
Vasya
'
and
father
is
not
null
select
father
from
folks
where
name
=
'
Me
'
and
father
is
not
null
union
select
mother
from
folks
where
name
=
'
Vasya
'
and
mother
is
not
null
select
mother
from
folks
where
name
=
'
Me
'
and
mother
is
not
null
union
select
n
.
father
from
folks
,
coupled_ancestor_ids
fa
,
coupled_ancestor_ids
ma
,
folks
n
...
...
@@ -452,9 +452,9 @@ with recursive
coupled_ancestor_ids
(
id
)
as
(
select
father
from
folks
where
name
=
'
Vasya
'
and
father
is
not
null
select
father
from
folks
where
name
=
'
Me
'
and
father
is
not
null
union
select
mother
from
folks
where
name
=
'
Vasya
'
and
mother
is
not
null
select
mother
from
folks
where
name
=
'
Me
'
and
mother
is
not
null
union
select
n
.
father
from
folks
,
coupled_ancestor_ids
fa
,
coupled_ancestor_ids
ma
,
folks
n
...
...
@@ -476,9 +476,9 @@ with recursive
ancestor_ids
(
id
)
as
(
select
father
from
folks
where
name
=
'
Vasya
'
select
father
from
folks
where
name
=
'
Me
'
union
select
mother
from
folks
where
name
=
'
Vasya
'
select
mother
from
folks
where
name
=
'
Me
'
union
select
father
from
folks
left
join
ancestor_ids
a
on
folks
.
id
=
a
.
id
union
...
...
@@ -497,9 +497,9 @@ with recursive
ancestor_ids
(
id
)
as
(
select
father
from
folks
where
name
=
'
Vasya
'
select
father
from
folks
where
name
=
'
Me
'
union
select
mother
from
folks
where
name
=
'
Vasya
'
select
mother
from
folks
where
name
=
'
Me
'
union
select
father
from
folks
left
join
ancestor_ids
a
on
folks
.
id
=
a
.
id
union
...
...
@@ -517,9 +517,9 @@ with recursive
ancestor_ids
(
id
,
generation
)
as
(
select
father
,
1
from
folks
where
name
=
'
Vasya
'
select
father
,
1
from
folks
where
name
=
'
Me
'
union
select
mother
,
1
from
folks
where
name
=
'
Vasya
'
select
mother
,
1
from
folks
where
name
=
'
Me
'
union
select
father
,
a
.
generation
+
1
from
folks
,
ancestor_ids
a
where
folks
.
id
=
a
.
id
...
...
@@ -540,9 +540,9 @@ with recursive
ancestor_ids
(
id
,
generation
)
as
(
select
father
,
1
from
folks
where
name
=
'
Vasya
'
select
father
,
1
from
folks
where
name
=
'
Me
'
union
select
mother
,
1
from
folks
where
name
=
'
Vasya
'
select
mother
,
1
from
folks
where
name
=
'
Me
'
union
select
max
(
father
),
max
(
a
.
generation
)
+
1
from
folks
,
ancestor_ids
a
where
folks
.
id
=
a
.
id
...
...
@@ -565,9 +565,9 @@ with recursive
ancestor_ids
(
id
,
generation
)
as
(
select
father
,
1
from
folks
where
name
=
'
Vasya
'
select
father
,
1
from
folks
where
name
=
'
Me
'
union
select
mother
,
1
from
folks
where
name
=
'
Vasya
'
select
mother
,
1
from
folks
where
name
=
'
Me
'
union
select
max
(
father
),
a
.
generation
+
1
from
folks
,
ancestor_ids
a
where
folks
.
id
=
a
.
id
...
...
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