~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
--source include/have_ndb.inc
 
3
--source include/ndb_master-slave.inc
 
4
--source include/have_binlog_format_mixed_or_row.inc
 
5
 
 
6
--disable_query_log
 
7
--disable_warnings
 
8
connection slave;
 
9
STOP SLAVE;
 
10
connection master;
 
11
DROP TABLE IF EXISTS t1;
 
12
RESET MASTER;
 
13
connection slave;
 
14
DROP TABLE IF EXISTS t1;
 
15
RESET SLAVE;
 
16
START SLAVE;
 
17
--enable_warnings
 
18
--enable_query_log
 
19
 
 
20
--echo **** On Master ****
 
21
connection master;
 
22
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
 
23
INSERT INTO t1 VALUES (1,1), (2,2);
 
24
SELECT * FROM t1 ORDER BY a,b;
 
25
--echo **** On Slave ****
 
26
# This is silly, but NDB doesn't add to the binlog fast enough
 
27
--real_sleep 10
 
28
sync_slave_with_master;
 
29
INSERT INTO t1 VALUE (3,3);
 
30
SELECT * FROM t1 ORDER BY a,b;
 
31
--echo **** On Master ****
 
32
connection master;
 
33
TRUNCATE TABLE t1;
 
34
SELECT * FROM t1 ORDER BY a,b;
 
35
--echo **** On Slave ****
 
36
sync_slave_with_master;
 
37
# Should be empty
 
38
SELECT * FROM t1 ORDER BY a,b;
 
39
--echo **** On Master ****
 
40
connection master;
 
41
DROP TABLE t1;
 
42
let SERVER_VERSION=`select version()`;
 
43
--replace_regex /\/\* xid=[0-9]+ \*\//\/* xid= *\// /table_id: [0-9]+/table_id: #/
 
44
--replace_result $SERVER_VERSION SERVER_VERSION
 
45
SHOW BINLOG EVENTS;
 
46
 
 
47
--echo **** On Master ****
 
48
connection master;
 
49
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
 
50
INSERT INTO t1 VALUES (1,1), (2,2);
 
51
SELECT * FROM t1 ORDER BY a,b;
 
52
--echo **** On Slave ****
 
53
sync_slave_with_master;
 
54
INSERT INTO t1 VALUE (3,3);
 
55
SELECT * FROM t1 ORDER BY a,b;
 
56
--echo **** On Master ****
 
57
connection master;
 
58
DELETE FROM t1;
 
59
SELECT * FROM t1 ORDER BY a,b;
 
60
--echo **** On Slave ****
 
61
sync_slave_with_master;
 
62
# Should be empty
 
63
SELECT * FROM t1 ORDER BY a,b;
 
64
--echo **** On Master ****
 
65
connection master;
 
66
DROP TABLE t1;
 
67
--replace_regex /table_id: [0-9]+/table_id: #/
 
68
--replace_result $SERVER_VERSION SERVER_VERSION
 
69
SHOW BINLOG EVENTS;
 
70
 
 
71
-- source include/master-slave-end.inc