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
e99da54f
Commit
e99da54f
authored
Apr 08, 2005
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed BUG#7299: Stored procedures: exception handler catches not-found conditions
parent
b950bc21
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
2 deletions
+37
-2
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+13
-0
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+22
-0
sql/sp_rcontext.cc
sql/sp_rcontext.cc
+2
-2
No files found.
mysql-test/r/sp-error.result
View file @
e99da54f
...
...
@@ -513,4 +513,17 @@ call bug9566()|
ERROR HY000: Table 'proc' was not locked with LOCK TABLES
unlock tables|
drop procedure bug9566|
drop procedure if exists bug7299|
create procedure bug7299()
begin
declare v int;
declare c cursor for select val from t1;
declare exit handler for sqlexception select 'Error!';
open c;
fetch c into v;
end|
delete from t1|
call bug7299()|
ERROR 02000: No data to FETCH
drop procedure bug7299|
drop table t1|
mysql-test/t/sp-error.test
View file @
e99da54f
...
...
@@ -720,6 +720,28 @@ unlock tables|
drop
procedure
bug9566
|
#
# BUG#7299: Stored procedures: exception handler catches not-found conditions
#
--
disable_warnings
drop
procedure
if
exists
bug7299
|
--
enable_warnings
create
procedure
bug7299
()
begin
declare
v
int
;
declare
c
cursor
for
select
val
from
t1
;
declare
exit
handler
for
sqlexception
select
'Error!'
;
open
c
;
fetch
c
into
v
;
end
|
delete
from
t1
|
--
error
ER_SP_FETCH_NO_DATA
call
bug7299
()
|
drop
procedure
bug7299
|
#
# BUG#NNNN: New bug synopsis
#
...
...
sql/sp_rcontext.cc
View file @
e99da54f
...
...
@@ -95,8 +95,8 @@ sp_rcontext::find_handler(uint sql_errno,
found
=
i
;
break
;
case
sp_cond_type_t
:
:
exception
:
if
((
sqlstate
[
0
]
!=
'0'
||
sqlstate
[
1
]
>
'2'
||
level
==
MYSQL_ERROR
::
WARN_LEVEL_ERROR
)
&&
if
((
sqlstate
[
0
]
!=
'0'
||
sqlstate
[
1
]
>
'2'
)
&&
level
==
MYSQL_ERROR
::
WARN_LEVEL_ERROR
&&
(
found
<
0
||
m_handler
[
found
].
cond
->
type
>
sp_cond_type_t
::
state
))
found
=
i
;
break
;
...
...
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