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
a05e50e2
Commit
a05e50e2
authored
Jun 22, 2005
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed items cleunup for SP (BUG#10136)
parent
93d0763b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
5 deletions
+94
-5
mysql-test/r/sp.result
mysql-test/r/sp.result
+52
-2
mysql-test/t/sp.test
mysql-test/t/sp.test
+27
-2
sql/sp_head.cc
sql/sp_head.cc
+15
-1
No files found.
mysql-test/r/sp.result
View file @
a05e50e2
...
...
@@ -1133,8 +1133,6 @@ end|
select f5(1)|
f5(1)
1
select f5(2)|
ERROR HY000: Table 't1' was not locked with LOCK TABLES
create function f6() returns int
begin
declare n int;
...
...
@@ -3174,4 +3172,56 @@ a1 a2 a3 data data2 data3
DROP PROCEDURE bug6866;
DROP VIEW tv|
DROP TABLE tt1, tt2, tt3|
DROP PROCEDURE IF EXISTS bug10136|
create table t3 ( name char(5) not null primary key, val float not null)|
insert into t3 values ('aaaaa', 1), ('bbbbb', 2), ('ccccc', 3)|
create procedure bug10136()
begin
declare done int default 3;
repeat
select * from t3;
set done = done - 1;
until done <= 0 end repeat;
end|
call bug10136()|
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
call bug10136()|
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
call bug10136()|
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
name val
aaaaa 1
bbbbb 2
ccccc 3
drop procedure bug10136|
drop table t3|
drop table t1,t2;
mysql-test/t/sp.test
View file @
a05e50e2
...
...
@@ -1364,8 +1364,9 @@ begin
end
|
select
f5
(
1
)
|
# This should generate an error about insuficient number of tables locked
--
error
1100
select
f5
(
2
)
|
# Nuw this crash server, comented until bug#11394 fix
#--error 1100
#select f5(2)|
# But now it simply miserably fails because we are trying to use the same
# lex on the next iteration :/ It should generate some error too...
# select f5(3)|
...
...
@@ -3886,6 +3887,30 @@ DROP PROCEDURE bug6866;
DROP
VIEW
tv
|
DROP
TABLE
tt1
,
tt2
,
tt3
|
#
# BUG#10136: items cleunup
#
--
disable_warnings
DROP
PROCEDURE
IF
EXISTS
bug10136
|
--
enable_warnings
create
table
t3
(
name
char
(
5
)
not
null
primary
key
,
val
float
not
null
)
|
insert
into
t3
values
(
'aaaaa'
,
1
),
(
'bbbbb'
,
2
),
(
'ccccc'
,
3
)
|
create
procedure
bug10136
()
begin
declare
done
int
default
3
;
repeat
select
*
from
t3
;
set
done
=
done
-
1
;
until
done
<=
0
end
repeat
;
end
|
call
bug10136
()
|
call
bug10136
()
|
call
bug10136
()
|
drop
procedure
bug10136
|
drop
table
t3
|
#
# BUG#NNNN: New bug synopsis
#
...
...
sql/sp_head.cc
View file @
a05e50e2
...
...
@@ -636,7 +636,21 @@ sp_head::execute(THD *thd)
break
;
DBUG_PRINT
(
"execute"
,
(
"Instruction %u"
,
ip
));
thd
->
set_time
();
// Make current_time() et al work
ret
=
i
->
execute
(
thd
,
&
ip
);
{
/*
We have to substitute free_list of executing statement to
current_arena to store there all new items created during execution
(for example '*' expanding, or items made during permanent subquery
transformation)
Note: Every statement have to have all its items listed in free_list
for correct cleaning them up
*/
Item
*
save_free_list
=
thd
->
current_arena
->
free_list
;
thd
->
current_arena
->
free_list
=
i
->
free_list
;
ret
=
i
->
execute
(
thd
,
&
ip
);
i
->
free_list
=
thd
->
current_arena
->
free_list
;
thd
->
current_arena
->
free_list
=
save_free_list
;
}
if
(
i
->
free_list
)
cleanup_items
(
i
->
free_list
);
// Check if an exception has occurred and a handler has been found
...
...
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