diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2016-09-09 14:46:47 +0300 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2016-09-09 18:33:29 +0300 |
commit | dfd3be928d98d123e86b8ad3ae307e27153ab11c (patch) | |
tree | 212b3b4f7ab92966bc6df662e88e5281dce9c0b5 /sql/item_sum.h | |
parent | ffed20c5635a58bc1465efd5d936650b1672da74 (diff) | |
download | mariadb-git-dfd3be928d98d123e86b8ad3ae307e27153ab11c.tar.gz |
Make cursor implementation uniform
Cursors now report their current row number as the boundary of the
partition. This is used by Frame_scan_cursor to compute aggregate
functions that do not support removal.
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r-- | sql/item_sum.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h index 9fd6f7867db..16835441125 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -543,7 +543,8 @@ public: virtual void clear()= 0; virtual bool add()= 0; virtual bool setup(THD *thd) { return false; } - + + virtual bool supports_removal() const { return false; } virtual void remove() { DBUG_ASSERT(0); } virtual void cleanup(); @@ -771,6 +772,11 @@ public: Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy<Item_sum_sum>(thd, mem_root, this); } + bool supports_removal() const + { + return true; + } + private: void add_helper(bool perform_removal); ulonglong count; @@ -829,6 +835,11 @@ class Item_sum_count :public Item_sum_int Item *copy_or_same(THD* thd); Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy<Item_sum_count>(thd, mem_root, this); } + + bool supports_removal() const + { + return true; + } }; @@ -878,6 +889,11 @@ public: } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy<Item_sum_avg>(thd, mem_root, this); } + + bool supports_removal() const + { + return true; + } }; @@ -1089,6 +1105,11 @@ public: DBUG_ASSERT(0); } + bool supports_removal() const + { + return true; + } + protected: static const int NUM_BIT_COUNTERS= 64; ulonglong reset_bits,bits; |