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