Current Path : /home/usr.opt/mysql57/mysql-test/suite/rpl/r/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result |
include/rpl_init.inc [topology=1->2->3] Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N' SET SESSION binlog_row_image= 'NOBLOB'; SET GLOBAL binlog_row_image= 'NOBLOB'; FLUSH TABLES; SHOW VARIABLES LIKE 'binlog_row_image'; Variable_name Value binlog_row_image NOBLOB CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y' SET SESSION binlog_row_image= 'NOBLOB'; SET GLOBAL binlog_row_image= 'NOBLOB'; include/stop_slave.inc include/start_slave.inc FLUSH TABLES; SHOW VARIABLES LIKE 'binlog_row_image'; Variable_name Value binlog_row_image NOBLOB CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y' SET SESSION binlog_row_image= 'NOBLOB'; SET GLOBAL binlog_row_image= 'NOBLOB'; include/stop_slave.inc include/start_slave.inc FLUSH TABLES; SHOW VARIABLES LIKE 'binlog_row_image'; Variable_name Value binlog_row_image NOBLOB ### engines: MyISAM, MyISAM, MyISAM SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Primary key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: One key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: No keys CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc ### engines: MyISAM, MyISAM, InnoDB SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Primary key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: One key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: No keys CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc ### engines: MyISAM, InnoDB, MyISAM SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Primary key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: One key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: No keys CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc ### engines: MyISAM, InnoDB, InnoDB SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Primary key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: One key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: No keys CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc ### engines: InnoDB, MyISAM, MyISAM SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Primary key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: One key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: No keys CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc ### engines: InnoDB, MyISAM, InnoDB SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Primary key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: One key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: No keys CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc ### engines: InnoDB, InnoDB, MyISAM SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Primary key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: One key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: No keys CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc ### engines: InnoDB, InnoDB, InnoDB SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite NOT NULL Unique key with holes CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key with holes CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Primary Key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Primary key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Unique key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ****** TEST: One Composite key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: One key CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; SET SQL_LOG_BIN=0; ******* TEST: No keys CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1; INSERT INTO t VALUES (1, '1', '1', '1' ); INSERT INTO t VALUES (4, '4', '4', '4' ); INSERT INTO t VALUES (7, '7', '7', '7' ); INSERT INTO t VALUES (9, '9', '9', NULL ); INSERT INTO t VALUES (2, '1', '2', '2' ); INSERT INTO t VALUES (3, '1', '3', '2' ); include/rpl_sync.inc UPDATE t SET c4 = '7'; UPDATE t SET c4 = '5' WHERE c1 = 1; UPDATE t SET c2 = '5' WHERE c1 = 1; UPDATE t SET c1 = '5' WHERE c1 = 1; UPDATE t SET c4 = '8' WHERE c2 = '4'; UPDATE t SET c1 = '8' WHERE c2 = '4'; UPDATE t SET c2 = '8' WHERE c2 = '4'; UPDATE t SET c3 = '0' WHERE c4 = NULL; UPDATE t SET c2 = '0' WHERE c4 = '0'; UPDATE t SET c2 = '2' WHERE c4 = '2'; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DELETE FROM t WHERE c1 = 7; DELETE FROM t WHERE c1 = 8; DELETE FROM t; include/rpl_sync.inc include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] DROP TABLE t; include/rpl_sync.inc CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' SET SESSION binlog_row_image= 'FULL'; SET GLOBAL binlog_row_image= 'FULL'; FLUSH TABLES; SHOW VARIABLES LIKE 'binlog_row_image'; Variable_name Value binlog_row_image FULL CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' SET SESSION binlog_row_image= 'FULL'; SET GLOBAL binlog_row_image= 'FULL'; include/stop_slave.inc include/start_slave.inc FLUSH TABLES; SHOW VARIABLES LIKE 'binlog_row_image'; Variable_name Value binlog_row_image FULL CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' SET SESSION binlog_row_image= 'FULL'; SET GLOBAL binlog_row_image= 'FULL'; include/stop_slave.inc include/start_slave.inc FLUSH TABLES; SHOW VARIABLES LIKE 'binlog_row_image'; Variable_name Value binlog_row_image FULL include/rpl_end.inc