mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 18:20:07 +01:00
A derived_query_specification clean-up
(to simplify further MDEV-8909 changes) 1. Better semantic readability: - Moving get_select_lex_derived inside select_derived_init and decomposing it into get_select_lex and $1->init_nested_join(lex->thd) - Moving DBUG_ASSERT($1 == Lex->current_select) inside select_derived_init Now init_nested_join() and end_nested_join() reside inside the same rule select_derived_init. (It's very likely that they can be further removed, as there are no any joins in this rule). 3. Better grammar readability: Moving SELECT_SYM from select_derived_init to derived_query_specification. It's easier to read a rule when it starts from a terminal symbol.
This commit is contained in:
parent
485ece6da9
commit
c44b2e66a9
1 changed files with 6 additions and 7 deletions
|
@ -11194,12 +11194,7 @@ select_derived:
|
|||
SELECT * FROM (SELECT * FROM t1);
|
||||
*/
|
||||
derived_query_specification:
|
||||
get_select_lex_derived select_derived_init
|
||||
{
|
||||
// Now we have the same st_select_lex that we had in the beginning
|
||||
DBUG_ASSERT($1 == Lex->current_select);
|
||||
}
|
||||
select_derived2
|
||||
SELECT_SYM select_derived_init select_derived2
|
||||
{
|
||||
LEX *lex= Lex;
|
||||
SELECT_LEX *sel= lex->current_select;
|
||||
|
@ -11252,9 +11247,11 @@ get_select_lex_derived:
|
|||
;
|
||||
|
||||
select_derived_init:
|
||||
SELECT_SYM
|
||||
get_select_lex
|
||||
{
|
||||
LEX *lex= Lex;
|
||||
if ($1->init_nested_join(lex->thd))
|
||||
MYSQL_YYABORT;
|
||||
|
||||
if (! lex->parsing_options.allows_derived)
|
||||
{
|
||||
|
@ -11274,6 +11271,8 @@ select_derived_init:
|
|||
$$= embedding &&
|
||||
!embedding->nested_join->join_list.elements;
|
||||
/* return true if we are deeply nested */
|
||||
// Now we have the same st_select_lex that we had in the beginning
|
||||
DBUG_ASSERT($1 == Lex->current_select);
|
||||
}
|
||||
;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue