mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
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()
This commit is contained in:
@@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user