summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorpem@mysql.com <>2005-10-17 15:07:47 +0200
committerpem@mysql.com <>2005-10-17 15:07:47 +0200
commite58531570371b640e963d01e5714b636e7bad82b (patch)
treed16ca31453be37d53895be07584765b1337a6698 /sql/protocol.cc
parent6a88684eb3580bbf23815c87abb4e027283e1474 (diff)
downloadmariadb-git-e58531570371b640e963d01e5714b636e7bad82b.tar.gz
Additional fix for BUG#7049, after review.
Make sure "select" aborts when finding a SP condition handler beyond the current scope.
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index ade94a483a8..8c3e5a62820 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -76,6 +76,8 @@ void net_send_error(THD *thd, uint sql_errno, const char *err)
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 @@ net_printf_error(THD *thd, uint errcode, ...)
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