1
#############################################################################
2
# Original Author: JBM #
3
# Original Date: Aug/14/2005 #
4
#############################################################################
5
# Test: This test contains two sp that create and drop tables, insert and #
6
# updated data and uses the NOW() function. #
7
#############################################################################
11
-- source include/master-slave.inc
14
# Begin clean up test section
17
DROP PROCEDURE IF EXISTS test.p1;
18
DROP PROCEDURE IF EXISTS test.p2;
19
DROP TABLE IF EXISTS test.t2;
20
DROP TABLE IF EXISTS test.t1;
21
DROP TABLE IF EXISTS test.t3;
25
# Begin test section 1
28
CREATE PROCEDURE test.p1()
30
CREATE TABLE IF NOT EXISTS test.t1(a INT,PRIMARY KEY(a));
31
CREATE TABLE IF NOT EXISTS test.t2(a INT,PRIMARY KEY(a));
32
INSERT INTO test.t1 VALUES (4),(2),(1),(3);
33
UPDATE test.t1 SET a=a+4 WHERE a=4;
34
INSERT INTO test.t2 (a) SELECT t1.a FROM test.t1;
35
UPDATE test.t1 SET a=a+4 WHERE a=8;
36
CREATE TABLE IF NOT EXISTS test.t3(n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
38
CREATE PROCEDURE test.p2()
40
DROP TABLE IF EXISTS test.t1;
41
DROP TABLE IF EXISTS test.t2;
42
INSERT INTO test.t3 VALUES(NULL,11111111.233333,NOW());
47
SELECT * FROM test.t1 ORDER BY a;
48
SELECT * FROM test.t2 ORDER BY a;
52
SELECT * FROM test.t1 ORDER BY a;
53
SELECT * FROM test.t2 ORDER BY a;
59
#SELECT * FROM test.t3;
65
#SELECT * FROM test.t3;
69
SELECT * FROM test.t1 ORDER BY a;
70
SELECT * FROM test.t2 ORDER BY a;
71
#SELECT * FROM test.t3;
75
SELECT * FROM test.t1 ORDER BY a;
76
SELECT * FROM test.t2 ORDER BY a;
77
#SELECT * FROM test.t3;
79
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp004_master.sql
80
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp004_slave.sql
85
DROP PROCEDURE IF EXISTS test.p1;
86
DROP PROCEDURE IF EXISTS test.p2;
87
DROP TABLE IF EXISTS test.t1;
88
DROP TABLE IF EXISTS test.t2;
89
DROP TABLE IF EXISTS test.t3;
90
sync_slave_with_master;
92
# If the test fails, you will need to diff the dumps to see why.
94
diff_files $MYSQLTEST_VARDIR/tmp/sp004_master.sql $MYSQLTEST_VARDIR/tmp/sp004_slave.sql;
97
# End of 5.0 test case