Commit 2767cb76 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.2 into 10.3

parents a9110984 41425892
This diff is collapsed.
......@@ -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 #
......
......@@ -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
......@@ -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)))
{
rli->last_master_timestamp= ev->when + (time_t) ev->exec_time;
/*
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);
}
}
......
......@@ -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();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment