diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2015-06-25 08:33:15 +0300 |
---|---|---|
committer | Vicentiu Ciorbaru <vicentiu@mariadb.org> | 2015-07-13 16:01:25 +0000 |
commit | c64a3e9290db188c649f4c857352dcb34821d9f1 (patch) | |
tree | 28130ad44d06071bc8a4a3d73ff09b128d8cf752 /sql/item_windowfunc.cc | |
parent | 33745a407b3557f2914ebf8119e8ea3435481cde (diff) | |
download | mariadb-git-10.1-window.tar.gz |
Initial window func attempt10.1-window
Diffstat (limited to 'sql/item_windowfunc.cc')
-rw-r--r-- | sql/item_windowfunc.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc index 273a0831116..3d3cea59450 100644 --- a/sql/item_windowfunc.cc +++ b/sql/item_windowfunc.cc @@ -1,4 +1,7 @@ #include "item_windowfunc.h" +#include "my_dbug.h" +#include "my_global.h" +#include "sql_select.h" // test if group changed bool Item_window_func::fix_fields(THD *thd, Item **ref) @@ -8,6 +11,22 @@ Item_window_func::fix_fields(THD *thd, Item **ref) if (window_func->fix_fields(thd, ref)) return TRUE; + for (ORDER * curr = window_spec->partition_list.first; curr; curr=curr->next) { + curr->item_ptr->fix_fields(thd, curr->item); + Cached_item *tmp= new_Cached_item(thd, curr->item_ptr, TRUE); + partition_fields.push_back(tmp); + } + fixed= 1; return FALSE; } + +void Item_window_func::advance_window() { + + int changed = test_if_group_changed(partition_fields); + + if (changed > -1) { + window_func->clear(); + } + window_func->add(); +} |