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
2af86eaf
Commit
2af86eaf
authored
Feb 25, 2005
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed BUG#8757: Stored Procedures: Scope of Begin and End Statements do not work properly.
parent
e3f286a0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
1 deletion
+68
-1
mysql-test/r/sp.result
mysql-test/r/sp.result
+30
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+37
-0
sql/sp_pcontext.cc
sql/sp_pcontext.cc
+1
-1
No files found.
mysql-test/r/sp.result
View file @
2af86eaf
...
@@ -2174,6 +2174,36 @@ end if;
...
@@ -2174,6 +2174,36 @@ end if;
select plus;
select plus;
end|
end|
drop procedure bug6857|
drop procedure bug6857|
drop procedure if exists bug8757|
create procedure bug8757()
begin
declare x int;
declare c1 cursor for select data from t1 limit 1;
begin
declare y int;
declare c2 cursor for select i from t2 limit 1;
open c2;
fetch c2 into y;
close c2;
select 2,y;
end;
open c1;
fetch c1 into x;
close c1;
select 1,x;
end|
delete from t1|
delete from t2|
insert into t1 values ("x", 1)|
insert into t2 values ("y", 2, 0.0)|
call bug8757()|
2 y
2 2
1 x
1 1
delete from t1|
delete from t2|
drop procedure bug8757|
drop table if exists fac|
drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
drop procedure if exists ifac|
drop procedure if exists ifac|
...
...
mysql-test/t/sp.test
View file @
2af86eaf
...
@@ -2676,6 +2676,43 @@ end|
...
@@ -2676,6 +2676,43 @@ end|
drop
procedure
bug6857
|
drop
procedure
bug6857
|
#
# BUG#8757: Stored Procedures: Scope of Begin and End Statements do not
# work properly.
--
disable_warnings
drop
procedure
if
exists
bug8757
|
--
enable_warnings
create
procedure
bug8757
()
begin
declare
x
int
;
declare
c1
cursor
for
select
data
from
t1
limit
1
;
begin
declare
y
int
;
declare
c2
cursor
for
select
i
from
t2
limit
1
;
open
c2
;
fetch
c2
into
y
;
close
c2
;
select
2
,
y
;
end
;
open
c1
;
fetch
c1
into
x
;
close
c1
;
select
1
,
x
;
end
|
delete
from
t1
|
delete
from
t2
|
insert
into
t1
values
(
"x"
,
1
)
|
insert
into
t2
values
(
"y"
,
2
,
0.0
)
|
call
bug8757
()
|
delete
from
t1
|
delete
from
t2
|
drop
procedure
bug8757
|
#
#
# Some "real" examples
# Some "real" examples
...
...
sql/sp_pcontext.cc
View file @
2af86eaf
...
@@ -264,7 +264,7 @@ sp_pcontext::find_cursor(LEX_STRING *name, uint *poff, my_bool scoped)
...
@@ -264,7 +264,7 @@ sp_pcontext::find_cursor(LEX_STRING *name, uint *poff, my_bool scoped)
(
const
uchar
*
)
name
->
str
,
name
->
length
,
(
const
uchar
*
)
name
->
str
,
name
->
length
,
(
const
uchar
*
)
n
.
str
,
n
.
length
)
==
0
)
(
const
uchar
*
)
n
.
str
,
n
.
length
)
==
0
)
{
{
*
poff
=
i
;
*
poff
=
m_coffset
+
i
;
return
TRUE
;
return
TRUE
;
}
}
}
}
...
...
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