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
2767cb76
Commit
2767cb76
authored
Nov 08, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.2 into 10.3
parents
a9110984
41425892
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
224 additions
and
3 deletions
+224
-3
mysql-test/main/cte_recursive.result
mysql-test/main/cte_recursive.result
+159
-0
mysql-test/main/cte_recursive.test
mysql-test/main/cte_recursive.test
+55
-0
mysql-test/suite/rpl/disabled.def
mysql-test/suite/rpl/disabled.def
+0
-1
sql/slave.cc
sql/slave.cc
+9
-1
sql/sql_cte.cc
sql/sql_cte.cc
+1
-1
No files found.
mysql-test/main/cte_recursive.result
View file @
2767cb76
This diff is collapsed.
Click to expand it.
mysql-test/main/cte_recursive.test
View file @
2767cb76
...
...
@@ -2441,6 +2441,61 @@ SELECT * FROM expired_map;
DROP
TABLE
purchases
,
expired
;
--
echo
#
--
echo
# MDEV-17635: Two recursive CTEs, the second using the first
--
echo
#
WITH
RECURSIVE
x
AS
(
SELECT
0
as
k
UNION
ALL
SELECT
k
+
1
FROM
x
WHERE
k
<
1
),
z
AS
(
SELECT
k1
AS
cx
,
k2
AS
cy
,
k1
,
k2
FROM
(
SELECT
k
AS
k1
FROM
x
)
x1
JOIN
(
SELECT
k
AS
k2
FROM
x
)
y1
UNION
SELECT
1
,
1
,
1
,
1
FROM
z
)
SELECT
*
FROM
z
;
--
echo
# https://wiki.postgresql.org/wiki/Mandelbrot_set:
WITH
RECURSIVE
x
(
i
)
AS
(
SELECT
CAST
(
0
AS
DECIMAL
(
13
,
10
))
UNION
ALL
SELECT
i
+
1
FROM
x
WHERE
i
<
101
),
Z
(
Ix
,
Iy
,
Cx
,
Cy
,
X
,
Y
,
I
)
AS
(
SELECT
Ix
,
Iy
,
X
,
Y
,
X
,
Y
,
0
FROM
(
SELECT
CAST
(
-
2.2
+
0.031
*
i
AS
DECIMAL
(
13
,
10
))
AS
X
,
i
AS
Ix
FROM
x
)
AS
xgen
CROSS
JOIN
(
SELECT
CAST
(
-
1.5
+
0.031
*
i
AS
DECIMAL
(
13
,
10
))
AS
Y
,
i
AS
iY
FROM
x
)
AS
ygen
UNION
ALL
SELECT
Ix
,
Iy
,
Cx
,
Cy
,
CAST
(
X
*
X
-
Y
*
Y
+
Cx
AS
DECIMAL
(
13
,
10
))
AS
X
,
CAST
(
Y
*
X
*
2
+
Cy
AS
DECIMAL
(
13
,
10
)),
I
+
1
FROM
Z
WHERE
X
*
X
+
Y
*
Y
<
16.0
AND
I
<
27
),
Zt
(
Ix
,
Iy
,
I
)
AS
(
SELECT
Ix
,
Iy
,
MAX
(
I
)
AS
I
FROM
Z
GROUP
BY
Iy
,
Ix
ORDER
BY
Iy
,
Ix
)
SELECT
GROUP_CONCAT
(
SUBSTRING
(
' .,,,-----++++%%%%@@@@#### '
,
GREATEST
(
I
,
1
),
1
)
ORDER
BY
Ix
SEPARATOR
''
)
AS
'Mandelbrot Set'
FROM
Zt
GROUP
BY
Iy
ORDER
BY
Iy
;
--
echo
# End of 10.2 tests
--
echo
#
...
...
mysql-test/suite/rpl/disabled.def
View file @
2767cb76
...
...
@@ -17,6 +17,5 @@ rpl_row_binlog_max_cache_size : MDEV-11092
rpl_blackhole : MDEV-11094
rpl_row_mysqlbinlog : MDEV-11095
rpl_row_index_choice : MDEV-11666
rpl_delayed_slave : MDEV-14528
rpl_parallel2 : fails after MDEV-16172
rpl_semi_sync_after_sync : fails after MDEV-16172
sql/slave.cc
View file @
2767cb76
...
...
@@ -4306,7 +4306,15 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli,
*/
if
(
!
(
ev
->
is_artificial_event
()
||
ev
->
is_relay_log_event
()
||
(
ev
->
when
==
0
)))
{
/*
Ignore FD's timestamp as it does not reflect the slave execution
state but likely to reflect a deep past. Consequently when the first
data modification event execution last long all this time
Seconds_Behind_Master is zero.
*/
if
(
ev
->
get_type_code
()
!=
FORMAT_DESCRIPTION_EVENT
)
rli
->
last_master_timestamp
=
ev
->
when
+
(
time_t
)
ev
->
exec_time
;
DBUG_ASSERT
(
rli
->
last_master_timestamp
>=
0
);
}
}
...
...
sql/sql_cte.cc
View file @
2767cb76
...
...
@@ -1278,7 +1278,7 @@ bool With_element::check_unrestricted_recursive(st_select_lex *sel,
With_element
*
with_elem
=
unit
->
with_element
;
if
(
encountered
&
with_elem
->
get_elem_map
())
unrestricted
|=
with_elem
->
mutually_recursive
;
else
else
if
(
with_elem
==
this
)
encountered
|=
with_elem
->
get_elem_map
();
}
}
...
...
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