List:Internals« Previous MessageNext Message »
From:pem Date:October 17 2005 3:44pm
Subject:bk commit into 5.0 tree (pem:1.2003) BUG#7049
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of pem. When pem does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2003 05/10/17 15:07:47 pem@stripped +5 -0
  Additional fix for BUG#7049, after review.
  Make sure "select" aborts when finding a SP condition handler beyond the current scope.

  sql/sql_error.cc
    1.36 05/10/17 15:07:23 pem@stripped +2 -0
    Make sure "select" aborts when finding a SP condition handler beyond the current
scope.

  sql/sp_rcontext.h
    1.27 05/10/17 15:07:23 pem@stripped +7 -0
    Added method for checking if the handler was found in the current context.

  sql/protocol.cc
    1.109 05/10/17 15:07:23 pem@stripped +4 -0
    Make sure "select" aborts when finding a SP condition handler beyond the current
scope.

  sql/mysqld.cc
    1.513 05/10/17 15:07:22 pem@stripped +2 -0
    Make sure "select" aborts when finding a SP condition handler beyond the current
scope.

  mysql-test/r/sp.result
    1.163 05/10/17 15:07:22 pem@stripped +0 -2
    Updated test results after fixing error handling in select.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	pem
# Host:	mysql.comhem.se
# Root:	/home/pem/work/bug7049/mysql-5.0

--- 1.512/sql/mysqld.cc	2005-10-12 10:17:29 +02:00
+++ 1.513/sql/mysqld.cc	2005-10-17 15:07:22 +02:00
@@ -2342,6 +2342,8 @@
     if (thd->spcont &&
         thd->spcont->find_handler(error, MYSQL_ERROR::WARN_LEVEL_ERROR))
     {
+      if (! thd->spcont->found_handler_here())
+        thd->net.report_error= 1; /* Make "select" abort correctly */ 
       DBUG_RETURN(0);
     }
 

--- 1.108/sql/protocol.cc	2005-06-30 14:17:05 +02:00
+++ 1.109/sql/protocol.cc	2005-10-17 15:07:23 +02:00
@@ -76,6 +76,8 @@
   if (thd->spcont && thd->spcont->find_handler(sql_errno,
                                                MYSQL_ERROR::WARN_LEVEL_ERROR))
   {
+    if (! thd->spcont->found_handler_here())
+      thd->net.report_error= 1; /* Make "select" abort correctly */ 
     DBUG_VOID_RETURN;
   }
   thd->query_error=  1; // needed to catch query errors during replication
@@ -181,6 +183,8 @@
   if (thd->spcont && thd->spcont->find_handler(errcode,
                                                MYSQL_ERROR::WARN_LEVEL_ERROR))
   {
+    if (! thd->spcont->found_handler_here())
+      thd->net.report_error= 1; /* Make "select" abort correctly */ 
     DBUG_VOID_RETURN;
   }
   thd->query_error=  1; // needed to catch query errors during replication

--- 1.162/mysql-test/r/sp.result	2005-10-11 15:57:17 +02:00
+++ 1.163/mysql-test/r/sp.result	2005-10-17 15:07:22 +02:00
@@ -3310,7 +3310,6 @@
 1
 call bug12379_1()|
 bug12379()
-NULL
 42
 42
 select 2|
@@ -3318,7 +3317,6 @@
 2
 call bug12379_2()|
 bug12379()
-NULL
 select 3|
 3
 3

--- 1.26/sql/sp_rcontext.h	2005-09-26 18:46:25 +02:00
+++ 1.27/sql/sp_rcontext.h	2005-10-17 15:07:23 +02:00
@@ -149,6 +149,13 @@
     return m_handler[m_hfound].type;
   }
 
+  // Returns true if we found a handler in this context
+  inline bool
+  found_handler_here()
+  {
+    return (m_hfound >= 0);
+  }
+
   // Clears the handler find state
   inline void
   clear_handler()

--- 1.35/sql/sql_error.cc	2005-07-05 10:38:02 +02:00
+++ 1.36/sql/sql_error.cc	2005-10-17 15:07:23 +02:00
@@ -144,6 +144,8 @@
                                  thd->really_abort_on_warning()) ?
                                 MYSQL_ERROR::WARN_LEVEL_ERROR : level))
   {
+    if (! thd->spcont->found_handler_here())
+      thd->net.report_error= 1; /* Make "select" abort correctly */ 
     DBUG_RETURN(NULL);
   }
   query_cache_abort(&thd->net);
Thread
bk commit into 5.0 tree (pem:1.2003) BUG#7049pem17 Oct