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
e39656fb
Commit
e39656fb
authored
Aug 19, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into mysql.com:/home/timka/mysql/src/5.0-2486
parents
f887aec2
276bd123
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
134 additions
and
4 deletions
+134
-4
mysql-test/r/sp.result
mysql-test/r/sp.result
+66
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+66
-0
sql/sp_head.cc
sql/sp_head.cc
+2
-2
sql/sp_head.h
sql/sp_head.h
+0
-2
No files found.
mysql-test/r/sp.result
View file @
e39656fb
...
...
@@ -3100,4 +3100,70 @@ end|
call p_bug11247(10)|
drop function f_bug11247|
drop procedure p_bug11247|
drop procedure if exists bug12168|
drop table if exists t1, t2|
create table t1 (a int)|
insert into t1 values (1),(2),(3),(4)|
create table t2 (a int)|
create procedure bug12168(arg1 char(1))
begin
declare b, c integer;
if arg1 = 'a' then
begin
declare c1 cursor for select a from t1 where a % 2;
declare continue handler for not found set b = 1;
set b = 0;
open c1;
c1_repeat: repeat
fetch c1 into c;
if (b = 1) then
leave c1_repeat;
end if;
insert into t2 values (c);
until b = 1
end repeat;
end;
end if;
if arg1 = 'b' then
begin
declare c2 cursor for select a from t1 where not a % 2;
declare continue handler for not found set b = 1;
set b = 0;
open c2;
c2_repeat: repeat
fetch c2 into c;
if (b = 1) then
leave c2_repeat;
end if;
insert into t2 values (c);
until b = 1
end repeat;
end;
end if;
end|
call bug12168('a')|
select * from t2|
a
1
3
truncate t2|
call bug12168('b')|
select * from t2|
a
2
4
truncate t2|
call bug12168('a')|
select * from t2|
a
1
3
truncate t2|
call bug12168('b')|
select * from t2|
a
2
4
truncate t2|
drop procedure if exists bug12168|
drop table t1,t2;
mysql-test/t/sp.test
View file @
e39656fb
...
...
@@ -3928,6 +3928,72 @@ end|
call
p_bug11247
(
10
)
|
drop
function
f_bug11247
|
drop
procedure
p_bug11247
|
#
# BUG#12168: "'DECLARE CONTINUE HANDLER FOR NOT FOUND ...' in conditional
# handled incorrectly"
#
--
disable_warnings
drop
procedure
if
exists
bug12168
|
drop
table
if
exists
t1
,
t2
|
--
enable_warnings
create
table
t1
(
a
int
)
|
insert
into
t1
values
(
1
),(
2
),(
3
),(
4
)
|
create
table
t2
(
a
int
)
|
create
procedure
bug12168
(
arg1
char
(
1
))
begin
declare
b
,
c
integer
;
if
arg1
=
'a'
then
begin
declare
c1
cursor
for
select
a
from
t1
where
a
%
2
;
declare
continue
handler
for
not
found
set
b
=
1
;
set
b
=
0
;
open
c1
;
c1_repeat
:
repeat
fetch
c1
into
c
;
if
(
b
=
1
)
then
leave
c1_repeat
;
end
if
;
insert
into
t2
values
(
c
);
until
b
=
1
end
repeat
;
end
;
end
if
;
if
arg1
=
'b'
then
begin
declare
c2
cursor
for
select
a
from
t1
where
not
a
%
2
;
declare
continue
handler
for
not
found
set
b
=
1
;
set
b
=
0
;
open
c2
;
c2_repeat
:
repeat
fetch
c2
into
c
;
if
(
b
=
1
)
then
leave
c2_repeat
;
end
if
;
insert
into
t2
values
(
c
);
until
b
=
1
end
repeat
;
end
;
end
if
;
end
|
call
bug12168
(
'a'
)
|
select
*
from
t2
|
truncate
t2
|
call
bug12168
(
'b'
)
|
select
*
from
t2
|
truncate
t2
|
call
bug12168
(
'a'
)
|
select
*
from
t2
|
truncate
t2
|
call
bug12168
(
'b'
)
|
select
*
from
t2
|
truncate
t2
|
drop
procedure
if
exists
bug12168
|
#
# BUG#NNNN: New bug synopsis
...
...
sql/sp_head.cc
View file @
e39656fb
...
...
@@ -1986,7 +1986,7 @@ sp_instr_hpush_jump::execute(THD *thd, uint *nextp)
sp_cond_type_t
*
p
;
while
((
p
=
li
++
))
thd
->
spcont
->
push_handler
(
p
,
m_
handler
,
m_type
,
m_frame
);
thd
->
spcont
->
push_handler
(
p
,
m_
ip
+
1
,
m_type
,
m_frame
);
*
nextp
=
m_dest
;
DBUG_RETURN
(
0
);
...
...
@@ -2003,7 +2003,7 @@ sp_instr_hpush_jump::print(String *str)
str
->
append
(
" f="
);
str
->
qs_append
(
m_frame
);
str
->
append
(
" h="
);
str
->
qs_append
(
m_
handler
);
str
->
qs_append
(
m_
ip
+
1
);
}
uint
...
...
sql/sp_head.h
View file @
e39656fb
...
...
@@ -714,7 +714,6 @@ public:
sp_instr_hpush_jump
(
uint
ip
,
sp_pcontext
*
ctx
,
int
htype
,
uint
fp
)
:
sp_instr_jump
(
ip
,
ctx
),
m_type
(
htype
),
m_frame
(
fp
)
{
m_handler
=
ip
+
1
;
m_cond
.
empty
();
}
...
...
@@ -743,7 +742,6 @@ private:
int
m_type
;
// Handler type
uint
m_frame
;
uint
m_handler
;
// Location of handler
List
<
struct
sp_cond_type
>
m_cond
;
};
// class sp_instr_hpush_jump : public sp_instr_jump
...
...
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