Commit c44b2e66 authored by Alexander Barkov's avatar Alexander Barkov

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.
parent 485ece6d
......@@ -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);
}
;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment