mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / ndb / t / ndb_sp.test
blobb833869cad0584a1160058850d55f2fe9536067a
1 -- source include/have_ndb.inc
2 -- source include/not_embedded.inc
4 --disable_warnings
5 drop table if exists t1;
6 --enable_warnings
8 create table t1 (
9   a int not null primary key,
10   b int not null
11 ) engine=ndb;
12 insert into t1 values (1,10), (2,20), (3,100), (4, 100);
14 delimiter //;
15 create procedure test_proc1 (in var_in int)
16 begin
17   select * from t1 where a = var_in;
18 end;
19 create procedure test_proc2 (out var_out int)
20 begin
21   select b from t1 where a = 1 into var_out;
22 end;
23 create procedure test_proc3 (inout var_inout int)
24 begin
25   select b from t1 where a = var_inout into var_inout;
26 end;
28 delimiter ;//
29 call test_proc1(1);
30 call test_proc2(@test_var);
31 select @test_var;
32 set @test_var = 1;
33 call test_proc3(@test_var);
34 select @test_var;
35 alter procedure test_proc1 comment 'new comment';
36 show create procedure test_proc1;
37 drop procedure test_proc1;
38 drop procedure test_proc2;
39 drop procedure test_proc3;
40 drop table t1;
42 --echo End of 5.1 tests