summaryrefslogtreecommitdiff
path: root/sql/item_windowfunc.h
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <cvicentiu@gmail.com>2016-02-16 00:22:12 +0200
committerVicențiu Ciorbaru <cvicentiu@gmail.com>2016-02-16 00:22:12 +0200
commit9a673e0a88cf7ab5eba8115edbd66d479ad38764 (patch)
treedd0fee29cad8661c6f19bf5b0caedc5365cfa7b9 /sql/item_windowfunc.h
parentc30119adc73482794030c8ca717d2d991dc8d995 (diff)
downloadmariadb-git-9a673e0a88cf7ab5eba8115edbd66d479ad38764.tar.gz
Implement DENSE_RANK function.
Diffstat (limited to 'sql/item_windowfunc.h')
-rw-r--r--sql/item_windowfunc.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index 7652bcbc690..7db98872b3a 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -135,7 +135,7 @@ public:
/*
- RANK() OVER (...) Windowing function
+ DENSE_RANK() OVER (...) Windowing function
@detail
- This is a Window function (not just an aggregate)
@@ -156,11 +156,16 @@ public:
class Item_sum_dense_rank: public Item_sum_int
{
longlong dense_rank;
-
+ List<Cached_item> orderby_fields;
/* TODO: implementation is missing */
- void clear() {}
- bool add() { return false; }
+ void clear() {
+ dense_rank= 1;
+ }
+ bool add();
void update_field() {}
+ longlong val_int() {
+ return dense_rank;
+ }
public:
Item_sum_dense_rank(THD *thd)
@@ -174,7 +179,9 @@ class Item_sum_dense_rank: public Item_sum_int
{
return "dense_rank";
}
-
+
+ void setup_window_func(THD *thd, Window_spec *window_spec);
+
};