[Commits] 9bdea1a: Top nest_level for selects should be 0.

IgorBabaev igor at mariadb.com
Mon Apr 9 10:16:59 EEST 2018


revision-id: 9bdea1a93b5adbd74a4dd4ddb64e3061694b2c03 (mariadb-10.3.5-119-g9bdea1a)
parent(s): fc989e35004dc084e9cd96a1424c4d10981263bb
author: Igor Babaev
committer: Igor Babaev
timestamp: 2018-04-09 00:16:59 -0700
message:

Top nest_level for selects should be 0.

---
 mysql-test/main/brackets.result | 2 +-
 sql/sql_lex.cc                  | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mysql-test/main/brackets.result b/mysql-test/main/brackets.result
index 05fba4c..55e3ce4 100644
--- a/mysql-test/main/brackets.result
+++ b/mysql-test/main/brackets.result
@@ -111,4 +111,4 @@ NULL	UNION RESULT	<union3,6>	ALL	NULL	NULL	NULL	NULL	NULL	NULL
 NULL	UNION RESULT	<union2,7>	ALL	NULL	NULL	NULL	NULL	NULL	NULL	
 NULL	UNION RESULT	<union1,8>	ALL	NULL	NULL	NULL	NULL	NULL	NULL	
 Warnings:
-Note	1003	/* select#1/1 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#8/1 */ select `__8`.`1` AS `1` from (/* select#2/2 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#7/2 */ select `__7`.`1` AS `1` from (/* select#3/3 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#6/3 */ select `__6`.`1` AS `1` from (/* select#4/4 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#5/4 */ select 1 AS `1`) `__6`) `__7`) `__8`
+Note	1003	/* select#1/0 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#8/0 */ select `__8`.`1` AS `1` from (/* select#2/1 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#7/1 */ select `__7`.`1` AS `1` from (/* select#3/2 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#6/2 */ select `__6`.`1` AS `1` from (/* select#4/3 Filter Select: select `1` AS `1` */ select 1 AS `1` union /* select#5/3 */ select 1 AS `1`) `__6`) `__7`) `__8`
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 75059bc..0d39a4d 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -756,7 +756,7 @@ void LEX::start(THD *thd_arg)
   name= null_clex_str;
   event_parse_data= NULL;
   profile_options= PROFILE_NONE;
-  nest_level=0 ;
+  nest_level= 0;
   builtin_select.nest_level_base= &unit;
   allow_sum_func= 0;
   in_sum_func= NULL;
@@ -7854,7 +7854,7 @@ bool st_select_lex::check_parameters(SELECT_LEX *main_select)
   if ((options & OPTION_INTO_CLAUSE) &&
        (!parent_lex->selects_allow_into ||
         next_select() != NULL ||
-        nest_level != 1))
+        nest_level != 0))
   {
     my_error(ER_CANT_USE_OPTION_HERE, MYF(0), "INTO");
     DBUG_RETURN(TRUE);
@@ -7865,7 +7865,7 @@ bool st_select_lex::check_parameters(SELECT_LEX *main_select)
     if (!parent_lex->selects_allow_procedure ||
         next_select() != NULL ||
         this != master_unit()->first_select() ||
-        nest_level != 1)
+        nest_level != 0)
     {
       my_error(ER_CANT_USE_OPTION_HERE, MYF(0), "PROCEDURE");
       DBUG_RETURN(TRUE);
@@ -7953,7 +7953,7 @@ bool st_select_lex_unit::check_parameters(SELECT_LEX *main_select)
 
 bool LEX::check_main_unit_semantics()
 {
-  if (unit.set_nest_level(1) ||
+  if (unit.set_nest_level(0) ||
       unit.check_parameters(first_select_lex()))
     return TRUE;
   return FALSE;


More information about the commits mailing list