mariadb/mysql-test/suite/rpl/r/rpl_row_img_blobs.result
Libing Song a119c5f998 MDEV-32589 FULL_NODUP mode for binlog_row_image
This patch provides a new mode FULL_NODUP to binlog_row_image system
variable. With FULL_NODUP mode, all columns are included in before
image, but only updated columns are included in after image for UPDATE.
While all columns are included in the after image for INSERT.

FULL_NODUP is for replacing FULL mode. It includes all data of
the before and after image as FULL mode, but it uses less storage
especially in the case that only a few columns are updated.

Note: It will binlog full before and after image for all modes if the
      table has no primary key. FULL_NODUP follows the behavior.
2023-11-23 08:28:54 +00:00

9274 lines
285 KiB
Text

include/rpl_init.inc [topology=1->2->3]
connection server_1;
connection server_2;
connection server_3;
connection server_1;
CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N'
connection server_1;
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'
connection server_2;
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'
connection server_3;
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
connection server_1;
### engines: MyISAM, MyISAM, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, MyISAM, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N'
connection server_1;
SET SESSION binlog_row_image= 'MINIMAL';
SET GLOBAL binlog_row_image= 'MINIMAL';
FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image MINIMAL
CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
connection server_2;
SET SESSION binlog_row_image= 'MINIMAL';
SET GLOBAL binlog_row_image= 'MINIMAL';
include/stop_slave.inc
include/start_slave.inc
FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image MINIMAL
CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
connection server_3;
SET SESSION binlog_row_image= 'MINIMAL';
SET GLOBAL binlog_row_image= 'MINIMAL';
include/stop_slave.inc
include/start_slave.inc
FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image MINIMAL
connection server_1;
### engines: MyISAM, MyISAM, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, MyISAM, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
CON: 'server_1', IMG: 'FULL_NODUP', RESTART SLAVE: 'N'
connection server_1;
SET SESSION binlog_row_image= 'FULL_NODUP';
SET GLOBAL binlog_row_image= 'FULL_NODUP';
FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL_NODUP
CON: 'server_2', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y'
connection server_2;
SET SESSION binlog_row_image= 'FULL_NODUP';
SET GLOBAL binlog_row_image= 'FULL_NODUP';
include/stop_slave.inc
include/start_slave.inc
FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL_NODUP
CON: 'server_3', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y'
connection server_3;
SET SESSION binlog_row_image= 'FULL_NODUP';
SET GLOBAL binlog_row_image= 'FULL_NODUP';
include/stop_slave.inc
include/start_slave.inc
FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL_NODUP
connection server_1;
### engines: MyISAM, MyISAM, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, MyISAM, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
connection server_1;
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'
connection server_2;
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'
connection server_3;
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
connection server_1;
### engines: MyISAM, MyISAM, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, MyISAM, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, MyISAM
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, InnoDB
connection server_1;
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
connection server_1;
SET SQL_LOG_BIN=0;
connection server_2;
SET SQL_LOG_BIN=0;
connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
connection server_1;
SET SQL_LOG_BIN=1;
connection server_2;
SET SQL_LOG_BIN=1;
connection server_3;
SET SQL_LOG_BIN=1;
connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
include/rpl_end.inc