Commit 4ade7693 authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/home/my/mysql-5.0

parents 1b932713 ae25f8df
This diff is collapsed.
......@@ -1173,4 +1173,16 @@ col1
0000-00-00 00:00:00
NULL
drop table t1;
create table t1 (col1 tinyint);
drop procedure if exists t1;
Warnings:
Note 1305 PROCEDURE t1 does not exist
create procedure t1 () begin declare exit handler for sqlexception
select'a'; insert into t1 values (200); end;|
call t1();
ERROR 22003: Out of range value adjusted for column 'col1' at row 1
select * from t1;
col1
drop procedure t1;
drop table t1;
set sql_mode=@org_mode;
......@@ -1031,6 +1031,21 @@ insert into t1 select * from t1;
select * from t1;
drop table t1;
#
# Test of inserting an invalid value via a stored procedure (Bug #5907)
#
create table t1 (col1 tinyint);
drop procedure if exists t1;
delimiter |;
create procedure t1 () begin declare exit handler for sqlexception
select'a'; insert into t1 values (200); end;|
delimiter ;|
--error 1264
call t1();
select * from t1;
drop procedure t1;
drop table t1;
#
# Restore mode
#
......
......@@ -692,11 +692,11 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table,
/*
Test that table is unique
Test that table is unique (It's only exists once in the table list)
SYNOPSIS
unique_table()
table table which should be chaked
table table which should be checked
table_list list of tables
NOTE: to exclude derived tables from check we use following mechanism:
......
......@@ -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)
{
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment