Debian Codegraph @

mysql-test/suite/ndb_rpl/t/ndb_rpl_do_table.test

raw
1 ###########################################################
2 # Author: Jeb
3 # Date: 14-12-2006
4 # Purpose: To test --replicate-do-table=db_name.tbl_name
5 # using cluster. Only t1 should replicate.
6 ##########################################################
7
8 --source include/have_ndb.inc
9 --source suite/ndb_rpl/ndb_master-slave.inc
10
11 --disable_warnings
12 DROP TABLE IF EXISTS t1, t2;
13 --enable_warnings
14
15 CREATE TABLE t1 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
16 CREATE TABLE t2 (a INT NOT NULL KEY, b text NOT NULL)ENGINE=NDB;
17
18 INSERT INTO t1 VALUES(1, repeat('abc',10));
19 INSERT INTO t1 VALUES(2, repeat('def',200));
20 INSERT INTO t1 VALUES(3, repeat('ghi',3000));
21 INSERT INTO t2 VALUES(1, repeat('abc',10));
22 INSERT INTO t2 VALUES(2, repeat('def',200));
23 INSERT INTO t2 VALUES(3, repeat('ghi',3000));
24
25 --sync_slave_with_master
26 SHOW TABLES;
27 SELECT COUNT(*) FROM t1;
28
29 #
30 # Bug #27044 replicated with unique field ndb table allows dup key inserts
31 #
32 connection master;
33
34 --error ER_DUP_ENTRY
35 INSERT INTO t1 VALUES (3, repeat('bad',1));
36
37 connection slave;
38 --error ER_DUP_ENTRY
39 INSERT INTO t1 VALUES (3, repeat('bad too',1));
40
41 # cleanup
42
43 connection master;
44 DROP TABLE IF EXISTS t1, t2;
45 --sync_slave_with_master
46 --source include/rpl_end.inc