Commit 0939bfc0 authored by Daniel Black's avatar Daniel Black

MDEV-19052 main.win postfix --view-protocol compat

Correct compatibility with view-protocol.

Thanks Lena Startseva
parent 77885935
......@@ -1276,47 +1276,44 @@ ERROR HY000: Integer is required for ROWS-type frame
#
select
count(*) over (order by c
range between unbounded preceding and current row)
range between unbounded preceding and current row) as r
from t1;
count(*) over (order by c
range between unbounded preceding and current row)
r
1
2
select
count(*) over (order by c
range between current row and unbounded following)
range between current row and unbounded following) as r
from t1;
count(*) over (order by c
range between current row and unbounded following)
r
2
1
select
count(*) over (order by c
range between unbounded preceding and unbounded following)
range between unbounded preceding and unbounded following) as r
from t1;
count(*) over (order by c
range between unbounded preceding and unbounded following)
r
2
2
create table t2 (a int, b varchar(5));
insert into t2 values (1,'a'), (2, 'b'), (3, 'c');
select sum(a) over (order by b range between unbounded preceding and current row) from t2;
sum(a) over (order by b range between unbounded preceding and current row)
select sum(a) over (order by b range between unbounded preceding and current row) as r from t2;
r
1
3
6
insert into t1 values (3,3,'goo');
insert into t1 values (3,1,'har');
insert into t1 values (1,4,'har');
select a, b, sum(b) over (order by a, b desc range between unbounded preceding and current row) from t1;
a b sum(b) over (order by a, b desc range between unbounded preceding and current row)
select a, b, sum(b) over (order by a, b desc range between unbounded preceding and current row) as r from t1;
a b r
1 4 4
1 1 5
2 2 7
3 3 10
3 1 11
select a, b, sum(b) over (order by a desc, b range between unbounded preceding and current row) from t1;
a b sum(b) over (order by a desc, b range between unbounded preceding and current row)
select a, b, sum(b) over (order by a desc, b range between unbounded preceding and current row) as r from t1;
a b r
3 1 1
3 3 4
2 2 6
......
......@@ -818,31 +818,31 @@ from t1;
select
count(*) over (order by c
range between unbounded preceding and current row)
range between unbounded preceding and current row) as r
from t1;
select
count(*) over (order by c
range between current row and unbounded following)
range between current row and unbounded following) as r
from t1;
select
count(*) over (order by c
range between unbounded preceding and unbounded following)
range between unbounded preceding and unbounded following) as r
from t1;
create table t2 (a int, b varchar(5));
insert into t2 values (1,'a'), (2, 'b'), (3, 'c');
select sum(a) over (order by b range between unbounded preceding and current row) from t2;
select sum(a) over (order by b range between unbounded preceding and current row) as r from t2;
insert into t1 values (3,3,'goo');
insert into t1 values (3,1,'har');
insert into t1 values (1,4,'har');
select a, b, sum(b) over (order by a, b desc range between unbounded preceding and current row) from t1;
select a, b, sum(b) over (order by a, b desc range between unbounded preceding and current row) as r from t1;
select a, b, sum(b) over (order by a desc, b range between unbounded preceding and current row) from t1;
select a, b, sum(b) over (order by a desc, b range between unbounded preceding and current row) as r from t1;
drop table t2;
delete from t1 where a >= 3 or b = 4;
......
......@@ -1282,47 +1282,44 @@ ERROR HY000: Integer is required for ROWS-type frame
#
select
count(*) over (order by c
range between unbounded preceding and current row)
range between unbounded preceding and current row) as r
from t1;
count(*) over (order by c
range between unbounded preceding and current row)
r
1
2
select
count(*) over (order by c
range between current row and unbounded following)
range between current row and unbounded following) as r
from t1;
count(*) over (order by c
range between current row and unbounded following)
r
2
1
select
count(*) over (order by c
range between unbounded preceding and unbounded following)
range between unbounded preceding and unbounded following) as r
from t1;
count(*) over (order by c
range between unbounded preceding and unbounded following)
r
2
2
create table t2 (a int, b varchar(5));
insert into t2 values (1,'a'), (2, 'b'), (3, 'c');
select sum(a) over (order by b range between unbounded preceding and current row) from t2;
sum(a) over (order by b range between unbounded preceding and current row)
select sum(a) over (order by b range between unbounded preceding and current row) as r from t2;
r
1
3
6
insert into t1 values (3,3,'goo');
insert into t1 values (3,1,'har');
insert into t1 values (1,4,'har');
select a, b, sum(b) over (order by a, b desc range between unbounded preceding and current row) from t1;
a b sum(b) over (order by a, b desc range between unbounded preceding and current row)
select a, b, sum(b) over (order by a, b desc range between unbounded preceding and current row) as r from t1;
a b r
1 4 4
1 1 5
2 2 7
3 3 10
3 1 11
select a, b, sum(b) over (order by a desc, b range between unbounded preceding and current row) from t1;
a b sum(b) over (order by a desc, b range between unbounded preceding and current row)
select a, b, sum(b) over (order by a desc, b range between unbounded preceding and current row) as r from t1;
a b r
3 1 1
3 3 4
2 2 6
......
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