2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
7
DROP PROCEDURE IF EXISTS test.p1;
8
DROP PROCEDURE IF EXISTS test.p2;
9
DROP TABLE IF EXISTS test.t1;
10
CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=INNODB;
11
CREATE PROCEDURE test.p1()
13
INSERT INTO test.t1 VALUES (4);
14
SELECT get_lock("test", 100);
15
UPDATE test.t1 set a=a+4 WHERE a=4;
17
CREATE PROCEDURE test.p2()
19
UPDATE test.t1 SET a=a+1;
21
SELECT get_lock("test", 200);
26
SELECT release_lock("test");
29
SELECT * FROM test.t1;
32
SELECT * FROM test.t1;
35
DROP TABLE IF EXISTS test.t1;
36
CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=INNODB;
41
SELECT * FROM test.t1;
44
SELECT * FROM test.t1;
47
DROP PROCEDURE IF EXISTS test.p1;
48
DROP PROCEDURE IF EXISTS test.p2;
49
DROP TABLE IF EXISTS test.t1;