mirror of
https://github.com/MariaDB/server.git
synced 2026-05-05 06:35:33 +02:00
Now one gets an error if one tries to insert an invalid value via a stored procedure in STRICT mode. (Bug #5907)
This commit is contained in:
parent
04f8e164fb
commit
1be0a0c82a
5 changed files with 105 additions and 66 deletions
|
|
@ -116,6 +116,27 @@ 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;
|
||||
|
||||
/* Abort if we are using strict mode and we are not using IGNORE */
|
||||
if ((int) level >= (int) MYSQL_ERROR::WARN_LEVEL_WARN &&
|
||||
thd->really_abort_on_warning())
|
||||
{
|
||||
/* 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 >=
|
||||
|
|
@ -126,20 +147,6 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level 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 &&
|
||||
thd->really_abort_on_warning())
|
||||
{
|
||||
/* Avoid my_message() calling push_warning */
|
||||
bool no_warnings_for_error= thd->no_warnings_for_error;
|
||||
thd->no_warnings_for_error= 1;
|
||||
thd->killed= THD::KILL_BAD_DATA;
|
||||
my_message(code, msg, MYF(0));
|
||||
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->warn_list.elements < thd->variables.max_error_count)
|
||||
{
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue