1
drop table if exists t3;
2
create table t3 ( f bigint unsigned not null );
3
drop procedure if exists fib;
4
create procedure fib(n int unsigned)
8
declare x, y bigint unsigned;
9
declare c cursor for select f from t3 order by f desc limit 2;
13
insert into t3 values (x+y);
15
## Close the cursor AFTER the recursion to ensure that the stack
16
## frame is somewhat intact.
21
set @@max_sp_recursion_depth= 20|
22
insert into t3 values (0), (1)|
24
select * from t3 order by f asc|
33
set @@max_sp_recursion_depth= 0|