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
f638ffef
Commit
f638ffef
authored
Feb 28, 2016
by
Vicențiu Ciorbaru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert if statements to switch case.
parent
1cc6fd1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
22 deletions
+25
-22
sql/item_windowfunc.h
sql/item_windowfunc.h
+0
-1
sql/sql_window.cc
sql/sql_window.cc
+25
-21
No files found.
sql/item_windowfunc.h
View file @
f638ffef
...
...
@@ -372,5 +372,4 @@ class Item_window_func : public Item_result_field
};
#endif
/* ITEM_WINDOWFUNC_INCLUDED */
sql/sql_window.cc
View file @
f638ffef
...
...
@@ -886,28 +886,32 @@ bool JOIN::process_window_functions(List<Item> *curr_fields_list)
item_win
->
setup_partition_border_check
(
thd
);
Item_sum
::
Sumfunctype
type
=
item_win
->
window_func
->
sum_func
();
if
(
type
==
Item_sum
::
ROW_NUMBER_FUNC
||
type
==
Item_sum
::
RANK_FUNC
||
type
==
Item_sum
::
DENSE_RANK_FUNC
)
{
/*
One-pass window function computation, walk through the rows and
assign values.
*/
if
(
compute_window_func_values
(
item_win
,
tbl
,
&
info
))
is_error
=
true
;
}
else
if
(
type
==
Item_sum
::
COUNT_FUNC
)
{
/*
Frame-aware window function computation. It does one pass, but
uses three cursors -frame_top, current_row, and frame_bottom.
*/
if
(
compute_window_func_with_frames
(
item_win
,
tbl
,
&
info
))
is_error
=
true
;
switch
(
type
)
{
case
Item_sum
:
:
ROW_NUMBER_FUNC
:
case
Item_sum
:
:
RANK_FUNC
:
case
Item_sum
:
:
DENSE_RANK_FUNC
:
{
/*
One-pass window function computation, walk through the rows and
assign values.
*/
if
(
compute_window_func_values
(
item_win
,
tbl
,
&
info
))
is_error
=
true
;
break
;
}
case
Item_sum
:
:
COUNT_FUNC
:
{
/*
Frame-aware window function computation. It does one pass, but
uses three cursors -frame_start, current_row, and frame_end.
*/
if
(
compute_window_func_with_frames
(
item_win
,
tbl
,
&
info
))
is_error
=
true
;
break
;
}
default:
DBUG_ASSERT
(
0
);
}
else
DBUG_ASSERT
(
0
);
item_win
->
set_read_value_from_result_field
();
/* This calls filesort_free_buffers(): */
...
...
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