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
6399187e
Commit
6399187e
authored
9 years ago
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments
parent
426cd232
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
sql/item_windowfunc.cc
sql/item_windowfunc.cc
+6
-0
sql/item_windowfunc.h
sql/item_windowfunc.h
+18
-0
No files found.
sql/item_windowfunc.cc
View file @
6399187e
...
...
@@ -5,6 +5,12 @@ Item_window_func::fix_fields(THD *thd, Item **ref)
{
DBUG_ASSERT
(
fixed
==
0
);
/*
TODO: why the last parameter is 'ref' in this call? What if window_func
decides to substitute itself for something else and does *ref=.... ?
This will substitute *this (an Item_window_func object) with Item_sum
object. Is this the intent?
*/
if
(
window_func
->
fix_fields
(
thd
,
ref
))
return
TRUE
;
...
...
This diff is collapsed.
Click to expand it.
sql/item_windowfunc.h
View file @
6399187e
...
...
@@ -157,6 +157,24 @@ class Item_window_func : public Item_result_field
enum_field_types
field_type
()
const
{
return
window_func
->
field_type
();
}
/*
TODO: Window functions are very special functions, so val_() methods have
special meaning for them:
- Phase#1: we run the join and put its result into temporary table. For
window functions, we write NULL (or some other) values as placeholders.
- Phase#2: executor does the scan in {PARTITION, ORDER BY} order of this
window function. It calls appropriate methods to inform the window
function about rows entering/leaving the window.
It calls window_func->val_int() so that current window function value
can be saved and stored in the temp.table.
- Phase#3: the temporaty table is read and passed to query output. (Do
I understand correctly that Item_window_func::val_XXX won't be called
at all in this phase? Need to check)
*/
double
val_real
()
{
return
window_func
->
val_real
();
}
longlong
val_int
()
{
return
window_func
->
val_int
();
}
...
...
This diff is collapsed.
Click to expand it.
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