summaryrefslogtreecommitdiff
path: root/sql/sql_error.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-04-05 00:33:35 +0300
committerunknown <monty@mysql.com>2005-04-05 00:33:35 +0300
commit4ade769345de717d835e3759679be0a01ec4b4c9 (patch)
tree81293117fe54f545c1a667e41be5c82eb1e1b243 /sql/sql_error.cc
parent1b93271393b58e67cb2927a82fa297a1076ce534 (diff)
parentae25f8df6ef53276d2051f193ed6e247da375e4d (diff)
downloadmariadb-git-4ade769345de717d835e3759679be0a01ec4b4c9.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r--sql/sql_error.cc25
1 files changed, 16 insertions, 9 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 281ac7169c0..c1e1afa9eeb 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -116,15 +116,6 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
if (thd->query_id != thd->warn_id)
mysql_reset_errors(thd, 0);
thd->got_warning= 1;
- if (thd->spcont &&
- thd->spcont->find_handler(code,
- ((int) level >=
- (int) MYSQL_ERROR::WARN_LEVEL_WARN &&
- thd->really_abort_on_warning()) ?
- MYSQL_ERROR::WARN_LEVEL_ERROR : level))
- {
- DBUG_RETURN(NULL);
- }
/* Abort if we are using strict mode and we are not using IGNORE */
if ((int) level >= (int) MYSQL_ERROR::WARN_LEVEL_WARN &&
@@ -132,14 +123,30 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
{
/* Avoid my_message() calling push_warning */
bool no_warnings_for_error= thd->no_warnings_for_error;
+ sp_rcontext *spcont= thd->spcont;
+
thd->no_warnings_for_error= 1;
+ thd->spcont= 0;
+
thd->killed= THD::KILL_BAD_DATA;
my_message(code, msg, MYF(0));
+
+ thd->spcont= spcont;
thd->no_warnings_for_error= no_warnings_for_error;
/* Store error in error list (as my_message() didn't do it in this case */
level= MYSQL_ERROR::WARN_LEVEL_ERROR;
}
+ if (thd->spcont &&
+ thd->spcont->find_handler(code,
+ ((int) level >=
+ (int) MYSQL_ERROR::WARN_LEVEL_WARN &&
+ thd->really_abort_on_warning()) ?
+ MYSQL_ERROR::WARN_LEVEL_ERROR : level))
+ {
+ DBUG_RETURN(NULL);
+ }
+
if (thd->warn_list.elements < thd->variables.max_error_count)
{
/*