1
by brian
clean slate |
1 |
stop slave;
|
2 |
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
3 |
reset master;
|
|
4 |
reset slave;
|
|
5 |
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
6 |
start slave;
|
|
7 |
DROP PROCEDURE IF EXISTS test.p1;
|
|
8 |
DROP PROCEDURE IF EXISTS test.p2;
|
|
9 |
DROP PROCEDURE IF EXISTS test.p3;
|
|
10 |
DROP PROCEDURE IF EXISTS test.p4;
|
|
11 |
DROP TABLE IF EXISTS test.t1;
|
|
12 |
DROP TABLE IF EXISTS test.t2;
|
|
13 |
CREATE PROCEDURE test.p1()
|
|
14 |
BEGIN
|
|
15 |
INSERT INTO test.t1 VALUES(2);
|
|
16 |
END|
|
|
17 |
CREATE PROCEDURE test.p2()
|
|
18 |
BEGIN
|
|
19 |
DROP TEMPORARY TABLE IF EXISTS test.t1;
|
|
20 |
CREATE TEMPORARY TABLE test.t1 (a int, PRIMARY KEY(a));
|
|
21 |
INSERT INTO test.t1 VALUES(1);
|
|
22 |
CALL test.p1();
|
|
23 |
END|
|
|
24 |
CALL test.p2();
|
|
25 |
SELECT * FROM test.t1 ORDER BY a;
|
|
26 |
a
|
|
27 |
1
|
|
28 |
2
|
|
29 |
show tables;
|
|
30 |
Tables_in_test
|
|
31 |
CREATE PROCEDURE test.p3()
|
|
32 |
BEGIN
|
|
33 |
INSERT INTO test.t2 VALUES(7);
|
|
34 |
END|
|
|
35 |
CREATE PROCEDURE test.p4()
|
|
36 |
BEGIN
|
|
37 |
DROP TABLE IF EXISTS test.t2;
|
|
38 |
CREATE TABLE test.t2 (a int, PRIMARY KEY(a));
|
|
39 |
INSERT INTO test.t2 VALUES(6);
|
|
40 |
CALL test.p3();
|
|
41 |
END|
|
|
42 |
CALL test.p4();
|
|
43 |
SELECT * FROM test.t2 ORDER BY a;
|
|
44 |
a
|
|
45 |
6
|
|
46 |
7
|
|
47 |
SELECT * FROM test.t2 ORDER BY a;
|
|
48 |
a
|
|
49 |
6
|
|
50 |
7
|
|
51 |
DROP PROCEDURE IF EXISTS test.p1;
|
|
52 |
DROP PROCEDURE IF EXISTS test.p2;
|
|
53 |
DROP PROCEDURE IF EXISTS test.p3;
|
|
54 |
DROP PROCEDURE IF EXISTS test.p4;
|
|
55 |
DROP TABLE IF EXISTS test.t1;
|
|
56 |
DROP TABLE IF EXISTS test.t2;
|