List:Commits« Previous MessageNext Message »
From:Alexey Botchkov Date:September 30 2008 6:09am
Subject:bzr push into mysql-5.1 branch (holyfoot:2746)
View as plain text  
 2746 Alexey Botchkov	2008-09-30 [merge]
      merging
modified:
  mysql-test/r/sp-error.result
  mysql-test/t/sp-error.test
  sql/sp_head.cc

=== modified file 'mysql-test/r/sp-error.result'
--- a/mysql-test/r/sp-error.result	2008-07-03 19:41:22 +0000
+++ b/mysql-test/r/sp-error.result	2008-09-30 05:41:30 +0000
@@ -1628,6 +1628,13 @@ end loop label1;
 end loop;
 end|
 ERROR 42000: End-label label1 without match
+CREATE TABLE t1 (a INT)|
+INSERT INTO t1 VALUES (1),(2)|
+CREATE PROCEDURE p1(a INT) BEGIN END|
+CALL p1((SELECT * FROM t1))|
+ERROR 21000: Subquery returns more than 1 row
+DROP PROCEDURE IF EXISTS p1|
+DROP TABLE t1|
 drop procedure if exists p1;
 create procedure p1()
 begin

=== modified file 'mysql-test/t/sp-error.test'
--- a/mysql-test/t/sp-error.test	2008-07-03 19:41:22 +0000
+++ b/mysql-test/t/sp-error.test	2008-09-30 05:41:30 +0000
@@ -2362,6 +2362,14 @@ begin
     end loop;
 end|
 
+CREATE TABLE t1 (a INT)|
+INSERT INTO t1 VALUES (1),(2)|
+CREATE PROCEDURE p1(a INT) BEGIN END|
+--error ER_SUBQUERY_NO_1_ROW
+CALL p1((SELECT * FROM t1))|
+DROP PROCEDURE IF EXISTS p1|
+DROP TABLE t1|
+
 delimiter ;|
 
 #

=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc	2008-08-11 22:44:13 +0000
+++ b/sql/sp_head.cc	2008-09-30 05:41:30 +0000
@@ -1940,7 +1940,11 @@ sp_head::execute_procedure(THD *thd, Lis
       we'll leave it here.
     */
     if (!thd->in_sub_stmt)
-      close_thread_tables(thd);
+    {
+      thd->lex->unit.cleanup();
+      close_thread_tables(thd);            
+      thd->rollback_item_tree_changes();
+    }
 
     DBUG_PRINT("info",(" %.*s: eval args done",
                        (int) m_name.length, m_name.str));

Thread
bzr push into mysql-5.1 branch (holyfoot:2746) Alexey Botchkov30 Sep