2
# Bug #11602: SP with very large body not handled well
6
drop procedure if exists test.longprocedure;
7
drop table if exists t1;
10
create table t1 (a int);
11
insert into t1 values (1),(2),(3);
13
let $body=`select repeat('select count(*) into out1 from t1;\n', 3072)`;
17
eval select length('$body') as length//
18
eval create procedure test.longprocedure (out out1 int) deterministic
26
# this is larger than the length above, because it includes the 'begin' and
27
# 'end' bits and some whitespace
28
select length(routine_definition) from information_schema.routines where routine_schema = 'test' and routine_name = 'longprocedure';
30
call test.longprocedure(@value); select @value;
32
drop procedure test.longprocedure;
35
# Bug #9819 "Cursors: Mysql Server Crash while fetching from table with 5
37
# To really test the bug, increase the number of loop iterations ($1).
38
# For 4 millions set $1 to 22.
39
create table t1 (f1 char(100) , f2 mediumint , f3 int , f4 real, f5 numeric);
40
insert into t1 (f1, f2, f3, f4, f5) values
41
("This is a test case for for Bug#9819", 1, 2, 3.0, 4.598);
42
create table t2 like t1;
48
eval insert into t1 select * from t1;
53
select count(*) from t1;
54
select count(*) from t2;
56
drop procedure if exists p1;
61
declare done integer default 0;
62
declare vf1 char(100) ;
63
declare vf2 mediumint;
67
declare cur1 cursor for select f1,f2,f3,f4,f5 from t1;
68
declare continue handler for sqlstate '02000' set done = 1;
71
fetch cur1 into vf1, vf2, vf3, vf4, vf5;
73
insert into t2 values (vf1, vf2, vf3, vf4, vf5);
80
select count(*) from t1;
81
select count(*) from t2;
82
select f1 from t1 limit 1;
83
select f1 from t2 limit 1;