List:Commits« Previous MessageNext Message »
From:Gleb Shchepa Date:April 9 2009 8:34pm
Subject:bzr commit into mysql-5.0-bugteam branch (gshchepa:2727) Bug#41156
View as plain text  
#At file:///work/bzr/41156-5.0/ based on revid:davi.arnaut@stripped

 2727 Gleb Shchepa	2009-04-10
      Bug #41156: List of derived tables acts like a chain of
                  mutually-nested subqueries
      
      Queries of the form
      
        SELECT * FROM (SELECT 1) AS t1,
                      (SELECT 2) AS t2,...
                      (SELECT 32) AS t32
      
      caused the "Too high level of nesting for select" error 
      as if the query has a form 
      
        SELECT * FROM (SELECT 1 FROM (SELECT 2 FROM (SELECT 3 FROM... 
      
      
      The table_factor parser rule has been modified to adjust
      the LEX::nest_level variable value after every derived table.
      modified:
        mysql-test/r/derived.result
        mysql-test/t/derived.test
        sql/sql_yacc.yy

per-file messages:
  mysql-test/r/derived.result
    Added test case for bug #41156.
  mysql-test/t/derived.test
    Added test case for bug #41156.
  sql/sql_yacc.yy
    Bug #41156: List of derived tables acts like a chain of
                mutually-nested subqueries
      
    The table_factor parser rule has been modified to adjust
    the LEX::nest_level variable value after every derived table.
=== modified file 'mysql-test/r/derived.result'
--- a/mysql-test/r/derived.result	2007-10-29 11:11:05 +0000
+++ b/mysql-test/r/derived.result	2009-04-09 20:34:02 +0000
@@ -383,3 +383,21 @@ select t2.* from (select * from t1) as A
 ID	DATA	FID
 drop table t1, t2;
 drop user mysqltest_1;
+# End of 4.1 tests
+SELECT 0 FROM
+(SELECT 0) t01, (SELECT 0) t02, (SELECT 0) t03, (SELECT 0) t04, (SELECT 0) t05,
+(SELECT 0) t06, (SELECT 0) t07, (SELECT 0) t08, (SELECT 0) t09, (SELECT 0) t10,
+(SELECT 0) t11, (SELECT 0) t12, (SELECT 0) t13, (SELECT 0) t14, (SELECT 0) t15,
+(SELECT 0) t16, (SELECT 0) t17, (SELECT 0) t18, (SELECT 0) t19, (SELECT 0) t20,
+(SELECT 0) t21, (SELECT 0) t22, (SELECT 0) t23, (SELECT 0) t24, (SELECT 0) t25,
+(SELECT 0) t26, (SELECT 0) t27, (SELECT 0) t28, (SELECT 0) t29, (SELECT 0) t30,
+(SELECT 0) t31, (SELECT 0) t32, (SELECT 0) t33, (SELECT 0) t34, (SELECT 0) t35,
+(SELECT 0) t36, (SELECT 0) t37, (SELECT 0) t38, (SELECT 0) t39, (SELECT 0) t40,
+(SELECT 0) t41, (SELECT 0) t42, (SELECT 0) t43, (SELECT 0) t44, (SELECT 0) t45,
+(SELECT 0) t46, (SELECT 0) t47, (SELECT 0) t48, (SELECT 0) t49, (SELECT 0) t50,
+(SELECT 0) t51, (SELECT 0) t52, (SELECT 0) t53, (SELECT 0) t54, (SELECT 0) t55,
+(SELECT 0) t56, (SELECT 0) t57, (SELECT 0) t58, (SELECT 0) t59, (SELECT 0) t60,
+(SELECT 0) t61;
+0
+0
+# End of 5.0 tests

=== modified file 'mysql-test/t/derived.test'
--- a/mysql-test/t/derived.test	2007-10-29 11:11:05 +0000
+++ b/mysql-test/t/derived.test	2009-04-09 20:34:02 +0000
@@ -277,4 +277,26 @@ disconnect con1;
 connection default;
 drop user mysqltest_1;
 
-# End of 4.1 tests
+--echo # End of 4.1 tests
+
+#
+# Bug #41156: List of derived tables acts like a chain of
+#             mutually-nested subqueries
+#
+
+SELECT 0 FROM
+(SELECT 0) t01, (SELECT 0) t02, (SELECT 0) t03, (SELECT 0) t04, (SELECT 0) t05,
+(SELECT 0) t06, (SELECT 0) t07, (SELECT 0) t08, (SELECT 0) t09, (SELECT 0) t10,
+(SELECT 0) t11, (SELECT 0) t12, (SELECT 0) t13, (SELECT 0) t14, (SELECT 0) t15,
+(SELECT 0) t16, (SELECT 0) t17, (SELECT 0) t18, (SELECT 0) t19, (SELECT 0) t20,
+(SELECT 0) t21, (SELECT 0) t22, (SELECT 0) t23, (SELECT 0) t24, (SELECT 0) t25,
+(SELECT 0) t26, (SELECT 0) t27, (SELECT 0) t28, (SELECT 0) t29, (SELECT 0) t30,
+(SELECT 0) t31, (SELECT 0) t32, (SELECT 0) t33, (SELECT 0) t34, (SELECT 0) t35,
+(SELECT 0) t36, (SELECT 0) t37, (SELECT 0) t38, (SELECT 0) t39, (SELECT 0) t40,
+(SELECT 0) t41, (SELECT 0) t42, (SELECT 0) t43, (SELECT 0) t44, (SELECT 0) t45,
+(SELECT 0) t46, (SELECT 0) t47, (SELECT 0) t48, (SELECT 0) t49, (SELECT 0) t50,
+(SELECT 0) t51, (SELECT 0) t52, (SELECT 0) t53, (SELECT 0) t54, (SELECT 0) t55,
+(SELECT 0) t56, (SELECT 0) t57, (SELECT 0) t58, (SELECT 0) t59, (SELECT 0) t60,
+(SELECT 0) t61; # 61 == MAX_TABLES
+
+--echo # End of 5.0 tests

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2009-04-03 19:11:54 +0000
+++ b/sql/sql_yacc.yy	2009-04-09 20:34:02 +0000
@@ -6783,6 +6783,7 @@ table_factor:
 	  }
           else
             $$= $3;
+	  Lex->nest_level--;
 	}
         ;
 

Thread
bzr commit into mysql-5.0-bugteam branch (gshchepa:2727) Bug#41156Gleb Shchepa9 Apr