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.t2;
10
DROP TABLE IF EXISTS test.t1;
11
DROP TABLE IF EXISTS test.t3;
12
CREATE PROCEDURE test.p1()
14
CREATE TABLE IF NOT EXISTS test.t1(a INT,PRIMARY KEY(a));
15
CREATE TABLE IF NOT EXISTS test.t2(a INT,PRIMARY KEY(a));
16
INSERT INTO test.t1 VALUES (4),(2),(1),(3);
17
UPDATE test.t1 SET a=a+4 WHERE a=4;
18
INSERT INTO test.t2 (a) SELECT t1.a FROM test.t1;
19
UPDATE test.t1 SET a=a+4 WHERE a=8;
20
CREATE TABLE IF NOT EXISTS test.t3(n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
22
CREATE PROCEDURE test.p2()
24
DROP TABLE IF EXISTS test.t1;
25
DROP TABLE IF EXISTS test.t2;
26
INSERT INTO test.t3 VALUES(NULL,11111111.233333,NOW());
29
SELECT * FROM test.t1 ORDER BY a;
35
SELECT * FROM test.t2 ORDER BY a;
41
SELECT * FROM test.t1 ORDER BY a;
47
SELECT * FROM test.t2 ORDER BY a;
64
Note 1050 Table 't3' already exists
65
SELECT * FROM test.t1 ORDER BY a;
71
SELECT * FROM test.t2 ORDER BY a;
77
SELECT * FROM test.t1 ORDER BY a;
83
SELECT * FROM test.t2 ORDER BY a;
89
DROP PROCEDURE IF EXISTS test.p1;
90
DROP PROCEDURE IF EXISTS test.p2;
91
DROP TABLE IF EXISTS test.t1;
92
DROP TABLE IF EXISTS test.t2;
93
DROP TABLE IF EXISTS test.t3;