1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.3' into 10.4

This commit is contained in:
Oleksandr Byelkin
2019-05-19 20:55:37 +02:00
3893 changed files with 11766 additions and 6460 deletions

View File

@@ -2265,6 +2265,66 @@ insert into t1 values (1),(2),(3);
SELECT rank() OVER (ORDER BY 1), ROW_NUMBER() OVER (ORDER BY (EXPORT_SET(5,'Y','N',',',4))) FROM t1;
drop table t1;
--echo #
--echo # MDEV-17781: Server crashes in next_linear_tab
--echo #
CREATE TABLE t1 (i1 int);
explain
(SELECT AVG(0) OVER (), MAX('2') FROM t1)
UNION ALL
(SELECT AVG(0) OVER (), MAX('2') FROM t1);
(SELECT AVG(0) OVER (), MAX('2') FROM t1)
UNION ALL
(SELECT AVG(0) OVER (), MAX('2') FROM t1);
drop table t1;
--echo #
--echo # MDEV-14791: Crash with order by expression containing window functions
--echo #
CREATE TABLE t1 (b1 int, b2 int);
INSERT INTO t1 VALUES (1,1),(0,0);
explain
SELECT b1 from t1 order by row_number() over (ORDER BY b2) + 1;
SELECT b1 from t1 order by row_number() over (ORDER BY b2) + 1;
explain
SELECT b1 from t1 order by row_number() over (ORDER BY b2);
SELECT b1 from t1 order by row_number() over (ORDER BY b2);
DROP TABLE t1;
CREATE TABLE t1 (a int, b int, c int);
INSERT INTO t1 VALUES (2,3,207), (1,21,909), (7,13,312), (8,64,248);
explain
SELECT * FROM t1 ORDER BY max(t1.a) over (partition by c);
SELECT * FROM t1 ORDER BY max(t1.a) over (partition by c);
explain
SELECT max(t1.a) over (partition by c) as x, b, c from t1 order by max(t1.a) over (partition by c);
SELECT max(t1.a) over (partition by c) as x, b, c from t1 order by max(t1.a) over (partition by c);
drop table t1;
--echo #
--echo # MDEV-18373: DENSE_RANK is not calculated correctly
--echo #
create table t1 (a int, b int);
insert into t1 values (60, 1515),(60, 2000),(70, 2000),(55, 1600);
select b, dense_rank() over (order by sum(a)) from t1 group by b;
select b, dense_rank() over (order by sum(a)+1) from t1 group by b;
select b, row_number() over (partition by sum(a)) from t1 group by b;
select b, row_number() over (partition by sum(a)+1) from t1 group by b;
drop table t1;
--echo #
--echo # End of 10.2 tests
--echo #