summaryrefslogtreecommitdiff
path: root/sql/item_windowfunc.h
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-02-05 00:52:17 +0300
committerSergei Petrunia <psergey@askmonty.org>2016-02-14 11:14:34 +0300
commit6399187ebcd92bfa2b11292563048ee145d4eebb (patch)
treea0a44ead997624ded8af7b89c76e4506738e6296 /sql/item_windowfunc.h
parent426cd232a7fed0a55403aa9e42c0dd05dedd8b58 (diff)
downloadmariadb-git-6399187ebcd92bfa2b11292563048ee145d4eebb.tar.gz
Added comments
Diffstat (limited to 'sql/item_windowfunc.h')
-rw-r--r--sql/item_windowfunc.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index 3653cefaf57..e5ba673d8d4 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -157,6 +157,24 @@ public:
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(); }