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
df553710
Commit
df553710
authored
Nov 28, 2005
by
pem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/usr/home/pem/bug14643/mysql-5.0
parents
1263105c
718f8374
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
0 deletions
+98
-0
mysql-test/r/sp.result
mysql-test/r/sp.result
+36
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+42
-0
sql/sp_head.cc
sql/sp_head.cc
+20
-0
No files found.
mysql-test/r/sp.result
View file @
df553710
...
...
@@ -4010,4 +4010,40 @@ s1
2
drop procedure bug13729|
drop table t3|
drop procedure if exists bug14643_1|
drop procedure if exists bug14643_2|
create procedure bug14643_1()
begin
declare continue handler for sqlexception select 'boo' as 'Handler';
begin
declare v int default x;
if v = 1 then
select 1;
else
select 2;
end if;
end;
end|
create procedure bug14643_2()
begin
declare continue handler for sqlexception select 'boo' as 'Handler';
case x
when 1 then
select 1;
else
select 2;
end case;
end|
call bug14643_1()|
Handler
boo
2
2
call bug14643_2()|
Handler
boo
2
2
drop procedure bug14643_1|
drop procedure bug14643_2|
drop table t1,t2;
mysql-test/t/sp.test
View file @
df553710
...
...
@@ -4781,6 +4781,48 @@ select * from t3|
drop
procedure
bug13729
|
drop
table
t3
|
#
# BUG#14643: Stored Procedure: Continuing after failed var. initialization
# crashes server.
#
--
disable_warnings
drop
procedure
if
exists
bug14643_1
|
drop
procedure
if
exists
bug14643_2
|
--
enable_warnings
create
procedure
bug14643_1
()
begin
declare
continue
handler
for
sqlexception
select
'boo'
as
'Handler'
;
begin
declare
v
int
default
x
;
if
v
=
1
then
select
1
;
else
select
2
;
end
if
;
end
;
end
|
create
procedure
bug14643_2
()
begin
declare
continue
handler
for
sqlexception
select
'boo'
as
'Handler'
;
case
x
when
1
then
select
1
;
else
select
2
;
end
case
;
end
|
call
bug14643_1
()
|
call
bug14643_2
()
|
drop
procedure
bug14643_1
|
drop
procedure
bug14643_2
|
#
# BUG#NNNN: New bug synopsis
...
...
sql/sp_head.cc
View file @
df553710
...
...
@@ -2209,6 +2209,26 @@ sp_instr_set::exec_core(THD *thd, uint *nextp)
{
int
res
=
thd
->
spcont
->
set_item_eval
(
thd
,
m_offset
,
&
m_value
,
m_type
);
if
(
res
<
0
&&
thd
->
spcont
->
get_item
(
m_offset
)
==
NULL
&&
thd
->
spcont
->
found_handler_here
())
{
/*
Failed to evaluate the value, the variable is still not initialized,
and a handler has been found. Set to null so we can continue.
*/
Item
*
it
=
new
Item_null
();
if
(
!
it
||
thd
->
spcont
->
set_item_eval
(
thd
,
m_offset
,
&
it
,
m_type
)
<
0
)
{
/* If this also failed, we have to abort */
sp_rcontext
*
spcont
=
thd
->
spcont
;
thd
->
spcont
=
0
;
/* Avoid handlers */
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
));
spcont
->
clear_handler
();
thd
->
spcont
=
spcont
;
}
}
*
nextp
=
m_ip
+
1
;
return
res
;
}
...
...
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