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
c7a60de7
Commit
c7a60de7
authored
Mar 24, 2016
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
39d3cdbf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
96 deletions
+87
-96
sql/item_windowfunc.h
sql/item_windowfunc.h
+4
-8
sql/sql_select.cc
sql/sql_select.cc
+1
-1
sql/sql_select.h
sql/sql_select.h
+1
-1
sql/sql_window.cc
sql/sql_window.cc
+81
-86
No files found.
sql/item_windowfunc.h
View file @
c7a60de7
...
...
@@ -545,6 +545,7 @@ class Item_window_func : public Item_func_or_sum
}
enum
Item
::
Type
type
()
const
{
return
Item
::
WINDOW_FUNC_ITEM
;
}
private:
/*
Window functions are very special functions, so val_() methods have
special meaning for them:
...
...
@@ -584,11 +585,6 @@ class Item_window_func : public Item_func_or_sum
read_value_from_result_field
=
true
;
}
void
set_read_value_from_result_field
()
{
read_value_from_result_field
=
true
;
}
double
val_real
()
{
double
res
;
...
...
sql/sql_select.cc
View file @
c7a60de7
...
...
@@ -25898,7 +25898,7 @@ AGGR_OP::end_send()
// Update ref array
join_tab->join->set_items_ref_array(*join_tab->ref_array);
join
->
process_window_functions
(
&
join
->
fields_list
);
// location #2
join->process_window_functions(&join->
select_lex->window_funcs);
table->reginfo.lock_type= TL_UNLOCK;
bool in_first_read= true;
...
...
sql/sql_select.h
View file @
c7a60de7
...
...
@@ -1494,7 +1494,7 @@ class JOIN :public Sql_alloc
int
init_execution
();
void
exec
();
bool
process_window_functions
(
List
<
Item
>
*
curr_fields_list
);
bool
process_window_functions
(
List
<
Item
_window_func
>
*
window_funcs
);
void
exec_inner
();
bool
prepare_result
(
List
<
Item
>
**
columns_list
);
...
...
sql/sql_window.cc
View file @
c7a60de7
...
...
@@ -1579,17 +1579,13 @@ bool compute_two_pass_window_functions(Item_window_func *item_win,
true Error
*/
bool
JOIN
::
process_window_functions
(
List
<
Item
>
*
curr_fields_list
)
bool
JOIN
::
process_window_functions
(
List
<
Item
_window_func
>
*
window_funcs
)
{
List_iterator_fast
<
Item
>
it
(
*
curr_fields_list
);
Item
*
item
;
List_iterator_fast
<
Item
_window_func
>
it
(
*
window_funcs
);
Item
_window_func
*
item_win
;
while
((
item_win
=
it
++
))
{
while
((
item
=
it
++
))
{
if
(
item
->
type
()
==
Item
::
WINDOW_FUNC_ITEM
)
{
Item_window_func
*
item_win
=
(
Item_window_func
*
)
item
;
item_win
->
set_phase_to_computation
();
Window_spec
*
spec
=
item_win
->
window_spec
;
/*
...
...
@@ -1606,6 +1602,7 @@ bool JOIN::process_window_functions(List<Item> *curr_fields_list)
join_tab[top_join_tab_count].table is the temp. table where join
output was stored.
*/
// CAUTION: The sorting criteria list is not yet connected
add_sorting_to_table
(
&
join_tab
[
top_join_tab_count
],
spec
->
partition_list
->
first
);
join_tab
[
top_join_tab_count
].
used_for_window_func
=
true
;
...
...
@@ -1674,8 +1671,6 @@ bool JOIN::process_window_functions(List<Item> *curr_fields_list)
if
(
is_error
)
return
true
;
}
}
}
return
false
;
}
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