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_tvc.cc | |
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_tvc.cc')
-rw-r--r-- | sql/sql_tvc.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc index 576927ea086..cfd46336d07 100644 --- a/sql/sql_tvc.cc +++ b/sql/sql_tvc.cc @@ -651,7 +651,8 @@ static bool create_tvc_name(THD *thd, st_select_lex *parent_select, bool table_value_constr::to_be_wrapped_as_with_tail() { return select_lex->master_unit()->first_select()->next_select() && - select_lex->order_list.elements && select_lex->explicit_limit; + select_lex->order_list.elements && + select_lex->limit_params.explicit_limit; } @@ -799,15 +800,11 @@ st_select_lex *wrap_tvc_with_tail(THD *thd, st_select_lex *tvc_sl) return NULL; wrapper_sl->order_list= tvc_sl->order_list; - wrapper_sl->select_limit= tvc_sl->select_limit; - wrapper_sl->offset_limit= tvc_sl->offset_limit; + wrapper_sl->limit_params= tvc_sl->limit_params; wrapper_sl->braces= tvc_sl->braces; - wrapper_sl->explicit_limit= tvc_sl->explicit_limit; tvc_sl->order_list.empty(); - tvc_sl->select_limit= NULL; - tvc_sl->offset_limit= NULL; + tvc_sl->limit_params.clear(); tvc_sl->braces= 0; - tvc_sl->explicit_limit= false; if (tvc_sl->select_number == 1) { tvc_sl->select_number= wrapper_sl->select_number; |