diff options
| author | monty@mysql.com <> | 2005-04-05 00:32:48 +0300 |
|---|---|---|
| committer | monty@mysql.com <> | 2005-04-05 00:32:48 +0300 |
| commit | 1be0a0c82a05181cd7aac52ace6167ff9939e21a (patch) | |
| tree | 47a17106234067aa3cb031e4d92f9f332e28ce59 /sql/sql_error.cc | |
| parent | 04f8e164fb4ec9c35822a44b1296c69f19ab6d2e (diff) | |
| download | mariadb-git-1be0a0c82a05181cd7aac52ace6167ff9939e21a.tar.gz | |
Now one gets an error if one tries to insert an invalid value via a stored procedure in STRICT mode. (Bug #5907)
Diffstat (limited to 'sql/sql_error.cc')
| -rw-r--r-- | sql/sql_error.cc | 25 |
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) { /* |
