diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2020-12-19 13:59:37 +0200 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2021-04-21 14:08:58 +0300 |
commit | 13cf8f5e9afc7f64df79b41e2b004c28086371f4 (patch) | |
tree | ed6bfed9c8488ab688b57bafa42e7eaa68ae2168 /sql/sql_limit.h | |
parent | dd6ad3806856221f1af302e61ebd985905a00060 (diff) | |
download | mariadb-git-13cf8f5e9afc7f64df79b41e2b004c28086371f4.tar.gz |
cleanup: Refactor select_limit in select lex
Replace
* select_lex::offset_limit
* select_lex::select_limit
* select_lex::explicit_limit
with select_lex::Lex_select_limit
The Lex_select_limit already existed with the same elements and was used in
by the yacc parser.
This commit is in preparation for FETCH FIRST implementation, as it
simplifies a lot of the code.
Additionally, the parser is simplified by making use of the stack to
return Lex_select_limit objects.
Cleanup of init_query() too. Removes explicit_limit= 0 as it's done a bit later
in init_select() with limit_params.empty()
Diffstat (limited to 'sql/sql_limit.h')
-rw-r--r-- | sql/sql_limit.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_limit.h b/sql/sql_limit.h index a4fcedac14a..943d96940bb 100644 --- a/sql/sql_limit.h +++ b/sql/sql_limit.h @@ -50,22 +50,22 @@ class Select_limit_counters select_limit_cnt= 1; } - bool is_unlimited() + bool is_unlimited() const { return select_limit_cnt == HA_POS_ERROR; } bool is_unrestricted() { return select_limit_cnt == HA_POS_ERROR && offset_limit_cnt == 0; } void set_unlimited() { select_limit_cnt= HA_POS_ERROR; offset_limit_cnt= 0; } - bool check_offset(ha_rows sent) + bool check_offset(ha_rows sent) const { return sent < offset_limit_cnt; } void remove_offset() { offset_limit_cnt= 0; } - ha_rows get_select_limit() + ha_rows get_select_limit() const { return select_limit_cnt; } - ha_rows get_offset_limit() + ha_rows get_offset_limit() const { return offset_limit_cnt; } }; |