~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_sp004.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
#############################################################################
 
8
 
 
9
 
 
10
# Includes
 
11
-- source include/master-slave.inc
 
12
 
 
13
 
 
14
# Begin clean up test section
 
15
connection master;
 
16
--disable_warnings
 
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;
 
22
--enable_warnings
 
23
# End of cleanup
 
24
 
 
25
# Begin test section 1
 
26
 
 
27
delimiter |;
 
28
CREATE PROCEDURE test.p1()
 
29
BEGIN
 
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));
 
37
END|
 
38
CREATE PROCEDURE test.p2()
 
39
BEGIN
 
40
  DROP TABLE IF EXISTS test.t1;
 
41
  DROP TABLE IF EXISTS test.t2;
 
42
  INSERT INTO test.t3 VALUES(NULL,11111111.233333,NOW());
 
43
END|
 
44
delimiter ;|
 
45
 
 
46
CALL test.p1();
 
47
SELECT * FROM test.t1 ORDER BY a;
 
48
SELECT * FROM test.t2 ORDER BY a;
 
49
save_master_pos;
 
50
connection slave;
 
51
sync_with_master;
 
52
SELECT * FROM test.t1 ORDER BY a;
 
53
SELECT * FROM test.t2 ORDER BY a;
 
54
 
 
55
connection master;
 
56
CALL test.p2();
 
57
USE test;
 
58
SHOW TABLES;
 
59
#SELECT * FROM test.t3;
 
60
save_master_pos;
 
61
connection slave;
 
62
sync_with_master;
 
63
USE test;
 
64
SHOW TABLES;
 
65
#SELECT * FROM test.t3;
 
66
 
 
67
connection master;
 
68
CALL test.p1();
 
69
SELECT * FROM test.t1 ORDER BY a;
 
70
SELECT * FROM test.t2 ORDER BY a;
 
71
#SELECT * FROM test.t3;
 
72
save_master_pos;
 
73
connection slave;
 
74
sync_with_master;
 
75
SELECT * FROM test.t1 ORDER BY a;
 
76
SELECT * FROM test.t2 ORDER BY a;
 
77
#SELECT * FROM test.t3;
 
78
 
 
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
 
81
 
 
82
# Cleanup
 
83
connection master;
 
84
#show binlog events;
 
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;
 
91
 
 
92
# If the test fails, you will need to diff the dumps to see why.
 
93
 
 
94
diff_files $MYSQLTEST_VARDIR/tmp/sp004_master.sql $MYSQLTEST_VARDIR/tmp/sp004_slave.sql;
 
95
 
 
96
 
 
97
# End of 5.0 test case