summaryrefslogtreecommitdiff
path: root/sql/structs.h
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2020-12-19 13:59:37 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2021-04-21 14:08:58 +0300
commit13cf8f5e9afc7f64df79b41e2b004c28086371f4 (patch)
treeed6bfed9c8488ab688b57bafa42e7eaa68ae2168 /sql/structs.h
parentdd6ad3806856221f1af302e61ebd985905a00060 (diff)
downloadmariadb-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/structs.h')
-rw-r--r--sql/structs.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/structs.h b/sql/structs.h
index df362f76f82..adb1fec119b 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -824,13 +824,15 @@ public:
class Lex_select_limit
{
public:
+ /* explicit LIMIT clause was used */
bool explicit_limit;
Item *select_limit, *offset_limit;
- void empty()
+ void clear()
{
- explicit_limit= FALSE;
- select_limit= offset_limit= NULL;
+ explicit_limit= FALSE; // No explicit limit given by user
+ select_limit= NULL; // denotes the default limit = HA_POS_ERROR
+ offset_limit= NULL; // denotes the default offset = 0
}
};