mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / r / sp-big.result
blob9765508859c2870b3c02a12de0f9d06c3f3ec469
1 drop procedure if exists test.longprocedure;
2 drop table if exists t1;
3 create table t1 (a int);
4 insert into t1 values (1),(2),(3);
5 length
6 107520
7 select length(routine_definition) from information_schema.routines where routine_schema = 'test' and routine_name = 'longprocedure';
8 length(routine_definition)
9 107530
10 call test.longprocedure(@value);
11 select @value;
12 @value
14 drop procedure test.longprocedure;
15 drop table t1;
16 create table t1 (f1 char(100) , f2 mediumint , f3 int , f4 real, f5 numeric);
17 insert into t1 (f1, f2, f3, f4, f5) values
18 ("This is a test case for for Bug#9819", 1, 2, 3.0, 4.598);
19 Warnings:
20 Note    1265    Data truncated for column 'f5' at row 1
21 create table t2 like t1;
22 select count(*) from t1;
23 count(*)
24 256
25 select count(*) from t2;
26 count(*)
28 drop procedure if exists p1;
29 create procedure p1()
30 begin
31 declare done integer default 0;
32 declare vf1 char(100) ;
33 declare vf2 mediumint;
34 declare vf3 int ;
35 declare vf4 real ;
36 declare vf5 numeric ;
37 declare cur1 cursor for select f1,f2,f3,f4,f5 from t1;  
38 declare continue handler for sqlstate '02000' set done = 1; 
39 open cur1;
40 while done <> 1 do
41 fetch cur1 into vf1, vf2, vf3, vf4, vf5;
42 if not done then
43 insert into t2 values (vf1, vf2, vf3, vf4, vf5);
44 end if;
45 end while;
46 close cur1;
47 end|
48 call p1();
49 select count(*) from t1;
50 count(*)
51 256
52 select count(*) from t2;
53 count(*)
54 256
55 select f1 from t1 limit 1;
57 This is a test case for for Bug#9819
58 select f1 from t2 limit 1;
60 This is a test case for for Bug#9819
61 drop procedure p1;
62 drop table t1, t2;