diff options
author | Igor Babaev <igor@askmonty.org> | 2017-02-03 15:50:25 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2017-02-03 15:50:25 -0800 |
commit | 20aae56efa5aba90893e602ea87af2f14d161b10 (patch) | |
tree | 4bc7a24424484ece548b4c1220cc6becd36b7c47 /sql/item_sum.h | |
parent | bc12d993d7bc94a9533028a258afc7e4ceb21e92 (diff) | |
download | mariadb-git-20aae56efa5aba90893e602ea87af2f14d161b10.tar.gz |
Fixed bug mdev-10660.
The method Item_sum::print did not print opening '(' after the name
of simple window functions (like rank, dense_rank etc).
As a result the view definitions with such window functions
were formed invalid in .frm files.
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 940726b5d8e..a838bd0bc10 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -409,10 +409,31 @@ public: Item_sum(THD *thd, Item_sum *item); enum Type type() const { return SUM_FUNC_ITEM; } virtual enum Sumfunctype sum_func () const=0; + bool is_aggr_sum_func() + { + switch (sum_func()) { + case COUNT_FUNC: + case COUNT_DISTINCT_FUNC: + case SUM_FUNC: + case SUM_DISTINCT_FUNC: + case AVG_FUNC: + case AVG_DISTINCT_FUNC: + case MIN_FUNC: + case MAX_FUNC: + case STD_FUNC: + case VARIANCE_FUNC: + case SUM_BIT_FUNC: + case UDF_SUM_FUNC: + case GROUP_CONCAT_FUNC: + return true; + default: + return false; + } + } /** Resets the aggregate value to its default and aggregates the current value of its attribute(s). - */ + */ inline bool reset_and_add() { aggregator_clear(); |