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
13f9535f
Commit
13f9535f
authored
Mar 18, 2016
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9724: Window functions: Frame Exclusion support
Produce a "not supported" error if one attempts to exclude rows
parent
a197c6bb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
1 deletion
+73
-1
mysql-test/r/win.result
mysql-test/r/win.result
+31
-0
mysql-test/t/win.test
mysql-test/t/win.test
+32
-0
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+4
-1
sql/sql_window.cc
sql/sql_window.cc
+6
-0
No files found.
mysql-test/r/win.result
View file @
13f9535f
...
...
@@ -1233,6 +1233,37 @@ count(*) over (order by a
rows between current row and 3.14 following)
from t1;
ERROR HY000: Integer is required for ROWS-type frame
#
# EXCLUDE clause is parsed but not supported
#
select
count(*) over (order by a
rows between 1 preceding and 1 following
exclude current row)
from t1;
ERROR HY000: Frame exclusion is not supported yet
select
count(*) over (order by a
range between 1 preceding and 1 following
exclude ties)
from t1;
ERROR HY000: Frame exclusion is not supported yet
select
count(*) over (order by a
range between 1 preceding and 1 following
exclude group)
from t1;
ERROR HY000: Frame exclusion is not supported yet
select
count(*) over (order by a
rows between 1 preceding and 1 following
exclude no others)
from t1;
count(*) over (order by a
rows between 1 preceding and 1 following
exclude no others)
2
2
drop table t1;
#
# Window function in grouping query
...
...
mysql-test/t/win.test
View file @
13f9535f
...
...
@@ -762,6 +762,38 @@ select
rows
between
current
row
and
3.14
following
)
from
t1
;
--
echo
#
--
echo
# EXCLUDE clause is parsed but not supported
--
echo
#
--
error
ER_FRAME_EXCLUSION_NOT_SUPPORTED
select
count
(
*
)
over
(
order
by
a
rows
between
1
preceding
and
1
following
exclude
current
row
)
from
t1
;
--
error
ER_FRAME_EXCLUSION_NOT_SUPPORTED
select
count
(
*
)
over
(
order
by
a
range
between
1
preceding
and
1
following
exclude
ties
)
from
t1
;
--
error
ER_FRAME_EXCLUSION_NOT_SUPPORTED
select
count
(
*
)
over
(
order
by
a
range
between
1
preceding
and
1
following
exclude
group
)
from
t1
;
# EXCLUDE NO OTHERS means 'don't exclude anything'
select
count
(
*
)
over
(
order
by
a
rows
between
1
preceding
and
1
following
exclude
no
others
)
from
t1
;
drop
table
t1
;
--
echo
#
...
...
sql/share/errmsg-utf8.txt
View file @
13f9535f
...
...
@@ -7156,4 +7156,7 @@ ER_WRONG_TYPE_FOR_ROWS_FRAME
eng "Integer is required for ROWS-type frame"
ER_WRONG_TYPE_FOR_RANGE_FRAME
eng "Numeric datatype is required for RANGE-type frame"
ER_FRAME_EXCLUSION_NOT_SUPPORTED
eng "Frame exclusion is not supported yet"
ER_WINDOW_FUNCTION_DONT_HAVE_FRAME
eng "This window function may not have a window frame"
sql/sql_window.cc
View file @
13f9535f
...
...
@@ -127,6 +127,12 @@ setup_windows(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
DBUG_RETURN
(
1
);
}
if
(
win_spec
->
window_frame
&&
win_spec
->
window_frame
->
exclusion
!=
Window_frame
::
EXCL_NONE
)
{
my_error
(
ER_FRAME_EXCLUSION_NOT_SUPPORTED
,
MYF
(
0
));
DBUG_RETURN
(
1
);
}
/*
For "win_func() OVER (ORDER BY order_list RANGE BETWEEN ...)",
- ORDER BY order_list must not be ommitted
...
...
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