Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
1541f2e7
Commit
1541f2e7
authored
Apr 06, 2004
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed BUG#2780: Stored procedure exit handler ignored for warnings.
Actually catch pushed warnings.
parent
4a6e6251
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
mysql-test/r/sp.result
mysql-test/r/sp.result
+22
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+26
-0
sql/sql_error.cc
sql/sql_error.cc
+4
-0
No files found.
mysql-test/r/sp.result
View file @
1541f2e7
...
...
@@ -1044,6 +1044,28 @@ select @x|
42
drop procedure bug2776_1|
drop procedure bug2776_2|
drop table if exists t3|
create table t3 (s1 smallint)|
insert into t3 values (123456789012)|
Warnings:
Warning 1263 Data truncated, out of range for column 's1' at row 1
create procedure bug2780()
begin
declare exit handler for sqlwarning set @x = 1;
set @x = 0;
insert into t3 values (123456789012);
insert into t3 values (0);
end|
call bug2780()|
select @x|
@x
1
select * from t3|
s1
32767
32767
drop procedure bug2780|
drop table t3|
drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
create procedure ifac(n int unsigned)
...
...
mysql-test/t/sp.test
View file @
1541f2e7
...
...
@@ -1215,6 +1215,32 @@ select @x|
drop
procedure
bug2776_1
|
drop
procedure
bug2776_2
|
#
# BUG#2780
#
--
disable_warnings
drop
table
if
exists
t3
|
--
enable_warnings
create
table
t3
(
s1
smallint
)
|
insert
into
t3
values
(
123456789012
)
|
create
procedure
bug2780
()
begin
declare
exit
handler
for
sqlwarning
set
@
x
=
1
;
set
@
x
=
0
;
insert
into
t3
values
(
123456789012
);
insert
into
t3
values
(
0
);
end
|
call
bug2780
()
|
select
@
x
|
select
*
from
t3
|
drop
procedure
bug2780
|
drop
table
t3
|
#
# Some "real" examples
...
...
sql/sql_error.cc
View file @
1541f2e7
...
...
@@ -43,6 +43,7 @@ This file contains the implementation of error and warnings related
***********************************************************************/
#include "mysql_priv.h"
#include "sp_rcontext.h"
/*
Store a new message in an error object
...
...
@@ -108,6 +109,9 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
MYSQL_ERROR
*
err
=
NULL
;
if
(
thd
->
spcont
&&
thd
->
spcont
->
find_handler
(
code
))
DBUG_RETURN
(
NULL
);
if
(
thd
->
warn_list
.
elements
<
thd
->
variables
.
max_error_count
)
{
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment