1 # This test should work in embedded server after mysqltest is fixed
2 -- source include/not_embedded.inc
4 # Testing stored procedures with multiple connections,
5 # except security/privilege tests, they go to sp-security.test
8 # Save the initial number of concurrent sessions
9 --source include/count_sessions.inc
11 connect (con1root,localhost,root,,);
12 connect (con2root,localhost,root,,);
13 connect (con3root,localhost,root,,);
19 drop table if exists t1;
21 create table t1 (s1 int, s2 int, s3 int);
24 create procedure bug4934()
26 insert into t1 values (1,0,1);
41 create table t1 (s1 int, s2 int, s3 int);
43 drop procedure bug4934;
45 create procedure bug4934()
60 drop procedure bug4934;
64 # Bug#9486 Can't perform multi-update in stored procedure
67 drop procedure if exists bug9486;
68 drop table if exists t1, t2;
70 create table t1 (id1 int, val int);
71 create table t2 (id2 int);
73 create procedure bug9486()
74 update t1, t2 set val= 1 where id1=id2;
76 # Let us check that SP invocation requires write lock for t2.
83 # There should be call statement in locked state.
84 --replace_column 1 # 3 localhost 6 #
90 drop procedure bug9486;
95 # Bug#11158 Can't perform multi-delete in stored procedure
98 drop procedure if exists bug11158;
100 create procedure bug11158() delete t1 from t1, t2 where t1.id = t2.id;
101 create table t1 (id int, j int);
102 insert into t1 values (1, 1), (2, 2);
103 create table t2 (id int);
104 insert into t2 values (1);
105 # Procedure should work and cause proper effect (delete only first row)
108 # Also let us test that we obtain only read (and thus non exclusive) lock
109 # for table from which we are not going to delete rows.
118 drop procedure bug11158;
123 # Bug#11554 Server crashes on statement indirectly using non-cached function
126 drop function if exists bug11554;
127 drop view if exists v1;
129 create table t1 (i int);
130 create function bug11554 () returns int return 1;
131 create view v1 as select bug11554() as f;
133 # This should not crash server
134 insert into t1 (select f from v1);
137 drop function bug11554;
142 # Bug#12228 Crash happens during calling specific SP in multithread environment
144 drop procedure if exists p1;
145 drop procedure if exists p2;
150 create table t1 (s1 int)|
151 create procedure p1() select * from t1|
152 create procedure p2()
154 insert into t1 values (1);
170 create procedure p1() select * from t1;
176 # Crash will be here if we hit Bug#12228
185 # Bug#NNNN New bug synopsis
188 #drop procedure if exists bugNNNN;
190 #create procedure bugNNNN...
197 # Wait till we reached the initial number of concurrent sessions
198 --source include/wait_until_count_sessions.inc