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
2e7a585d
Commit
2e7a585d
authored
Sep 19, 2016
by
Vicențiu Ciorbaru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test case for new window functions status var
parent
62df3119
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
mysql-test/r/win_i_s.result
mysql-test/r/win_i_s.result
+38
-0
mysql-test/t/win_i_s.test
mysql-test/t/win_i_s.test
+18
-0
No files found.
mysql-test/r/win_i_s.result
0 → 100644
View file @
2e7a585d
show status like '%window%';
Variable_name Value
Feature_window_functions 0
create table t1 (a int, b int);
insert into t1 values (1, 10), (2, 20), (3, 30);
select a, b, rank() over (order by a) from t1;
a b rank() over (order by a)
1 10 1
2 20 2
3 30 3
show status like '%window%';
Variable_name Value
Feature_window_functions 1
select a, b, rank() over (order by a), sum(a) over (order by a) from t1;
a b rank() over (order by a) sum(a) over (order by a)
1 10 1 1
2 20 2 3
3 30 3 6
show status like '%window%';
Variable_name Value
Feature_window_functions 2
select t_a.r1, t_b.r2
from (select a, b, rank() over (order by a) as r1 from t1) t_a,
(select a, b, row_number() over (order by a) as r2 from t1) t_b;
r1 r2
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3
show status like '%window%';
Variable_name Value
Feature_window_functions 4
drop table t1;
mysql-test/t/win_i_s.test
0 → 100644
View file @
2e7a585d
show
status
like
'%window%'
;
create
table
t1
(
a
int
,
b
int
);
insert
into
t1
values
(
1
,
10
),
(
2
,
20
),
(
3
,
30
);
select
a
,
b
,
rank
()
over
(
order
by
a
)
from
t1
;
show
status
like
'%window%'
;
select
a
,
b
,
rank
()
over
(
order
by
a
),
sum
(
a
)
over
(
order
by
a
)
from
t1
;
show
status
like
'%window%'
;
--
sorted_result
select
t_a
.
r1
,
t_b
.
r2
from
(
select
a
,
b
,
rank
()
over
(
order
by
a
)
as
r1
from
t1
)
t_a
,
(
select
a
,
b
,
row_number
()
over
(
order
by
a
)
as
r2
from
t1
)
t_b
;
show
status
like
'%window%'
;
drop
table
t1
;
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