mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 18:20:07 +01:00
More testcases. Added .result file
This commit is contained in:
parent
346c1a0ad0
commit
e64b57a839
2 changed files with 68 additions and 9 deletions
41
mysql-test/r/win.result
Normal file
41
mysql-test/r/win.result
Normal file
|
@ -0,0 +1,41 @@
|
|||
drop table if exists t1,t2;
|
||||
create table t1(a int, b int, x char(32));
|
||||
insert into t1 values (2, 10, 'xx');
|
||||
insert into t1 values (2, 10, 'zz');
|
||||
insert into t1 values (2, 20, 'yy');
|
||||
insert into t1 values (3, 10, 'xxx');
|
||||
insert into t1 values (3, 20, 'vvv');
|
||||
select a, row_number() over (partition by a order by b) from t1;
|
||||
a row_number() over (partition by a order by b)
|
||||
2 1
|
||||
2 2
|
||||
2 3
|
||||
3 1
|
||||
3 2
|
||||
select a, b, x, row_number() over (partition by a order by x) from t1;
|
||||
a b x row_number() over (partition by a order by x)
|
||||
2 10 xx 1
|
||||
2 10 zz 3
|
||||
2 20 yy 2
|
||||
3 10 xxx 2
|
||||
3 20 vvv 1
|
||||
drop table t1;
|
||||
create table t1 (pk int primary key, a int, b int);
|
||||
insert into t1 values
|
||||
(1, 10, 22),
|
||||
(2, 11, 21),
|
||||
(3, 12, 20),
|
||||
(4, 13, 19),
|
||||
(5, 14, 18);
|
||||
select
|
||||
pk, a, b,
|
||||
row_number() over (order by a),
|
||||
row_number() over (order by b)
|
||||
from t1;
|
||||
pk a b row_number() over (order by a) row_number() over (order by b)
|
||||
1 10 22 1 5
|
||||
2 11 21 2 4
|
||||
3 12 20 3 3
|
||||
4 13 19 4 2
|
||||
5 14 18 5 1
|
||||
drop table t1;
|
|
@ -1,19 +1,37 @@
|
|||
#
|
||||
# Window Functions Tests
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
|
||||
create table t1(a int, b int, x char(32));
|
||||
insert into t1 values (2, 10, 'xx');
|
||||
insert into t1 values (2, 10, 'zz');
|
||||
insert into t1 values (2, 20, 'yy');
|
||||
insert into t1 values (3, 10, 'xxx');
|
||||
insert into t1 values (3, 20, 'vvv');
|
||||
# Uncommenting this line causes a crash in setup_group when executing the second
|
||||
# select.
|
||||
#select row_number() over (order by b) from t1;
|
||||
#select a, b, x, row_number() over (partition by a,b order by x),
|
||||
# row_number() over (partition by a),
|
||||
# row_number() over (partition by a order by x)
|
||||
#from t1;
|
||||
# Uncommenting this line causes a crash in filesort during init_for_filesort.
|
||||
#select a, b, x, row_number() over (partition by a order by x) from t1;
|
||||
|
||||
select a, row_number() over (partition by a order by b) from t1;
|
||||
|
||||
select a, b, x, row_number() over (partition by a order by x) from t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
create table t1 (pk int primary key, a int, b int);
|
||||
insert into t1 values
|
||||
(1, 10, 22),
|
||||
(2, 11, 21),
|
||||
(3, 12, 20),
|
||||
(4, 13, 19),
|
||||
(5, 14, 18);
|
||||
|
||||
select
|
||||
pk, a, b,
|
||||
row_number() over (order by a),
|
||||
row_number() over (order by b)
|
||||
from t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue