diff options
author | Igor Babaev <igor@askmonty.org> | 2016-03-18 00:33:53 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2016-03-18 00:33:53 -0700 |
commit | a197c6bb68d77a0ec73b28d1e6473022ea6b1ae0 (patch) | |
tree | a91588ab6a002b5ef7bedd006a6b23ee8957355c /sql/item_windowfunc.h | |
parent | 761590dcd53162e7b73421eb6a61cd399f4dc70d (diff) | |
download | mariadb-git-a197c6bb68d77a0ec73b28d1e6473022ea6b1ae0.tar.gz |
Prohibit using window functions of some types with
window frames in full accordance with the SQL standard.
Diffstat (limited to 'sql/item_windowfunc.h')
-rw-r--r-- | sql/item_windowfunc.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h index 56d0a0b70b1..4e0ba7fc43b 100644 --- a/sql/item_windowfunc.h +++ b/sql/item_windowfunc.h @@ -436,6 +436,20 @@ public: force_return_blank(true), read_value_from_result_field(false) {} + bool is_frame_prohibited() + { + switch (window_func->sum_func()) { + case Item_sum::ROW_NUMBER_FUNC: + case Item_sum::RANK_FUNC: + case Item_sum::DENSE_RANK_FUNC: + case Item_sum::PERCENT_RANK_FUNC: + case Item_sum::CUME_DIST_FUNC: + return true; + default: + return false; + } + } + /* Computation functions. TODO: consoder merging these with class Group_bound_tracker. @@ -581,6 +595,7 @@ public: bool fix_fields(THD *thd, Item **ref); bool resolve_window_name(THD *thd); + }; #endif /* ITEM_WINDOWFUNC_INCLUDED */ |