#At file:///export/home/tmp/mysql/bug15866/ based on revid:staale.smedseng@stripped
2790 Bernt M. Johnsen 2009-07-02
Bug#15866 1) Move the cursor close to after the recursive call. 2) Change to just one call with recursion depth 4.
modified:
mysql-test/r/sp-fib.result
mysql-test/t/sp-fib.test
=== modified file 'mysql-test/r/sp-fib.result'
--- a/mysql-test/r/sp-fib.result 2009-06-04 11:38:53 +0000
+++ b/mysql-test/r/sp-fib.result 2009-07-02 12:27:56 +0000
@@ -10,24 +10,17 @@ declare c cursor for select f from t3 or
open c;
fetch c into y;
fetch c into x;
-close c;
insert into t3 values (x+y);
call fib(n-1);
+## Close the cursor AFTER the recursion to ensure that the stack
+## frame is somewhat intact.
+close c;
end;
end if;
end|
set @@max_sp_recursion_depth= 20|
insert into t3 values (0), (1)|
-call fib(3)|
-select * from t3 order by f asc|
-f
-0
-1
-1
-2
-delete from t3|
-insert into t3 values (0), (1)|
-call fib(10)|
+call fib(4)|
select * from t3 order by f asc|
f
0
@@ -35,12 +28,6 @@ f
1
2
3
-5
-8
-13
-21
-34
-55
drop table t3|
drop procedure fib|
set @@max_sp_recursion_depth= 0|
=== modified file 'mysql-test/t/sp-fib.test'
--- a/mysql-test/t/sp-fib.test 2009-06-04 11:38:53 +0000
+++ b/mysql-test/t/sp-fib.test 2009-07-02 12:27:56 +0000
@@ -26,9 +26,11 @@ begin
open c;
fetch c into y;
fetch c into x;
- close c;
insert into t3 values (x+y);
call fib(n-1);
+ ## Close the cursor AFTER the recursion to ensure that the stack
+ ## frame is somewhat intact.
+ close c;
end;
end if;
end|
@@ -36,24 +38,14 @@ end|
# Enable recursion
set @@max_sp_recursion_depth= 20|
-# Minimum test: recursion of 3 levels
+# 4 recuursion levels should be sufficient
insert into t3 values (0), (1)|
-call fib(3)|
+call fib(4)|
select * from t3 order by f asc|
-delete from t3|
-
-# The original test, 20 levels, ran into memory limits on some machines
-# and builds. Try 10 instead...
-
-insert into t3 values (0), (1)|
-
-call fib(10)|
-
-select * from t3 order by f asc|
drop table t3|
drop procedure fib|
set @@max_sp_recursion_depth= 0|
Attachment: [text/bzr-bundle] bzr/bernt.johnsen@sun.com-20090702122756-5sndwcqkk30oi59w.bundle
| Thread |
|---|
| • bzr commit into mysql-5.0-bugteam branch (bernt.johnsen:2790) Bug#15866 | Bernt M. Johnsen | 2 Jul |