summaryrefslogtreecommitdiff
path: root/sql/sql_error.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-04-05 00:32:48 +0300
committerunknown <monty@mysql.com>2005-04-05 00:32:48 +0300
commit7d8f291607e6b651f6f9e46fea5e9cc0a7a96bff (patch)
tree47a17106234067aa3cb031e4d92f9f332e28ce59 /sql/sql_error.cc
parentaaa8524233d6bc1f04761c50086fd209bb38731e (diff)
downloadmariadb-git-7d8f291607e6b651f6f9e46fea5e9cc0a7a96bff.tar.gz
Now one gets an error if one tries to insert an invalid value via a stored procedure in STRICT mode. (Bug #5907)
client/mysqldump.c: Changed some function and variable names to MySQL syntax Fixed indentation for last few pushes (No logic changes) mysql-test/r/strict.result: Test for bug #5907 (Traditional mode: invalid value can be inserted via a stored procedure) mysql-test/t/strict.test: Test for bug #5907 (Traditional mode: invalid value can be inserted via a stored procedure) sql/sql_base.cc: More comments sql/sql_error.cc: Ensure that PS gives error for invalid values in 'strict' mode
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)
{
/*