summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/rpl
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-12-15 20:13:09 +0100
committerSergei Golubchik <serg@mariadb.org>2015-12-15 20:13:09 +0100
commit15f7f5c6bb4eb8ee8d868bb991f25b18d36f64ec (patch)
treef34ee89e970d980124ce8390550e0845e1c52dc4 /storage/tokudb/mysql-test/rpl
parenta75ac82c2f24a6a7ffb2effe90455d367913b78d (diff)
parent2c8c65297865d9f8da501761f46e2a34e29af603 (diff)
downloadmariadb-git-15f7f5c6bb4eb8ee8d868bb991f25b18d36f64ec.tar.gz
Merge branch 'merge-tokudb-5.6' into 10.0
Diffstat (limited to 'storage/tokudb/mysql-test/rpl')
-rw-r--r--storage/tokudb/mysql-test/rpl/disabled.def1
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result143
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result859
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result551
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_foreign_key_tokudb.result58
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_mixed_row_tokudb.result132
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result210
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result73
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result22
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result32
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result19
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result150
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result27
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result679
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result161
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_log_tokudb.result275
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result37
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_sp002_tokudb.result233
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result48
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result190
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result31
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result138
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result145
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result35
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result159
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result1106
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result48
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result13
-rw-r--r--storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_deadlock_tokudb-slave.opt1
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_deadlock_tokudb.test8
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_extra_col_master_tokudb.test11
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_extra_col_slave_tokudb.test7
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_foreign_key_tokudb.test4
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_mixed_row_tokudb-master.opt1
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_not_null_tokudb.test20
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb-master.opt1
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb-slave.opt5
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test15
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test63
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt1
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test70
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test53
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_partition_tokudb-master.opt1
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_partition_tokudb.test12
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_relay_space_tokudb.test4
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_row_basic_3tokudb.test11
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_row_blob_tokudb.test15
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_row_log_tokudb-master.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_row_log_tokudb.test15
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_row_rec_comp_tokudb.test11
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_row_sp002_tokudb.test4
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_row_sp007_tokudb.test4
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_row_tabledefs_3tokudb.test10
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_set_null_tokudb.test7
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_stm_tokudb.test11
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb-master.opt1
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430-master.opt1
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430-slave.opt1
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430.test159
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug30888.test66
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_ddl.test9
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt2
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test9
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_truncate_3tokudb.test4
-rw-r--r--storage/tokudb/mysql-test/rpl/t/rpl_typeconv_tokudb.test26
-rw-r--r--storage/tokudb/mysql-test/rpl/t/tokudb_innodb_xa_crash.test2
85 files changed, 6276 insertions, 1 deletions
diff --git a/storage/tokudb/mysql-test/rpl/disabled.def b/storage/tokudb/mysql-test/rpl/disabled.def
index 4c1a9a3e785..25c44654676 100644
--- a/storage/tokudb/mysql-test/rpl/disabled.def
+++ b/storage/tokudb/mysql-test/rpl/disabled.def
@@ -13,3 +13,4 @@ rpl_tokudb_write_unique_uc1: unreliable, uses timestamp differences
rpl_tokudb_read_only_ff: unreliable, uses timestamp differences
rpl_tokudb_read_only_tf: unreliable, uses timestamp differences
rpl_tokudb_read_only_tt: unreliable, uses timestamp differences
+rpl_row_sp002_tokudb : tokudb does not support foreign keys
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result
new file mode 100644
index 00000000000..a64b5dcbeed
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result
@@ -0,0 +1,143 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+*** Prepare tables and data ***
+CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=TokuDB;
+CREATE TABLE t2 (a INT) ENGINE=TokuDB;
+CREATE TABLE t3 (a INT NOT NULL, KEY(a)) ENGINE=TokuDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ KEY `a` (`a`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `a` int(11) NOT NULL,
+ KEY `a` (`a`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+SELECT @@GLOBAL.slave_transaction_retries;
+@@GLOBAL.slave_transaction_retries
+2
+SELECT @@GLOBAL.innodb_lock_wait_timeout;
+@@GLOBAL.innodb_lock_wait_timeout
+4
+include/stop_slave.inc
+BEGIN;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2), (2), (2), (2), (2), (2), (2), (2), (2), (2);
+INSERT INTO t3 VALUES (3);
+COMMIT;
+
+*** Test deadlock ***
+BEGIN;
+SELECT * FROM t1 FOR UPDATE;
+a
+include/start_slave.inc
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+COMMIT;
+include/check_slave_is_running.inc
+SELECT * FROM t1;
+a
+1
+SELECT * FROM t3;
+a
+3
+
+*** Test lock wait timeout ***
+include/stop_slave.inc
+DELETE FROM t2;
+RESET MASTER;
+CHANGE MASTER TO MASTER_LOG_POS=MASTER_POS_BEGIN;
+BEGIN;
+SELECT * FROM t1 FOR UPDATE;
+a
+1
+START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1205]
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+COMMIT;
+include/start_slave.inc
+SELECT * FROM t1;
+a
+1
+1
+SELECT * FROM t3;
+a
+3
+3
+include/check_slave_is_running.inc
+
+*** Test lock wait timeout and purged relay logs ***
+SET @my_max_relay_log_size= @@global.max_relay_log_size;
+SET global max_relay_log_size=0;
+include/stop_slave.inc
+DELETE FROM t2;
+RESET MASTER;
+CHANGE MASTER TO MASTER_LOG_POS=MASTER_POS_BEGIN;
+BEGIN;
+SELECT * FROM t1 FOR UPDATE;
+a
+1
+1
+START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1205]
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+COMMIT;
+include/start_slave.inc
+SELECT * FROM t1;
+a
+1
+1
+1
+SELECT * FROM t3;
+a
+3
+3
+3
+include/check_slave_is_running.inc
+
+*** Test the deadlock warning to be escalated into the error ***
+delete from t1;
+delete from t2;
+delete from t3;
+delete from t1;
+delete from t2;
+delete from t3;
+set @save.slave_transaction_retries= @@global.slave_transaction_retries;
+set @@global.slave_transaction_retries= 0;
+include/stop_slave.inc
+BEGIN;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2), (2), (2), (2), (2), (2), (2), (2), (2), (2);
+INSERT INTO t3 VALUES (3);
+COMMIT;
+BEGIN;
+SELECT count(*) as zero FROM t1 FOR UPDATE;
+zero
+0
+START SLAVE;
+*** Now the slave must be stopped due to timeout ***
+include/wait_for_slave_sql_error.inc [errno=1205]
+rollback;
+set @@global.slave_transaction_retries= @save.slave_transaction_retries;
+include/start_slave.inc
+*** Clean up ***
+DROP TABLE t1,t2,t3;
+SET global max_relay_log_size= @my_max_relay_log_size;
+End of 5.1 tests
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result
new file mode 100644
index 00000000000..63cc27481c5
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result
@@ -0,0 +1,859 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+
+***********************************************************
+***********************************************************
+***************** Start of Testing ************************
+***********************************************************
+***********************************************************
+* This test format == binlog_format ROW and engine == TokuDB
+***********************************************************
+***********************************************************
+
+***** Testing more columns on the Master *****
+
+CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+/* extra */
+f5 FLOAT DEFAULT '2.00',
+f6 CHAR(4) DEFAULT 'TEST',
+f7 INT DEFAULT '0',
+f8 TEXT,
+f9 LONGBLOB,
+f10 BIT(63),
+f11 VARBINARY(64))ENGINE=TokuDB;
+
+* Alter Table on Slave and drop columns f5 through f11 *
+
+alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
+
+* Insert data in Master then update and delete some rows*
+
+* Select count and 20 rows from Master *
+
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40
+
+SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
+hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
+f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
+2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+
+* Select count and 20 rows from Slave *
+
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40
+
+SELECT * FROM t1 ORDER BY f3 LIMIT 20;
+f1 f2 f3 f4
+2 2 2 second
+3 3 3 next
+5 5 5 second
+6 6 6 next
+8 8 8 second
+9 9 9 next
+11 11 11 second
+12 12 12 next
+14 14 14 second
+15 15 15 next
+17 17 17 second
+18 18 18 next
+20 20 20 second
+21 21 21 next
+23 23 23 second
+24 24 24 next
+26 26 26 second
+27 27 27 next
+29 29 29 second
+30 30 30 next
+include/check_slave_is_running.inc
+
+***** Testing Altering table def scenario *****
+
+CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+/* extra */
+f5 DOUBLE DEFAULT '2.00',
+f6 ENUM('a', 'b', 'c') default 'a',
+f7 DECIMAL(17,9) default '1000.00',
+f8 MEDIUMBLOB,
+f9 NUMERIC(6,2) default '2000.00',
+f10 VARCHAR(1024),
+f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+f12 SET('a', 'b', 'c') default 'b')
+ENGINE=TokuDB;
+
+CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+/* extra */
+f5 DOUBLE DEFAULT '2.00',
+f6 ENUM('a', 'b', 'c') default 'a',
+f8 MEDIUMBLOB,
+f10 VARCHAR(1024),
+f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+f12 SET('a', 'b', 'c') default 'b')
+ENGINE=TokuDB;
+
+CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+/* extra */
+f5 DOUBLE DEFAULT '2.00',
+f6 DECIMAL(17,9) default '1000.00',
+f7 MEDIUMBLOB,
+f8 NUMERIC(6,2) default '2000.00',
+f9 VARCHAR(1024),
+f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
+f11 CHAR(255))
+ENGINE=TokuDB;
+
+CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
+/* extra */
+f5 BIGINT,
+f6 BLOB,
+f7 DATE,
+f8 DATETIME,
+f9 FLOAT,
+f10 INT,
+f11 LONGBLOB,
+f12 LONGTEXT,
+f13 MEDIUMBLOB,
+f14 MEDIUMINT,
+f15 MEDIUMTEXT,
+f16 REAL,
+f17 SMALLINT,
+f18 TEXT,
+f19 TIME,
+f20 TIMESTAMP,
+f21 TINYBLOB,
+f22 TINYINT,
+f23 TINYTEXT,
+f24 YEAR,
+f25 BINARY(255),
+f26 BIT(64),
+f27 CHAR(255),
+f28 DECIMAL(30,7),
+f29 DOUBLE,
+f30 ENUM ('a','b', 'c') default 'a',
+f31 FLOAT,
+f32 NUMERIC(17,9),
+f33 SET ('a', 'b', 'c') default 'b',
+f34 VARBINARY(1025),
+f35 VARCHAR(257)
+) ENGINE=TokuDB;
+
+** Alter tables on slave and drop columns **
+
+alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
+f12;
+alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
+alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
+alter table t31
+drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
+drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
+drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
+drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
+drop f33, drop f34, drop f35;
+
+** Insert Data into Master **
+INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
+some var char';
+INSERT into t2 values (2, 2, 2, 'second',
+2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
+'01234567', 'c'),
+(3, 3, 3, 'third',
+3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
+'01234567', 'c');
+INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
+INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
+binary data';
+INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
+INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
+f9=2.2, f10='seven samurai', f28=222.222, f35='222';
+Warnings:
+Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
+INSERT into t31 values (1, 1, 3, 'third',
+/* f5 BIGINT, */ 333333333333333333333333,
+/* f6 BLOB, */ '3333333333333333333333',
+/* f7 DATE, */ '2007-07-18',
+/* f8 DATETIME, */ "2007-07-18",
+/* f9 FLOAT, */ 3.33333333,
+/* f10 INT, */ 333333333,
+/* f11 LONGBLOB, */ '3333333333333333333',
+/* f12 LONGTEXT, */ '3333333333333333333',
+/* f13 MEDIUMBLOB, */ '3333333333333333333',
+/* f14 MEDIUMINT, */ 33,
+/* f15 MEDIUMTEXT, */ 3.3,
+/* f16 REAL, */ 3.3,
+/* f17 SMALLINT, */ 3,
+/* f18 TEXT, */ '33',
+/* f19 TIME, */ '2:59:58.999',
+/* f20 TIMESTAMP, */ 20000303000000,
+/* f21 TINYBLOB, */ '3333',
+/* f22 TINYINT, */ 3,
+/* f23 TINYTEXT, */ '3',
+/* f24 YEAR, */ 3000,
+/* f25 BINARY(255), */ 'three_33333',
+/* f26 BIT(64), */ b'011',
+/* f27 CHAR(255), */ 'three',
+/* f28 DECIMAL(30,7), */ 3.333,
+/* f29 DOUBLE, */ 3.333333333333333333333333333,
+/* f30 ENUM ('a','b','c')*/ 'c',
+/* f31 FLOAT, */ 3.0,
+/* f32 NUMERIC(17,9), */ 3.3333,
+/* f33 SET ('a','b','c'),*/ 'c',
+/*f34 VARBINARY(1025),*/ '3333 minus 3',
+/*f35 VARCHAR(257),*/ 'three times three'
+ );
+Warnings:
+Warning 1264 Out of range value for column 'f5' at row 1
+Warning 1264 Out of range value for column 'f24' at row 1
+INSERT into t31 values (1, 1, 4, 'fourth',
+/* f5 BIGINT, */ 333333333333333333333333,
+/* f6 BLOB, */ '3333333333333333333333',
+/* f7 DATE, */ '2007-07-18',
+/* f8 DATETIME, */ "2007-07-18",
+/* f9 FLOAT, */ 3.33333333,
+/* f10 INT, */ 333333333,
+/* f11 LONGBLOB, */ '3333333333333333333',
+/* f12 LONGTEXT, */ '3333333333333333333',
+/* f13 MEDIUMBLOB, */ '3333333333333333333',
+/* f14 MEDIUMINT, */ 33,
+/* f15 MEDIUMTEXT, */ 3.3,
+/* f16 REAL, */ 3.3,
+/* f17 SMALLINT, */ 3,
+/* f18 TEXT, */ '33',
+/* f19 TIME, */ '2:59:58.999',
+/* f20 TIMESTAMP, */ 20000303000000,
+/* f21 TINYBLOB, */ '3333',
+/* f22 TINYINT, */ 3,
+/* f23 TINYTEXT, */ '3',
+/* f24 YEAR, */ 3000,
+/* f25 BINARY(255), */ 'three_33333',
+/* f26 BIT(64), */ b'011',
+/* f27 CHAR(255), */ 'three',
+/* f28 DECIMAL(30,7), */ 3.333,
+/* f29 DOUBLE, */ 3.333333333333333333333333333,
+/* f30 ENUM ('a','b','c')*/ 'c',
+/* f31 FLOAT, */ 3.0,
+/* f32 NUMERIC(17,9), */ 3.3333,
+/* f33 SET ('a','b','c'),*/ 'c',
+/*f34 VARBINARY(1025),*/ '3333 minus 3',
+/*f35 VARCHAR(257),*/ 'three times three'
+ ),
+(1, 1, 5, 'fifth',
+/* f5 BIGINT, */ 333333333333333333333333,
+/* f6 BLOB, */ '3333333333333333333333',
+/* f7 DATE, */ '2007-07-18',
+/* f8 DATETIME, */ "2007-07-18",
+/* f9 FLOAT, */ 3.33333333,
+/* f10 INT, */ 333333333,
+/* f11 LONGBLOB, */ '3333333333333333333',
+/* f12 LONGTEXT, */ '3333333333333333333',
+/* f13 MEDIUMBLOB, */ '3333333333333333333',
+/* f14 MEDIUMINT, */ 33,
+/* f15 MEDIUMTEXT, */ 3.3,
+/* f16 REAL, */ 3.3,
+/* f17 SMALLINT, */ 3,
+/* f18 TEXT, */ '33',
+/* f19 TIME, */ '2:59:58.999',
+/* f20 TIMESTAMP, */ 20000303000000,
+/* f21 TINYBLOB, */ '3333',
+/* f22 TINYINT, */ 3,
+/* f23 TINYTEXT, */ '3',
+/* f24 YEAR, */ 3000,
+/* f25 BINARY(255), */ 'three_33333',
+/* f26 BIT(64), */ b'011',
+/* f27 CHAR(255), */ 'three',
+/* f28 DECIMAL(30,7), */ 3.333,
+/* f29 DOUBLE, */ 3.333333333333333333333333333,
+/* f30 ENUM ('a','b','c')*/ 'c',
+/* f31 FLOAT, */ 3.0,
+/* f32 NUMERIC(17,9), */ 3.3333,
+/* f33 SET ('a','b','c'),*/ 'c',
+/*f34 VARBINARY(1025),*/ '3333 minus 3',
+/*f35 VARCHAR(257),*/ 'three times three'
+ ),
+(1, 1, 6, 'sixth',
+/* f5 BIGINT, */ NULL,
+/* f6 BLOB, */ '3333333333333333333333',
+/* f7 DATE, */ '2007-07-18',
+/* f8 DATETIME, */ "2007-07-18",
+/* f9 FLOAT, */ 3.33333333,
+/* f10 INT, */ 333333333,
+/* f11 LONGBLOB, */ '3333333333333333333',
+/* f12 LONGTEXT, */ '3333333333333333333',
+/* f13 MEDIUMBLOB, */ '3333333333333333333',
+/* f14 MEDIUMINT, */ 33,
+/* f15 MEDIUMTEXT, */ 3.3,
+/* f16 REAL, */ 3.3,
+/* f17 SMALLINT, */ 3,
+/* f18 TEXT, */ '33',
+/* f19 TIME, */ '2:59:58.999',
+/* f20 TIMESTAMP, */ 20000303000000,
+/* f21 TINYBLOB, */ '3333',
+/* f22 TINYINT, */ 3,
+/* f23 TINYTEXT, */ '3',
+/* f24 YEAR, */ 3000,
+/* f25 BINARY(255), */ 'three_33333',
+/* f26 BIT(64), */ b'011',
+/* f27 CHAR(255), */ 'three',
+/* f28 DECIMAL(30,7), */ 3.333,
+/* f29 DOUBLE, */ 3.333333333333333333333333333,
+/* f30 ENUM ('a','b','c')*/ 'c',
+/* f31 FLOAT, */ 3.0,
+/* f32 NUMERIC(17,9), */ 3.3333,
+/* f33 SET ('a','b','c'),*/ 'c',
+/*f34 VARBINARY(1025),*/ '3333 minus 3',
+/*f35 VARCHAR(257),*/ NULL
+);
+Warnings:
+Warning 1264 Out of range value for column 'f5' at row 1
+Warning 1264 Out of range value for column 'f24' at row 1
+Warning 1264 Out of range value for column 'f5' at row 2
+Warning 1264 Out of range value for column 'f24' at row 2
+Warning 1264 Out of range value for column 'f24' at row 3
+
+** Sync slave with master **
+** Do selects from tables **
+
+select * from t1 order by f3;
+f1 f2 f3 f4
+2 2 2 second
+3 3 3 next
+5 5 5 second
+6 6 6 next
+8 8 8 second
+9 9 9 next
+11 11 11 second
+12 12 12 next
+14 14 14 second
+15 15 15 next
+17 17 17 second
+18 18 18 next
+20 20 20 second
+21 21 21 next
+23 23 23 second
+24 24 24 next
+26 26 26 second
+27 27 27 next
+29 29 29 second
+30 30 30 next
+31 31 31 second
+32 32 32 second
+33 33 33 second
+34 34 34 second
+35 35 35 second
+36 36 36 second
+37 37 37 second
+38 38 38 second
+39 39 39 second
+40 40 40 second
+41 41 41 second
+42 42 42 second
+43 43 43 second
+44 44 44 second
+45 45 45 second
+46 46 46 second
+47 47 47 second
+48 48 48 second
+49 49 49 second
+50 50 50 second
+select * from t2 order by f1;
+f1 f2 f3 f4
+1 1 1 first
+2 2 2 second
+3 3 3 third
+select * from t3 order by f1;
+f1 f2 f3 f4
+1 1 1 first
+select * from t4 order by f1;
+f1 f2 f3 f4
+1 1 1 first
+select * from t31 order by f3;
+f1 f2 f3 f4
+1 1 1 first
+1 1 2 second
+1 1 3 third
+1 1 4 fourth
+1 1 5 fifth
+1 1 6 sixth
+
+** Do updates master **
+
+update t31 set f5=555555555555555 where f3=6;
+update t31 set f2=2 where f3=2;
+update t31 set f1=NULL where f3=1;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning 1048 Column 'f3' cannot be null
+
+** Delete from Master **
+
+delete from t1;
+delete from t2;
+delete from t3;
+delete from t4;
+delete from t31;
+select * from t31;
+f1 f2 f3 f4
+
+** Check slave status **
+
+include/check_slave_is_running.inc
+
+****************************************
+* columns in master at middle of table *
+* Expect: Proper error message *
+****************************************
+
+** Stop and Reset Slave **
+
+STOP SLAVE;
+
+** create table slave side **
+CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE=TokuDB;
+
+** Connect to master and create table **
+
+CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+c CHAR(5), e INT DEFAULT '1')ENGINE=TokuDB;
+
+*** Start Slave ***
+include/rpl_reset.inc
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
+(2,@b1,DEFAULT,'JOE',DEFAULT),
+(3,@b1,DEFAULT,'QA',DEFAULT);
+
+********************************************
+*** Expect slave to fail with Error 1677 ***
+********************************************
+
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+
+*** Drop t10 ***
+DROP TABLE t10;
+
+*********************************************
+* More columns in master at middle of table *
+* Expect: Proper error message *
+*********************************************
+
+*** Create t11 on slave ***
+STOP SLAVE;
+CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+) ENGINE=TokuDB;
+
+*** Create t11 on Master ***
+CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=TokuDB;
+
+*** Start Slave ***
+include/rpl_reset.inc
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
+(2,@b1,'Testing is cool','JOE',DEFAULT),
+(3,@b1,DEFAULT,'QA',DEFAULT);
+
+********************************************
+*** Expect slave to fail with Error 1677 ***
+********************************************
+
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+
+*** Drop t11 ***
+DROP TABLE t11;
+
+*********************************************
+* More columns in master at middle of table *
+* Expect: This one should pass blob-text *
+*********************************************
+
+*** Create t12 on slave ***
+STOP SLAVE;
+CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+) ENGINE=TokuDB;
+
+*** Create t12 on Master ***
+CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=TokuDB;
+
+*** Start Slave ***
+include/rpl_reset.inc
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+(2,@b1,'JOE',DEFAULT,DEFAULT),
+(3,@b1,'QA',DEFAULT,DEFAULT);
+
+SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
+a hex(b) f c e
+1 62316231623162316231623162316231 Kyle test 1
+2 62316231623162316231623162316231 JOE test 1
+3 62316231623162316231623162316231 QA test 1
+
+*** Select on Slave ***
+SELECT a,hex(b),c FROM t12 ORDER BY a;
+a hex(b) c
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 QA
+
+*** Drop t12 ***
+DROP TABLE t12;
+
+****************************************************
+* - Alter Master adding columns at middle of table *
+* Expect: columns added *
+****************************************************
+
+
+*** Create t14 on slave ***
+STOP SLAVE;
+CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE=TokuDB;
+
+*** Create t14 on Master ***
+CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE=TokuDB;
+
+*** Start Slave ***
+include/rpl_reset.inc
+
+*** Master Data Insert ***
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
+(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
+
+SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
+c1 c2 c3 hex(c4) c5 c6 c7
+1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
+
+*** Select on Slave ****
+SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
+c1 c2 c3 hex(c4) c5
+1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
+2 2.00 This Test Should work 62316231623162316231623162316231 JOE
+3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
+
+****************************************************
+* - Alter Master Dropping columns from the middle. *
+* Expect: columns dropped *
+****************************************************
+
+*** connect to master and drop columns ***
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c7;
+
+*** Select from Master ***
+SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
+c1 c3 hex(c4) c5 c6
+1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
+2 This Test Should work 62316231623162316231623162316231 JOE 1
+3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
+
+************
+* Bug30415 *
+************
+include/wait_for_slave_sql_error.inc [errno=1091]
+STOP SLAVE;
+
+*** Drop t14 ***
+DROP TABLE t14;
+DROP TABLE t14;
+include/rpl_reset.inc
+
+*************************************************
+* - Alter Master adding columns at end of table *
+* Expect: Error 1054 *
+*************************************************
+
+*** Create t15 on slave ***
+STOP SLAVE;
+CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE=TokuDB;
+
+*** Create t15 on Master ***
+CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE=TokuDB;
+
+*** Start Slave ***
+include/rpl_reset.inc
+
+*** Master Data Insert ***
+ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
+(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
+(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
+SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
+c1 hex(c4) c5 c6 c7 c2
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
+2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
+3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
+
+********************************************
+*** Expect slave to fail with Error 1054 ***
+********************************************
+
+include/wait_for_slave_sql_error.inc [errno=1054]
+STOP SLAVE;
+
+*** Drop t15 ***
+DROP TABLE t15;
+DROP TABLE t15;
+include/rpl_reset.inc
+
+************************************************
+* - Create index on Master column not on slave *
+* Expect:Warning *
+************************************************
+
+*** Create t16 on slave ***
+STOP SLAVE;
+CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE=TokuDB;
+
+*** Create t16 on Master ***
+CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE=TokuDB;
+
+*** Start Slave ***
+include/rpl_reset.inc
+
+*** Master Create Index and Data Insert ***
+CREATE INDEX part_of_c6 ON t16 (c6);
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+(2,@b1,'JOE',2,DEFAULT),
+(3,@b1,'QA',3,DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
+
+*****************
+*** BUG 30434 ***
+*****************
+
+include/wait_for_slave_sql_error.inc [errno=1072]
+STOP SLAVE;
+
+*** Drop t16 ***
+DROP TABLE t16;
+DROP TABLE t16;
+include/rpl_reset.inc
+
+*****************************************************
+* - Delete rows using column on Master not on slave *
+* Expect: Rows Deleted *
+*****************************************************
+
+*** Create t17 on slave ***
+STOP SLAVE;
+CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE=TokuDB;
+
+*** Create t17 on Master ***
+CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE=TokuDB;
+
+*** Start Slave ***
+include/rpl_reset.inc
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+(2,@b1,'JOE',2,DEFAULT),
+(3,@b1,'QA',3,DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
+
+** Select * from Slave **
+SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 QA
+
+** Delete from master **
+DELETE FROM t17 WHERE c6 = 3;
+SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+
+** Check slave **
+SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+DROP TABLE t17;
+
+
+*****************************************************
+* - Update row using column on Master not on slave *
+* Expect: Rows updated *
+*****************************************************
+
+** Bug30674 **
+
+*** Create t18 on slave ***
+
+STOP SLAVE;
+CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE=TokuDB;
+
+*** Create t18 on Master ***
+CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE=TokuDB;
+
+*** Start Slave ***
+include/rpl_reset.inc
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+(2,@b1,'JOE',2,DEFAULT),
+(3,@b1,'QA',3,DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
+
+** Select * from Slave **
+SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 QA
+
+** update from master **
+UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
+SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
+
+** Check slave **
+SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 TEST
+DROP TABLE t18;
+
+
+*****************************************************
+* - Insert UUID column on Master not on slave *
+* Expect: Rows inserted *
+*****************************************************
+
+*** Create t5 on slave ***
+STOP SLAVE;
+CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE=TokuDB;
+
+*** Create t5 on Master ***
+CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 LONG,
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE=TokuDB;
+
+*** Start Slave ***
+include/rpl_reset.inc
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
+(2,@b1,'JOE',UUID(),DEFAULT),
+(3,@b1,'QA',UUID(),DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 6231623162316231 Kyle UUID TIME
+2 6231623162316231 JOE UUID TIME
+3 6231623162316231 QA UUID TIME
+
+** Select * from Slave **
+SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
+c1 hex(c4) c5
+1 6231623162316231 Kyle
+2 6231623162316231 JOE
+3 6231623162316231 QA
+DROP TABLE t5;
+
+include/rpl_reset.inc
+SET NAMES utf8;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 INT NOT NULL, c2 CHAR(255) CHARACTER SET UTF8 NOT NULL) ENGINE=TokuDB;
+SET SQL_LOG_BIN=1;
+CREATE TABLE t1 (c1 INT) ENGINE=TokuDB;
+INSERT INTO t1 VALUES ();
+SET @text= REPEAT(_utf8'ç', 255);
+INSERT INTO t1 VALUES (1, @text);
+SELECT * FROM t1 ORDER BY c1;
+c1 c2
+0
+1 ççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççç
+SELECT * FROM t1 ORDER BY c1;
+c1
+0
+1
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result
new file mode 100644
index 00000000000..120f4bc9442
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result
@@ -0,0 +1,551 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+call mtr.add_suppression("Slave: Unknown table 'test.t6' Error_code: 1051");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+**** Diff Table Def Start ****
+*** On Slave ***
+STOP SLAVE;
+SET @saved_slave_type_conversions = @@slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
+CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(4) DEFAULT 'TEST')
+ENGINE='TokuDB';
+*** Create t1 on Master ***
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 2 TEXAS
+2 1 AUSTIN
+3 4 QA
+*** Select from slave ***
+SELECT * FROM t1 ORDER BY a;
+a b c d e
+1 2 TEXAS 2 TEST
+2 1 AUSTIN 2 TEST
+3 4 QA 2 TEST
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+*** Drop t1 ***
+DROP TABLE t1;
+*** Create t2 on slave ***
+STOP SLAVE;
+CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='TokuDB';
+*** Create t2 on Master ***
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
+SELECT * FROM t2 ORDER BY a;
+a b c
+1 2 Kyle, TEX
+2 1 JOE AUSTIN
+3 4 QA TESTING
+include/wait_for_slave_sql_error.inc [errno=1677]
+STOP SLAVE;
+include/rpl_reset.inc
+SELECT * FROM t2 ORDER BY a;
+a b c d e
+*** Drop t2 ***
+DROP TABLE t2;
+*** Create t3 on slave ***
+STOP SLAVE;
+CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='TokuDB';
+*** Create t3 on Master ***
+CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
+******************************************************************
+*** Expect slave to fail with Error ER_SLAVE_CONVERSION_FAILED ***
+******************************************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+*** Drop t3 ***
+DROP TABLE t3;
+*** Create t4 on slave ***
+STOP SLAVE;
+CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='TokuDB';
+*** Create t4 on Master ***
+CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
+(30000.22,4,'QA TESTING');
+******************************************************************
+*** Expect slave to fail with Error ER_SLAVE_CONVERSION_FAILED ***
+******************************************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+*** Drop t4 ***
+DROP TABLE t4;
+*** Create t5 on slave ***
+STOP SLAVE;
+CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT, e DOUBLE,
+f DECIMAL(8,2))ENGINE='TokuDB';
+*** Create t5 on Master ***
+CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT, e BLOB,
+f FLOAT) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
+(2,'JOE',300.01,0,'b2b2',1.0000009);
+******************************************************************
+*** Expect slave to fail with Error ER_SLAVE_CONVERSION_FAILED ***
+******************************************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+*** Drop t5 ***
+DROP TABLE t5;
+*** Create t6 on slave ***
+STOP SLAVE;
+CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT)ENGINE='TokuDB';
+*** Create t6 on Master ***
+CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
+(2,'JOE',300.01,0);
+******************************************************************
+*** Expect slave to fail with Error ER_SLAVE_CONVERSION_FAILED ***
+******************************************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+*** Drop t6 ***
+include/rpl_reset.inc
+DROP TABLE t6;
+**** Diff Table Def End ****
+**** Extra Colums Start ****
+*** Create t7 on slave ***
+STOP SLAVE;
+CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e CHAR(20) DEFAULT 'Extra Column Testing')
+ENGINE='TokuDB';
+*** Create t7 on Master ***
+CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 b1b1 Kyle
+2 b1b1 JOE
+3 b1b1 QA
+*** Select from slave ***
+SELECT * FROM t7 ORDER BY a;
+a b c d e
+1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
+2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
+3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
+*** Drop t7 ***
+DROP TABLE t7;
+*** Create t8 on slave ***
+STOP SLAVE;
+CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e INT)ENGINE='TokuDB';
+*** Create t8 on Master ***
+CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+*** Drop t8 ***
+DROP TABLE t8;
+STOP SLAVE;
+CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP,
+e INT NOT NULL,
+f text not null,
+g text,
+h blob not null,
+i blob) ENGINE='TokuDB';
+*** Create t9 on Master ***
+CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+select * from t9;
+a b c d e f g h i
+1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
+2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
+3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
+DROP TABLE t9;
+*** Create t10 on slave ***
+STOP SLAVE;
+CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+c CHAR(5), e INT DEFAULT '1')ENGINE='TokuDB';
+*** Create t10 on Master ***
+CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+******************************************************************
+*** Expect slave to fail with Error ER_SLAVE_CONVERSION_FAILED ***
+******************************************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+*** Drop t10 ***
+DROP TABLE t10;
+*** Create t11 on slave ***
+STOP SLAVE;
+CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='TokuDB';
+*** Create t11 on Master ***
+CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+******************************************************************
+*** Expect slave to fail with Error ER_SLAVE_CONVERSION_FAILED ***
+******************************************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+*** Drop t11 ***
+DROP TABLE t11;
+*** Create t12 on slave ***
+STOP SLAVE;
+CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='TokuDB';
+*** Create t12 on Master ***
+CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t12 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ***
+SELECT * FROM t12 ORDER BY a;
+a b f c e
+1 b1b1b1b1b1b1b1b1 Kyle test 1
+2 b1b1b1b1b1b1b1b1 JOE test 1
+3 b1b1b1b1b1b1b1b1 QA test 1
+*** Drop t12 ***
+DROP TABLE t12;
+**** Extra Colums End ****
+*** BUG 22177 Start ***
+*** Create t13 on slave ***
+STOP SLAVE;
+CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
+d INT DEFAULT '1',
+e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='TokuDB';
+*** Create t13 on Master ***
+CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t13 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t13 ORDER BY a;
+a b c d e
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Drop t13 ***
+DROP TABLE t13;
+*** 22117 END ***
+*** Alter Master Table Testing Start ***
+*** Create t14 on slave ***
+STOP SLAVE;
+CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='TokuDB';
+*** Create t14 on Master ***
+CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Create t14a on slave ***
+STOP SLAVE;
+CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='TokuDB';
+*** Create t14a on Master ***
+CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14a () VALUES(1,@b1,'Kyle'),
+(2,@b1,'JOE'),
+(3,@b1,'QA');
+SELECT * FROM t14a ORDER BY c1;
+c1 c4 c5
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t14a ORDER BY c1;
+c1 c4 c5 c6 c7
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+STOP SLAVE;
+*** Master Drop c5 ***
+ALTER TABLE t14a DROP COLUMN c5;
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14a () VALUES(4,@b1),
+(5,@b1),
+(6,@b1);
+SELECT * FROM t14a ORDER BY c1;
+c1 c4
+1 b1b1b1b1b1b1b1b1
+2 b1b1b1b1b1b1b1b1
+3 b1b1b1b1b1b1b1b1
+4 b1b1b1b1b1b1b1b1
+5 b1b1b1b1b1b1b1b1
+6 b1b1b1b1b1b1b1b1
+*** Select on Slave ****
+SELECT * FROM t14a ORDER BY c1;
+c1 c4 c5 c6 c7
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+DROP TABLE t14a;
+*** connect to master and drop columns ***
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c4;
+*** Select from Master ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5
+1 Replication Testing Extra Col Kyle
+2 This Test Should work JOE
+3 If is does not, I will open a bug QA
+*** Select from Slave ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5 c6 c7
+1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
+2 This Test Should work JOE 1 CURRENT_TIMESTAMP
+3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
+*** Drop t14 ***
+DROP TABLE t14;
+*** Create t15 on slave ***
+STOP SLAVE;
+CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='TokuDB';
+*** Create t15 on Master ***
+CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5)) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051");
+call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060");
+call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535");
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add column on master that is a Extra on Slave ***
+ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
+********************************************************
+*** Expect slave to fail with Error ER_DUP_FIELDNAME ***
+********************************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1060]
+*** Try to insert in master ****
+INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
+5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
+*** Try to select from slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP
+*** DROP TABLE t15 ***
+DROP TABLE t15;
+*** Create t16 on slave ***
+STOP SLAVE;
+CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='TokuDB';
+*** Create t16 on Master ***
+CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5))ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add Partition on master ***
+ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
+INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c1)
+PARTITIONS 4 */
+*** Show table on Slave ****
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ `c6` int(11) DEFAULT '1',
+ `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`c1`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (c1)
+PARTITIONS 4 */
+*** DROP TABLE t16 ***
+DROP TABLE t16;
+*** Alter Master End ***
+*** Create t17 on slave ***
+STOP SLAVE;
+CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='TokuDB';
+*** Create t17 on Master ***
+CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='TokuDB';
+*** Start Slave ***
+include/rpl_reset.inc
+*** Master Data Insert ***
+INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
+******************************************************************
+*** Expect slave to fail with Error ER_SLAVE_CONVERSION_FAILED ***
+******************************************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+** DROP table t17 ***
+DROP TABLE t17;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_foreign_key_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_foreign_key_tokudb.result
new file mode 100644
index 00000000000..cdab171d413
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_foreign_key_tokudb.result
@@ -0,0 +1,58 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t1 (a INT AUTO_INCREMENT KEY) ENGINE=TokuDB;
+CREATE TABLE t2 (b INT AUTO_INCREMENT KEY, c INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=TokuDB;
+SET FOREIGN_KEY_CHECKS=0;
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL);
+INSERT INTO t2 VALUES (5,0);
+INSERT INTO t2 VALUES (NULL,LAST_INSERT_ID());
+SET FOREIGN_KEY_CHECKS=1;
+SELECT * FROM t1 ORDER BY a;
+a
+10
+11
+12
+13
+SELECT * FROM t2 ORDER BY b;
+b c
+5 0
+6 11
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1 ORDER BY a;
+a
+10
+11
+12
+13
+SELECT * FROM t2 ORDER BY b;
+b c
+5 0
+6 11
+SET TIMESTAMP=1000000000;
+CREATE TABLE t3 ( a INT UNIQUE );
+SET FOREIGN_KEY_CHECKS=0;
+INSERT INTO t3 VALUES (1),(1);
+Got one of the listed errors
+include/sync_slave_sql_with_master.inc
+SET FOREIGN_KEY_CHECKS=0;
+DROP TABLE IF EXISTS t1,t2,t3;
+SET FOREIGN_KEY_CHECKS=1;
+include/sync_slave_sql_with_master.inc
+create table t1 (b int primary key) engine = TokuDB;
+create table t2 (a int primary key, b int, foreign key (b) references t1(b))
+engine = TokuDB;
+insert into t1 set b=1;
+insert into t2 set a=1, b=1;
+set foreign_key_checks=0;
+delete from t1;
+must sync w/o a problem (could not with the buggy code)
+include/sync_slave_sql_with_master.inc
+select count(*) from t1 /* must be zero */;
+count(*)
+0
+drop table t2,t1;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_mixed_row_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_mixed_row_tokudb.result
new file mode 100644
index 00000000000..75cfb927a87
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_mixed_row_tokudb.result
@@ -0,0 +1,132 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE t4 (
+id INT(5) unsigned NOT NULL auto_increment,
+name varchar(15) NOT NULL default '',
+number varchar(35) NOT NULL default 'default',
+PRIMARY KEY (id),
+UNIQUE KEY unique_rec (name,number)
+) ENGINE=TokuDB;
+LOAD DATA
+INFILE '../../std_data/loaddata_pair.dat'
+REPLACE INTO TABLE t4
+(name,number);
+SELECT * FROM t4;
+id name number
+1 XXX 12345
+2 XXY 12345
+SELECT * FROM t4;
+id name number
+1 XXX 12345
+2 XXY 12345
+LOAD DATA
+INFILE '../../std_data/loaddata_pair.dat'
+REPLACE INTO TABLE t4
+(name,number);
+SELECT * FROM t4;
+id name number
+4 XXX 12345
+5 XXY 12345
+SELECT * FROM t4;
+id name number
+4 XXX 12345
+5 XXY 12345
+FLUSH LOGS;
+FLUSH LOGS;
+DROP DATABASE IF EXISTS mysqltest1;
+CREATE DATABASE mysqltest1;
+CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT);
+CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="TokuDB";
+SET AUTOCOMMIT = 0;
+-------- switch to slave --------
+ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
+SHOW CREATE TABLE mysqltest1.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+-------- switch to master --------
+INSERT INTO mysqltest1.t1 SET f1= 1;
+DROP TEMPORARY TABLE mysqltest1.tmp;
+ROLLBACK;
+SHOW CREATE TABLE mysqltest1.tmp;
+ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist
+######### Must return no rows here #########
+SELECT COUNT(*) FROM mysqltest1.t1;
+COUNT(*)
+0
+INSERT INTO mysqltest1.t1 SET f1= 2;
+CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT);
+ROLLBACK;
+SHOW CREATE TABLE mysqltest1.tmp2;
+Table Create Table
+tmp2 CREATE TEMPORARY TABLE `tmp2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+######### Must return no rows here #########
+SELECT COUNT(*) FROM mysqltest1.t1;
+COUNT(*)
+0
+-------- switch to slave --------
+SHOW CREATE TABLE mysqltest1.tmp;
+ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist
+SHOW CREATE TABLE mysqltest1.tmp2;
+ERROR 42S02: Table 'mysqltest1.tmp2' doesn't exist
+######### t1 has two rows here: the transaction not rolled back since t1 uses MyISAM #########
+SELECT COUNT(*) FROM mysqltest1.t1;
+COUNT(*)
+2
+FLUSH LOGS;
+-------- switch to master --------
+FLUSH LOGS;
+DROP DATABASE mysqltest1;
+End of 5.1 tests
+#
+# Bug#39675 rename tables on innodb tables with pending
+# transactions causes slave data issue.
+#
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+CREATE TABLE t1 (
+id INT PRIMARY KEY auto_increment,
+b INT DEFAULT NULL
+) ENGINE=TokuDB;
+CREATE TABLE t2 (
+id INT PRIMARY KEY auto_increment,
+b INT DEFAULT NULL
+) ENGINE=TokuDB;
+INSERT INTO t1 (b) VALUES (1),(2),(3);
+BEGIN;
+INSERT INTO t1(b) VALUES (4);
+-------- switch to master1 --------
+RENAME TABLE t1 TO t3, t2 TO t1;;
+-------- switch to master --------
+COMMIT;
+-------- switch to master1 --------
+-------- switch to master --------
+SELECT * FROM t1;
+id b
+SELECT * FROM t3;
+id b
+1 1
+2 2
+3 3
+4 4
+-------- switch to slave --------
+SELECT * FROM t1;
+id b
+SELECT * FROM t3;
+id b
+1 1
+2 2
+3 3
+4 4
+-------- switch to master --------
+DROP TABLE t1;
+DROP TABLE t3;
+End of 6.0 tests
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result
new file mode 100644
index 00000000000..59bd2585395
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result
@@ -0,0 +1,210 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET SQL_LOG_BIN= 0;
+CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t4(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+SET SQL_LOG_BIN= 1;
+CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
+`c` INT DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT, `b` DATE DEFAULT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT, `b` DATE DEFAULT '0000-00-00',
+`c` INT DEFAULT 500,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t4(`a` INT, `b` DATE DEFAULT '0000-00-00',
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+************* EXECUTION WITH INSERTS *************
+INSERT INTO t1(a,b,c) VALUES (1, null, 1);
+INSERT INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
+INSERT INTO t1(a,b) VALUES (3, null);
+INSERT INTO t1(a,c) VALUES (4, 4);
+INSERT INTO t1(a) VALUES (5);
+INSERT INTO t2(a,b) VALUES (1, null);
+INSERT INTO t2(a,b) VALUES (2,'1111-11-11');
+INSERT INTO t2(a) VALUES (3);
+INSERT INTO t3(a,b) VALUES (1, null);
+INSERT INTO t3(a,b) VALUES (2,'1111-11-11');
+INSERT INTO t3(a) VALUES (3);
+INSERT INTO t4(a,b,c) VALUES (1, null, 1);
+INSERT INTO t4(a,b,c) VALUES (2,'1111-11-11', 2);
+INSERT INTO t4(a,b) VALUES (3, null);
+INSERT INTO t4(a,c) VALUES (4, 4);
+INSERT INTO t4(a) VALUES (5);
+************* SHOWING THE RESULT SETS WITH INSERTS *************
+include/sync_slave_sql_with_master.inc
+TABLES t1 and t2 must be equal otherwise an error will be thrown.
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
+TABLES t2 and t3 must be different.
+SELECT * FROM t3 ORDER BY a;
+a b
+1 NULL
+2 1111-11-11
+3 NULL
+SELECT * FROM t3 ORDER BY a;
+a b c
+1 NULL 500
+2 1111-11-11 500
+3 NULL 500
+SELECT * FROM t4 ORDER BY a;
+a b c
+1 NULL 1
+2 1111-11-11 2
+3 NULL NULL
+4 NULL 4
+5 NULL NULL
+SELECT * FROM t4 ORDER BY a;
+a b
+1 NULL
+2 1111-11-11
+3 NULL
+4 NULL
+5 NULL
+************* EXECUTION WITH UPDATES and REPLACES *************
+DELETE FROM t1;
+INSERT INTO t1(a,b,c) VALUES (1,'1111-11-11', 1);
+REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
+UPDATE t1 set b= NULL, c= 300 where a= 1;
+REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
+************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
+include/sync_slave_sql_with_master.inc
+TABLES t1 and t2 must be equal otherwise an error will be thrown.
+include/diff_tables.inc [master:t1, slave:t1]
+************* CLEANING *************
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+include/sync_slave_sql_with_master.inc
+SET SQL_LOG_BIN= 0;
+CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL,
+PRIMARY KEY (`a`)) ENGINE= Innodb;
+SET SQL_LOG_BIN= 1;
+CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT b'01', `c` BIT DEFAULT NULL,
+PRIMARY KEY (`a`)) ENGINE= Innodb;
+************* EXECUTION WITH INSERTS *************
+INSERT INTO t1(a,b,c) VALUES (1, null, b'01');
+INSERT INTO t1(a,b,c) VALUES (2,b'00', b'01');
+INSERT INTO t1(a,b) VALUES (3, null);
+INSERT INTO t1(a,c) VALUES (4, b'01');
+INSERT INTO t1(a) VALUES (5);
+************* SHOWING THE RESULT SETS WITH INSERTS *************
+TABLES t1 and t2 must be different.
+include/sync_slave_sql_with_master.inc
+SELECT a,b+0,c+0 FROM t1 ORDER BY a;
+a b+0 c+0
+1 NULL 1
+2 0 1
+3 NULL NULL
+4 NULL 1
+5 NULL NULL
+SELECT a,b+0,c+0 FROM t1 ORDER BY a;
+a b+0 c+0
+1 NULL 1
+2 0 1
+3 NULL NULL
+4 NULL 1
+5 NULL NULL
+************* EXECUTION WITH UPDATES and REPLACES *************
+DELETE FROM t1;
+INSERT INTO t1(a,b,c) VALUES (1,b'00', b'01');
+REPLACE INTO t1(a,b,c) VALUES (2,b'00',b'01');
+UPDATE t1 set b= NULL, c= b'00' where a= 1;
+REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
+************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
+TABLES t1 and t2 must be equal otherwise an error will be thrown.
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+################################################################################
+# NULL ---> NOT NULL (STRICT MODE)
+# UNCOMMENT THIS AFTER FIXING BUG#43992
+################################################################################
+################################################################################
+# NULL ---> NOT NULL (NON-STRICT MODE)
+################################################################################
+SET SQL_LOG_BIN= 0;
+CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+SET SQL_LOG_BIN= 1;
+CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT NOT NULL,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t2(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
+`c` INT DEFAULT 500,
+PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
+************* EXECUTION WITH INSERTS *************
+INSERT INTO t1(a) VALUES (1);
+INSERT INTO t1(a, b) VALUES (2, NULL);
+INSERT INTO t1(a, b) VALUES (3, 1);
+INSERT INTO t2(a) VALUES (1);
+INSERT INTO t2(a, b) VALUES (2, NULL);
+INSERT INTO t2(a, b) VALUES (3, 1);
+INSERT INTO t3(a) VALUES (1);
+INSERT INTO t3(a, b) VALUES (2, NULL);
+INSERT INTO t3(a, b) VALUES (3, 1);
+INSERT INTO t3(a, b) VALUES (4, 1);
+REPLACE INTO t3(a, b) VALUES (5, null);
+REPLACE INTO t3(a, b) VALUES (3, null);
+UPDATE t3 SET b = NULL where a = 4;
+************* SHOWING THE RESULT SETS *************
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1 ORDER BY a;
+a b
+1 NULL
+2 NULL
+3 1
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 0 0
+2 0 0
+3 1 0
+SELECT * FROM t2 ORDER BY a;
+a b
+1 NULL
+2 NULL
+3 1
+SELECT * FROM t2 ORDER BY a;
+a b c
+1 0 NULL
+2 0 NULL
+3 1 NULL
+SELECT * FROM t3 ORDER BY a;
+a b
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+5 NULL
+SELECT * FROM t3 ORDER BY a;
+a b c
+1 0 500
+2 0 500
+3 0 500
+4 0 500
+5 0 500
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result
new file mode 100644
index 00000000000..7c76cccd4d1
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result
@@ -0,0 +1,73 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+call mtr.add_suppression('Slave: Error dropping database');
+include/stop_slave.inc
+start slave;
+include/sync_slave_sql_with_master.inc
+stop slave sql_thread;
+insert into test0.benchmark set state='slave is processing load';
+start slave sql_thread;
+use test0;
+insert into benchmark set state='slave ends load';
+use test;
+select * from test1.benchmark into outfile 'benchmark.out';
+select ts from test0.benchmark where state like 'master started load' into @m_0;
+select ts from test0.benchmark where state like 'master ends load' into @m_1;
+select ts from test0.benchmark where state like 'slave takes on load' into @s_m0;
+select ts from test0.benchmark where state like 'slave is supposed to finish with load' into @s_m1;
+select ts from test0.benchmark where state like 'slave ends load' into @s_1;
+select ts from test0.benchmark where state like 'slave is processing load' into @s_0;
+select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta.out';
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test15.ti_nk, slave:test15.ti_nk]
+include/diff_tables.inc [master:test15.ti_wk, slave:test15.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test14.ti_nk, slave:test14.ti_nk]
+include/diff_tables.inc [master:test14.ti_wk, slave:test14.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test13.ti_nk, slave:test13.ti_nk]
+include/diff_tables.inc [master:test13.ti_wk, slave:test13.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test12.ti_nk, slave:test12.ti_nk]
+include/diff_tables.inc [master:test12.ti_wk, slave:test12.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test11.ti_nk, slave:test11.ti_nk]
+include/diff_tables.inc [master:test11.ti_wk, slave:test11.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test10.ti_nk, slave:test10.ti_nk]
+include/diff_tables.inc [master:test10.ti_wk, slave:test10.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test9.ti_nk, slave:test9.ti_nk]
+include/diff_tables.inc [master:test9.ti_wk, slave:test9.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test8.ti_nk, slave:test8.ti_nk]
+include/diff_tables.inc [master:test8.ti_wk, slave:test8.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test7.ti_nk, slave:test7.ti_nk]
+include/diff_tables.inc [master:test7.ti_wk, slave:test7.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test6.ti_nk, slave:test6.ti_nk]
+include/diff_tables.inc [master:test6.ti_wk, slave:test6.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test5.ti_nk, slave:test5.ti_nk]
+include/diff_tables.inc [master:test5.ti_wk, slave:test5.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test4.ti_nk, slave:test4.ti_nk]
+include/diff_tables.inc [master:test4.ti_wk, slave:test4.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test3.ti_nk, slave:test3.ti_nk]
+include/diff_tables.inc [master:test3.ti_wk, slave:test3.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test2.ti_nk, slave:test2.ti_nk]
+include/diff_tables.inc [master:test2.ti_wk, slave:test2.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test1.ti_nk, slave:test1.ti_nk]
+include/diff_tables.inc [master:test1.ti_wk, slave:test1.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:test0.ti_nk, slave:test0.ti_nk]
+include/diff_tables.inc [master:test0.ti_wk, slave:test0.ti_wk]
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result
new file mode 100644
index 00000000000..3021675bbda
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result
@@ -0,0 +1,22 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+Warnings:
+Note 1753 slave_transaction_retries is not supported in multi-threaded slave mode. In the event of a transient failure, the slave will not retry the transaction and will stop.
+[connection master]
+drop table if exists t;
+create table t (a bigint not null, primary key(a)) engine=tokudb;
+insert into t values (1);
+insert into t values (2),(3);
+insert into t values (4);
+include/diff_tables.inc [master:test.t, slave:test.t]
+delete from t where a=2;
+select unix_timestamp() into @tstart;
+select unix_timestamp() into @tend;
+select @tend-@tstart <= 5;
+@tend-@tstart <= 5
+1
+include/diff_tables.inc [master:test.t, slave:test.t]
+drop table if exists t;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result
new file mode 100644
index 00000000000..39a6856d684
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result
@@ -0,0 +1,32 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+Warnings:
+Note 1753 slave_transaction_retries is not supported in multi-threaded slave mode. In the event of a transient failure, the slave will not retry the transaction and will stop.
+[connection master]
+drop table if exists t;
+create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
+insert into t values (1,0);
+insert into t values (2,0),(3,0);
+insert into t values (4,0);
+include/diff_tables.inc [master:test.t, slave:test.t]
+update t set b=b+1 where a=2;
+update t set b=b+2 where a=1;
+update t set b=b+3 where a=4;
+update t set b=b+4 where a=3;
+update t set b=b+1 where 1<=a and a<=3;
+select unix_timestamp() into @tstart;
+select unix_timestamp() into @tend;
+select @tend-@tstart <= 5;
+@tend-@tstart <= 5
+1
+select * from t;
+a b
+1 3
+2 2
+3 5
+4 3
+include/diff_tables.inc [master:test.t, slave:test.t]
+drop table if exists t;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result
new file mode 100644
index 00000000000..314ccaedaf7
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result
@@ -0,0 +1,19 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+Warnings:
+Note 1753 slave_transaction_retries is not supported in multi-threaded slave mode. In the event of a transient failure, the slave will not retry the transaction and will stop.
+[connection master]
+drop table if exists t;
+create table t (a bigint not null, primary key(a)) engine=tokudb;
+select unix_timestamp() into @tstart;
+insert into t values (1);
+insert into t values (2),(3);
+insert into t values (4);
+select unix_timestamp()-@tstart <= 10;
+unix_timestamp()-@tstart <= 10
+1
+include/diff_tables.inc [master:test.t, slave:test.t]
+drop table if exists t;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result
new file mode 100644
index 00000000000..de9f1fbc122
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result
@@ -0,0 +1,150 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+use test;
+CREATE TABLE test.regular_tbl(id INT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+CURRENT_TIMESTAMP, user CHAR(255), uuidf VARBINARY(255),
+fkid INT, filler VARCHAR(255),
+PRIMARY KEY(id))
+ENGINE=TokuDB;
+CREATE TABLE test.byrange_tbl(id INT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+CURRENT_TIMESTAMP, user CHAR(255), uuidf VARBINARY(255),
+fkid INT, filler VARCHAR(255),
+PRIMARY KEY(id))
+ENGINE=TokuDB
+PARTITION BY RANGE(id)
+(PARTITION pa100 values less than (100),
+PARTITION paMax values less than MAXVALUE);
+CREATE PROCEDURE test.proc_norm()
+BEGIN
+DECLARE ins_count INT DEFAULT 99;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+SET cur_user= "current_user@localhost";
+SET local_uuid= "36774b1c-6374-11df-a2ca-0ef7ac7a5f6c";
+WHILE ins_count > 0 DO
+# Must use local variables for statment based replication
+INSERT INTO test.regular_tbl VALUES (NULL, NOW(), cur_user, local_uuid,
+ins_count,'Non partitioned table! Going to test replication for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+END|
+CREATE PROCEDURE test.proc_byrange()
+BEGIN
+DECLARE ins_count INT DEFAULT 200;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+SET cur_user= "current_user@localhost";
+SET local_uuid= "36774b1c-6374-11df-a2ca-0ef7ac7a5f6c";
+WHILE ins_count > 0 DO
+INSERT INTO test.byrange_tbl VALUES (NULL, NOW(), cur_user, local_uuid,
+ins_count + 100,'Partitioned table! Going to test replication for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+END|
+CALL test.proc_norm();
+SELECT count(*) as "Master regular" FROM test.regular_tbl;
+Master regular
+99
+CALL test.proc_byrange();
+SELECT count(*) as "Master byrange" FROM test.byrange_tbl;
+Master byrange
+200
+show create table test.byrange_tbl;
+Table Create Table
+byrange_tbl CREATE TABLE `byrange_tbl` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user` char(255) DEFAULT NULL,
+ `uuidf` varbinary(255) DEFAULT NULL,
+ `fkid` int(11) DEFAULT NULL,
+ `filler` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=TokuDB AUTO_INCREMENT=201 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (id)
+(PARTITION pa100 VALUES LESS THAN (100) ENGINE = TokuDB,
+ PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */
+show create table test.regular_tbl;
+Table Create Table
+regular_tbl CREATE TABLE `regular_tbl` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user` char(255) DEFAULT NULL,
+ `uuidf` varbinary(255) DEFAULT NULL,
+ `fkid` int(11) DEFAULT NULL,
+ `filler` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=TokuDB AUTO_INCREMENT=100 DEFAULT CHARSET=latin1
+ALTER TABLE test.byrange_tbl EXCHANGE PARTITION pa100 WITH TABLE test.regular_tbl;
+SELECT * FROM test.byrange_tbl ORDER BY fkid LIMIT 2;
+id dt user uuidf fkid filler
+99 date-time USER UUID 1 Non partitioned table! Going to test replication for MySQL
+98 date-time USER UUID 2 Non partitioned table! Going to test replication for MySQL
+SELECT * FROM test.byrange_tbl ORDER BY fkid DESC LIMIT 2;
+id dt user uuidf fkid filler
+100 date-time USER UUID 201 Partitioned table! Going to test replication for MySQL
+101 date-time USER UUID 200 Partitioned table! Going to test replication for MySQL
+SELECT * FROM test.regular_tbl ORDER BY fkid LIMIT 2;
+id dt user uuidf fkid filler
+99 date-time USER UUID 202 Partitioned table! Going to test replication for MySQL
+98 date-time USER UUID 203 Partitioned table! Going to test replication for MySQL
+SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
+id dt user uuidf fkid filler
+1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
+2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
+show create table test.byrange_tbl;
+Table Create Table
+byrange_tbl CREATE TABLE `byrange_tbl` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user` char(255) DEFAULT NULL,
+ `uuidf` varbinary(255) DEFAULT NULL,
+ `fkid` int(11) DEFAULT NULL,
+ `filler` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=TokuDB AUTO_INCREMENT=201 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (id)
+(PARTITION pa100 VALUES LESS THAN (100) ENGINE = TokuDB,
+ PARTITION paMax VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */
+show create table test.regular_tbl;
+Table Create Table
+regular_tbl CREATE TABLE `regular_tbl` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user` char(255) DEFAULT NULL,
+ `uuidf` varbinary(255) DEFAULT NULL,
+ `fkid` int(11) DEFAULT NULL,
+ `filler` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=TokuDB AUTO_INCREMENT=100 DEFAULT CHARSET=latin1
+SELECT count(*) "Slave norm" FROM test.regular_tbl;
+Slave norm
+99
+SELECT count(*) "Slave byrange" FROM test.byrange_tbl;
+Slave byrange
+200
+SELECT * FROM test.byrange_tbl ORDER BY fkid LIMIT 2;
+id dt user uuidf fkid filler
+99 date-time USER UUID 1 Non partitioned table! Going to test replication for MySQL
+98 date-time USER UUID 2 Non partitioned table! Going to test replication for MySQL
+SELECT * FROM test.byrange_tbl ORDER BY fkid DESC LIMIT 2;
+id dt user uuidf fkid filler
+100 date-time USER UUID 201 Partitioned table! Going to test replication for MySQL
+101 date-time USER UUID 200 Partitioned table! Going to test replication for MySQL
+SELECT * FROM test.regular_tbl ORDER BY fkid LIMIT 2;
+id dt user uuidf fkid filler
+99 date-time USER UUID 202 Partitioned table! Going to test replication for MySQL
+98 date-time USER UUID 203 Partitioned table! Going to test replication for MySQL
+SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
+id dt user uuidf fkid filler
+1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
+2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
+DROP PROCEDURE test.proc_norm;
+DROP PROCEDURE test.proc_byrange;
+DROP TABLE test.regular_tbl;
+DROP TABLE test.byrange_tbl;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result
new file mode 100644
index 00000000000..20508747c25
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result
@@ -0,0 +1,27 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SHOW VARIABLES LIKE 'relay_log_space_limit';
+Variable_name Value
+relay_log_space_limit 0
+CREATE TABLE t1 (name varchar(64), age smallint(3))ENGINE=TokuDB;
+INSERT INTO t1 SET name='Andy', age=31;
+INSERT INTO t1 SET name='Jacob', age=2;
+INSERT INTO t1 SET name='Caleb', age=1;
+ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY,
+ALGORITHM=COPY;
+SELECT * FROM t1 ORDER BY id;
+name age id
+Andy 31 00000001
+Jacob 2 00000002
+Caleb 1 00000003
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1 ORDER BY id;
+name age id
+Andy 31 00000001
+Jacob 2 00000002
+Caleb 1 00000003
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result
new file mode 100644
index 00000000000..5bff2ac389e
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result
@@ -0,0 +1,679 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB' ;
+SELECT * FROM t1;
+C1 C2
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1;
+C1 C2
+INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X');
+INSERT INTO t1 VALUES ('A','C'), ('X','Z'), ('A','A');
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A A
+A B
+A C
+X X
+X Y
+X Z
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A A
+A B
+A C
+X X
+X Y
+X Z
+DELETE FROM t1 WHERE C1 = C2;
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A C
+X Y
+X Z
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A C
+X Y
+X Z
+UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A I
+X Y
+X Z
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A I
+X Y
+X Z
+include/assert.inc [Counter for COM_COMMIT is consistent with the number of actual commits]
+include/assert.inc [Counter for COM_INSERT is consistent with the number of actual inserts]
+include/assert.inc [Counter for COM_DELETE is consistent with the number of actual deletes]
+include/assert.inc [Counter for COM_UPDATE is consistent with the number of actual updates]
+UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
+SELECT * FROM t1 ORDER BY c1,c2;
+C1 C2
+A B
+A I
+X Y
+X Z
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1 ORDER BY c1,c2;
+C1 C2
+A B
+A I
+X Y
+X Z
+CREATE TABLE t2 (c1 INT, c12 char(1), c2 INT, PRIMARY KEY (c1)) ENGINE = 'INNODB' ;
+INSERT INTO t2
+VALUES (1,'A',2), (2,'A',4), (3,'A',9), (4,'A',15), (5,'A',25),
+(6,'A',35), (7,'A',50), (8,'A',64), (9,'A',81);
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 2
+2 A 4
+3 A 9
+4 A 15
+5 A 25
+6 A 35
+7 A 50
+8 A 64
+9 A 81
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+2 A 4
+3 A 9
+5 A 25
+8 A 64
+9 A 81
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 2
+2 A 4
+3 A 9
+4 A 15
+5 A 25
+6 A 35
+7 A 50
+8 A 64
+9 A 81
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+2 A 4
+3 A 9
+5 A 25
+8 A 64
+9 A 81
+UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+DELETE FROM t2 WHERE c1 % 4 = 0;
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+5 A 25
+6 A 36
+7 A 49
+9 A 81
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+5 A 25
+6 A 36
+7 A 49
+9 A 81
+UPDATE t2 SET c12='X';
+CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIMARY KEY (pk1,pk2)) ENGINE = 'INNODB' ;
+INSERT INTO t3 VALUES ('A','B',1,'B',1), ('X','Y',2,'B',1), ('X','X',3,'B',1);
+INSERT INTO t3 VALUES ('A','C',1,'B',2), ('X','Z',2,'B',2), ('A','A',3,'B',2);
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A A 3 B 2
+A B 1 B 1
+A C 1 B 2
+X X 3 B 1
+X Y 2 B 1
+X Z 2 B 2
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A A 3 B 2
+A B 1 B 1
+A C 1 B 2
+X X 3 B 1
+X Y 2 B 1
+X Z 2 B 2
+DELETE FROM t3 WHERE C1 = C2;
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A C 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A C 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A I 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A I 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT) ENGINE = 'INNODB' ;
+INSERT INTO t6 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
+INSERT INTO t6 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+X X 3
+A C 4
+X Z 5
+A A 6
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+X X 3
+A C 4
+X Z 5
+A A 6
+DELETE FROM t6 WHERE C1 = C2;
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A C 4
+X Z 5
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A C 4
+X Z 5
+UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A I 4
+X Z 5
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A I 4
+X Z 5
+CREATE TABLE t5 (C1 CHAR(1), C2 CHAR(1), C3 INT PRIMARY KEY) ENGINE = 'INNODB' ;
+INSERT INTO t5 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
+INSERT INTO t5 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
+UPDATE t5,t2,t3 SET t5.C2='Q', t2.c12='R', t3.C3 ='S' WHERE t5.C1 = t2.c12 AND t5.C1 = t3.C1;
+SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
+C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2
+X Q 2 1 R 1 X Y 2 S 1
+X Q 2 1 R 1 X Z 2 S 2
+X Q 2 2 R 4 X Y 2 S 1
+X Q 2 2 R 4 X Z 2 S 2
+X Q 2 3 R 9 X Y 2 S 1
+X Q 2 3 R 9 X Z 2 S 2
+X Q 2 5 R 25 X Y 2 S 1
+X Q 2 5 R 25 X Z 2 S 2
+X Q 2 6 R 36 X Y 2 S 1
+X Q 2 6 R 36 X Z 2 S 2
+X Q 2 7 R 49 X Y 2 S 1
+X Q 2 7 R 49 X Z 2 S 2
+X Q 2 9 R 81 X Y 2 S 1
+X Q 2 9 R 81 X Z 2 S 2
+X Q 3 1 R 1 X Y 2 S 1
+X Q 3 1 R 1 X Z 2 S 2
+X Q 3 2 R 4 X Y 2 S 1
+X Q 3 2 R 4 X Z 2 S 2
+X Q 3 3 R 9 X Y 2 S 1
+X Q 3 3 R 9 X Z 2 S 2
+X Q 3 5 R 25 X Y 2 S 1
+X Q 3 5 R 25 X Z 2 S 2
+X Q 3 6 R 36 X Y 2 S 1
+X Q 3 6 R 36 X Z 2 S 2
+X Q 3 7 R 49 X Y 2 S 1
+X Q 3 7 R 49 X Z 2 S 2
+X Q 3 9 R 81 X Y 2 S 1
+X Q 3 9 R 81 X Z 2 S 2
+X Q 5 1 R 1 X Y 2 S 1
+X Q 5 1 R 1 X Z 2 S 2
+X Q 5 2 R 4 X Y 2 S 1
+X Q 5 2 R 4 X Z 2 S 2
+X Q 5 3 R 9 X Y 2 S 1
+X Q 5 3 R 9 X Z 2 S 2
+X Q 5 5 R 25 X Y 2 S 1
+X Q 5 5 R 25 X Z 2 S 2
+X Q 5 6 R 36 X Y 2 S 1
+X Q 5 6 R 36 X Z 2 S 2
+X Q 5 7 R 49 X Y 2 S 1
+X Q 5 7 R 49 X Z 2 S 2
+X Q 5 9 R 81 X Y 2 S 1
+X Q 5 9 R 81 X Z 2 S 2
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
+C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2
+X Q 2 1 R 1 X Y 2 S 1
+X Q 2 1 R 1 X Z 2 S 2
+X Q 2 2 R 4 X Y 2 S 1
+X Q 2 2 R 4 X Z 2 S 2
+X Q 2 3 R 9 X Y 2 S 1
+X Q 2 3 R 9 X Z 2 S 2
+X Q 2 5 R 25 X Y 2 S 1
+X Q 2 5 R 25 X Z 2 S 2
+X Q 2 6 R 36 X Y 2 S 1
+X Q 2 6 R 36 X Z 2 S 2
+X Q 2 7 R 49 X Y 2 S 1
+X Q 2 7 R 49 X Z 2 S 2
+X Q 2 9 R 81 X Y 2 S 1
+X Q 2 9 R 81 X Z 2 S 2
+X Q 3 1 R 1 X Y 2 S 1
+X Q 3 1 R 1 X Z 2 S 2
+X Q 3 2 R 4 X Y 2 S 1
+X Q 3 2 R 4 X Z 2 S 2
+X Q 3 3 R 9 X Y 2 S 1
+X Q 3 3 R 9 X Z 2 S 2
+X Q 3 5 R 25 X Y 2 S 1
+X Q 3 5 R 25 X Z 2 S 2
+X Q 3 6 R 36 X Y 2 S 1
+X Q 3 6 R 36 X Z 2 S 2
+X Q 3 7 R 49 X Y 2 S 1
+X Q 3 7 R 49 X Z 2 S 2
+X Q 3 9 R 81 X Y 2 S 1
+X Q 3 9 R 81 X Z 2 S 2
+X Q 5 1 R 1 X Y 2 S 1
+X Q 5 1 R 1 X Z 2 S 2
+X Q 5 2 R 4 X Y 2 S 1
+X Q 5 2 R 4 X Z 2 S 2
+X Q 5 3 R 9 X Y 2 S 1
+X Q 5 3 R 9 X Z 2 S 2
+X Q 5 5 R 25 X Y 2 S 1
+X Q 5 5 R 25 X Z 2 S 2
+X Q 5 6 R 36 X Y 2 S 1
+X Q 5 6 R 36 X Z 2 S 2
+X Q 5 7 R 49 X Y 2 S 1
+X Q 5 7 R 49 X Z 2 S 2
+X Q 5 9 R 81 X Y 2 S 1
+X Q 5 9 R 81 X Z 2 S 2
+SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY';
+CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = 'INNODB' ;
+INSERT INTO t4 SET C1 = 1;
+SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+C1 HEX(B1) HEX(B2)
+1 NULL 0
+include/sync_slave_sql_with_master.inc
+SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+C1 HEX(B1) HEX(B2)
+1 NULL 0
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'INNODB' ;
+include/sync_slave_sql_with_master.inc
+--- on slave: original values ---
+INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
+SELECT * FROM t7 ORDER BY C1;
+C1 C2
+1 3
+2 6
+3 9
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+--- on master: new values inserted ---
+INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
+SELECT * FROM t7 ORDER BY C1;
+C1 C2
+1 2
+2 4
+3 6
+include/sync_slave_sql_with_master.inc
+set @@global.slave_exec_mode= default;
+--- on slave: old values should be overwritten by replicated values ---
+SELECT * FROM t7 ORDER BY C1;
+C1 C2
+1 2
+2 4
+3 6
+--- on master ---
+CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = 'INNODB' ;
+INSERT INTO t8 VALUES (99,99,99);
+INSERT INTO t8 VALUES (99,22,33);
+ERROR 23000: Duplicate entry '99' for key 'PRIMARY'
+INSERT INTO t8 VALUES (11,99,33);
+ERROR 23000: Duplicate entry '99' for key 'b'
+INSERT INTO t8 VALUES (11,22,99);
+ERROR 23000: Duplicate entry '99' for key 'c'
+SELECT * FROM t8 ORDER BY a;
+a b c
+99 99 99
+include/sync_slave_sql_with_master.inc
+--- on slave ---
+SELECT * FROM t8 ORDER BY a;
+a b c
+99 99 99
+INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
+SELECT * FROM t8 ORDER BY a;
+a b c
+1 2 3
+2 4 6
+3 6 9
+99 99 99
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+--- on master ---
+INSERT INTO t8 VALUES (2,4,8);
+include/sync_slave_sql_with_master.inc
+set @@global.slave_exec_mode= default;
+--- on slave ---
+SELECT * FROM t8 ORDER BY a;
+a b c
+1 2 3
+2 4 8
+3 6 9
+99 99 99
+**** Test for BUG#31552 ****
+**** On Master ****
+DELETE FROM t1;
+include/sync_slave_sql_with_master.inc
+include/rpl_reset.inc
+**** On Master ****
+INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
+**** On Master ****
+include/sync_slave_sql_with_master.inc
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+DELETE FROM t1 WHERE C1 = 'L';
+DELETE FROM t1;
+SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
+COUNT(*) 0
+include/sync_slave_sql_with_master.inc
+set @@global.slave_exec_mode= default;
+include/check_slave_is_running.inc
+SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
+COUNT(*) 0
+**** Test for BUG#37076 ****
+**** On Master ****
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
+INSERT INTO t1 VALUES(
+'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
+**** On Slave ****
+include/sync_slave_sql_with_master.inc
+SELECT * FROM t1;
+a b c
+2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
+include/sync_slave_sql_with_master.inc
+CREATE TABLE t1 (i INT NOT NULL,
+c CHAR(16) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'INNODB' ;
+CREATE TABLE t2 (i INT NOT NULL,
+c CHAR(16) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'INNODB' ;
+include/sync_slave_sql_with_master.inc
+ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t3 (i INT NOT NULL,
+c CHAR(128) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'INNODB' ;
+include/sync_slave_sql_with_master.inc
+ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t4 (i INT NOT NULL,
+c CHAR(128) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'INNODB' ;
+CREATE TABLE t5 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'INNODB' ;
+include/sync_slave_sql_with_master.inc
+ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t6 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'INNODB' ;
+include/sync_slave_sql_with_master.inc
+ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t7 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'INNODB' ;
+SET @saved_slave_type_conversions = @@slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
+[expecting slave to replicate correctly]
+INSERT INTO t1 VALUES (1, "", 1);
+INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+[expecting slave to replicate correctly]
+INSERT INTO t2 VALUES (1, "", 1);
+INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t2, slave:t2]
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032");
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+include/rpl_reset.inc
+[expecting slave to replicate correctly]
+INSERT INTO t4 VALUES (1, "", 1);
+INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t4, slave:t4]
+[expecting slave to stop]
+INSERT INTO t5 VALUES (1, "", 1);
+INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
+include/wait_for_slave_sql_error.inc [errno=1677]
+include/rpl_reset.inc
+[expecting slave to stop]
+INSERT INTO t6 VALUES (1, "", 1);
+INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
+include/wait_for_slave_sql_error.inc [errno=1677]
+include/rpl_reset.inc
+[expecting slave to replicate correctly]
+INSERT INTO t7 VALUES (1, "", 1);
+INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t7, slave:t7]
+drop table t1, t2, t3, t4, t5, t6, t7;
+include/sync_slave_sql_with_master.inc
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='INNODB' ;
+INSERT INTO t1 VALUES (1), (2), (3);
+UPDATE t1 SET a = 10;
+ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
+INSERT INTO t1 VALUES (4);
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+drop table t1;
+include/sync_slave_sql_with_master.inc
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (
+`pk` int(11) NOT NULL AUTO_INCREMENT,
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`date_key` date NOT NULL,
+`date_nokey` date NOT NULL,
+`time_key` time NOT NULL,
+`time_nokey` time NOT NULL,
+`datetime_key` datetime NOT NULL,
+`datetime_nokey` datetime NOT NULL,
+`varchar_key` varchar(1) NOT NULL,
+`varchar_nokey` varchar(1) NOT NULL,
+PRIMARY KEY (`pk`),
+KEY `int_key` (`int_key`),
+KEY `date_key` (`date_key`),
+KEY `time_key` (`time_key`),
+KEY `datetime_key` (`datetime_key`),
+KEY `varchar_key` (`varchar_key`)
+) ENGINE='INNODB' ;
+INSERT INTO t1 VALUES (1,8,5,'0000-00-00','0000-00-00','10:37:38','10:37:38','0000-00-00 00:00:00','0000-00-00 00:00:00','p','p'),(2,0,9,'0000-00-00','0000-00-00','00:00:00','00:00:00','2007-10-14 00:00:00','2007-10-14 00:00:00','d','d');
+CREATE TABLE t2 (
+`pk` int(11) NOT NULL AUTO_INCREMENT,
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`date_key` date NOT NULL,
+`date_nokey` date NOT NULL,
+`time_key` time NOT NULL,
+`time_nokey` time NOT NULL,
+`datetime_key` datetime NOT NULL,
+`datetime_nokey` datetime NOT NULL,
+`varchar_key` varchar(1) NOT NULL,
+`varchar_nokey` varchar(1) NOT NULL,
+PRIMARY KEY (`pk`),
+KEY `int_key` (`int_key`),
+KEY `date_key` (`date_key`),
+KEY `time_key` (`time_key`),
+KEY `datetime_key` (`datetime_key`),
+KEY `varchar_key` (`varchar_key`)
+) ENGINE='INNODB' ;
+INSERT INTO t2 VALUES (1,1,6,'2005-12-23','2005-12-23','02:24:28','02:24:28','0000-00-00 00:00:00','0000-00-00 00:00:00','g','g'),(2,0,3,'2009-09-14','2009-09-14','00:00:00','00:00:00','2000-01-30 16:39:40','2000-01-30 16:39:40','q','q'),(3,0,3,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','c','c'),(4,1,6,'2007-03-29','2007-03-29','15:49:00','15:49:00','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(5,4,0,'2002-12-04','2002-12-04','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','o','o'),(6,9,0,'2005-01-28','2005-01-28','00:00:00','00:00:00','2001-05-18 00:00:00','2001-05-18 00:00:00','w','w'),(7,6,0,'0000-00-00','0000-00-00','06:57:25','06:57:25','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(8,0,0,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','z','z'),(9,4,6,'2006-08-15','2006-08-15','00:00:00','00:00:00','2002-04-12 14:44:25','2002-04-12 14:44:25','j','j'),(10,0,5,'2006-12-20','2006-12-20','10:13:53','10:13:53','2008-07-22 00:00:00','2008-07-22 00:00:00','y','y'),(11,9,7,'0000-00-00','0000-00-00','00:00:00','00:00:00','2004-07-05 00:00:00','2004-07-05 00:00:00','{','{'),(12,4,3,'2007-01-26','2007-01-26','23:00:51','23:00:51','2001-05-16 00:00:00','2001-05-16 00:00:00','f','f'),(13,7,0,'2004-03-27','2004-03-27','00:00:00','00:00:00','2005-01-24 03:30:37','2005-01-24 03:30:37','',''),(14,6,0,'2006-07-26','2006-07-26','18:43:57','18:43:57','0000-00-00 00:00:00','0000-00-00 00:00:00','{','{'),(15,0,6,'2000-01-14','2000-01-14','00:00:00','00:00:00','2000-09-21 00:00:00','2000-09-21 00:00:00','o','o'),(16,9,8,'0000-00-00','0000-00-00','21:15:08','21:15:08','0000-00-00 00:00:00','0000-00-00 00:00:00','a','a'),(17,2,0,'2004-10-27','2004-10-27','00:00:00','00:00:00','2004-03-24 22:13:43','2004-03-24 22:13:43','',''),(18,7,4,'0000-00-00','0000-00-00','08:38:27','08:38:27','2002-03-18 19:51:44','2002-03-18 19:51:44','t','t'),(19,5,3,'2008-03-07','2008-03-07','03:29:07','03:29:07','2007-12-01 18:44:44','2007-12-01 18:44:44','t','t'),(20,0,0,'2002-04-09','2002-04-09','16:06:03','16:06:03','2009-04-22 00:00:00','2009-04-22 00:00:00','n','n');
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+UPDATE t1 SET `int_key` = 3 ORDER BY `pk` LIMIT 4;
+DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `int_key` = 6 ORDER BY `pk` LIMIT 3;
+DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
+UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
+ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
+DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
+UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
+include/sync_slave_sql_with_master.inc
+*** results: t2 must be consistent ****
+include/diff_tables.inc [master:t2, slave:t2]
+DROP TABLE t1, t2;
+EOF OF TESTS
+CREATE TABLE t1 (a int) ENGINE='INNODB' ;
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 2 );
+INSERT INTO t1 ( a ) VALUES ( 9 );
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 5 WHERE a = 9;
+DELETE FROM t1 WHERE a < 6;
+UPDATE t1 SET a = 9 WHERE a < 3;
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a < 4;
+UPDATE t1 SET a = 8 WHERE a < 5;
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+drop table t1;
+include/sync_slave_sql_with_master.inc
+SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY';
+CREATE TABLE t1 (a bit) ENGINE='INNODB' ;
+INSERT IGNORE INTO t1 VALUES (NULL);
+INSERT INTO t1 ( a ) VALUES ( 0 );
+UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+DELETE FROM t1 WHERE a < 2 LIMIT 4;
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 9 );
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT INTO t1 ( a ) VALUES ( 8 );
+UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
+INSERT INTO t1 ( a ) VALUES ( 4 );
+INSERT INTO t1 ( a ) VALUES ( 3 );
+UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
+DELETE FROM t1 WHERE a = 4 LIMIT 7;
+UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
+UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
+DELETE FROM t1 WHERE a < 0 LIMIT 5;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 5 );
+UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
+DELETE FROM t1 WHERE a < 8 LIMIT 8;
+INSERT INTO t1 ( a ) VALUES ( 6 );
+DELETE FROM t1 WHERE a < 6 LIMIT 7;
+UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
+UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
+INSERT INTO t1 ( a ) VALUES ( 7 );
+DELETE FROM t1 WHERE a < 9 LIMIT 4;
+INSERT INTO t1 ( a ) VALUES ( 7 );
+INSERT INTO t1 ( a ) VALUES ( 6 );
+UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
+DELETE FROM t1 WHERE a = 2 LIMIT 9;
+DELETE FROM t1 WHERE a = 1 LIMIT 4;
+UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
+INSERT INTO t1 ( a ) VALUES ( 0 );
+DELETE FROM t1 WHERE a < 3 LIMIT 0;
+UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
+INSERT INTO t1 ( a ) VALUES ( 1 );
+UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
+include/sync_slave_sql_with_master.inc
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+include/diff_tables.inc [master:t1, slave:t1]
+drop table t1;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result
new file mode 100644
index 00000000000..0741a616eda
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result
@@ -0,0 +1,161 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+***** Table Create Section ****
+
+CREATE TABLE test.t1 (c1 int not null auto_increment,
+data LONGBLOB, PRIMARY KEY(c1))ENGINE=#;
+
+**** Data Insert Section test.t1 *****
+
+INSERT INTO test.t1 VALUES (NULL, NULL);
+INSERT INTO test.t1 VALUES (NULL, repeat('a',1*1024));
+INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024));
+
+**** Data Insert Validation Master Section test.t1 ****
+
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
+LENGTH(data)
+NULL
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
+LENGTH(data)
+1024
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
+LENGTH(data)
+16384
+include/sync_slave_sql_with_master.inc
+
+**** Data Insert Validation Slave Section test.t1 ****
+
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
+LENGTH(data)
+NULL
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
+LENGTH(data)
+1024
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
+LENGTH(data)
+16384
+
+**** Data Update Section test.t1 ****
+
+UPDATE test.t1 set data=repeat('a',18*1024) where c1 = 1;
+UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
+
+**** Data Update Validation Master Section test.t1 ****
+
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
+LENGTH(data)
+18432
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
+LENGTH(data)
+17408
+include/sync_slave_sql_with_master.inc
+
+**** Data Update Validation Slave Section test.t1 ****
+
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
+LENGTH(data)
+18432
+SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
+LENGTH(data)
+17408
+
+**** End Test Section test.t1 ****
+
+**** Create Table test.t2 ****
+
+CREATE TABLE test.t2 (
+c1 INT NOT NULL PRIMARY KEY,
+c2 TEXT,
+c3 INT,
+c4 LONGBLOB,
+KEY(c3))ENGINE=#;
+
+*** Setup Values For test.t2 ***
+set @x0 = '01234567012345670123456701234567';
+set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
+set @b1 = concat(@b1,@x0);
+set @d1 = 'dd1';
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+set @b2 = 'b2';
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
+set @d2 = 'dd2';
+set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
+set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
+set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
+set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
+
+**** Data Insert Section test.t2 *****
+
+INSERT INTO test.t2 VALUES(1,@b1,111,@d1);
+INSERT INTO test.t2 VALUES(2,@b2,222,@d2);
+
+**** Data Insert Validation Master Section test.t2 ****
+
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=1;
+c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
+1 2256 b1 3000 dd1
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=2;
+c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
+2 20000 b2 30000 dd2
+include/sync_slave_sql_with_master.inc
+
+**** Data Insert Validation Slave Section test.t2 ****
+
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=1;
+c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
+1 2256 b1 3000 dd1
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=2;
+c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
+2 20000 b2 30000 dd2
+
+**** Data Update Section test.t2 ****
+
+UPDATE test.t2 SET c2=@b2, c4=@d2 WHERE c1=1;
+UPDATE test.t2 SET c2=@b1, c4=@d1 WHERE c1=2;
+
+**** Data Update Validation Master Section test.t2 ****
+
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=1;
+c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
+1 20000 b2 30000 dd2
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=2;
+c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
+2 2256 b1 3000 dd1
+include/sync_slave_sql_with_master.inc
+
+**** Data Update Validation Slave Section test.t2 ****
+
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=1;
+c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
+1 20000 b2 30000 dd2
+SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
+FROM test.t2 WHERE c1=2;
+c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
+2 2256 b1 3000 dd1
+
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_log_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_log_tokudb.result
new file mode 100644
index 00000000000..87ffbca71bc
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_log_tokudb.result
@@ -0,0 +1,275 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+include/sync_slave_sql_with_master.inc
+include/stop_slave.inc
+include/wait_for_slave_to_stop.inc
+reset master;
+reset slave;
+start slave;
+include/wait_for_slave_to_start.inc
+create table t1(n int not null auto_increment primary key)ENGINE=TokuDB;
+insert into t1 values (NULL);
+drop table t1;
+create table t1 (word char(20) not null)ENGINE=TokuDB;
+load data infile 'LOAD_FILE' into table t1 ignore 1 lines;
+select count(*) from t1;
+count(*)
+69
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+flush logs;
+create table t3 (a int)ENGINE=TokuDB;
+select * from t1 order by 1 asc;
+word
+Aarhus
+Aaron
+Aaron
+Ababa
+Ababa
+aback
+aback
+abaft
+abaft
+abandon
+abandon
+abandoned
+abandoned
+abandoning
+abandoning
+abandonment
+abandonment
+abandons
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+include/sync_slave_sql_with_master.inc
+select * from t1 order by 1 asc;
+word
+Aarhus
+Aaron
+Aaron
+Ababa
+Ababa
+aback
+aback
+abaft
+abaft
+abandon
+abandon
+abandoned
+abandoned
+abandoning
+abandoning
+abandonment
+abandonment
+abandons
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+flush logs;
+include/stop_slave.inc
+include/start_slave.inc
+create table t2 (n int)ENGINE=TokuDB;
+insert into t2 values (1);
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Rotate # # master-bin.000002;pos=POS
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=TokuDB
+master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=TokuDB
+master-bin.000002 # Query # # BEGIN
+master-bin.000002 # Table_map # # table_id: # (test.t2)
+master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000002 # Xid # # COMMIT /* XID */
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+include/sync_slave_sql_with_master.inc
+show binary logs;
+Log_name File_size
+slave-bin.000001 #
+slave-bin.000002 #
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=TokuDB
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Xid # # COMMIT /* XID */
+slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+slave-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=TokuDB
+slave-bin.000001 # Query # # BEGIN
+slave-bin.000001 # Table_map # # table_id: # (test.t1)
+slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000001 # Xid # # COMMIT /* XID */
+slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=TokuDB
+slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=TokuDB
+slave-bin.000002 # Query # # BEGIN
+slave-bin.000002 # Table_map # # table_id: # (test.t2)
+slave-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
+slave-bin.000002 # Xid # # COMMIT /* XID */
+include/check_slave_is_running.inc
+show binlog events in 'slave-bin.000005' from 4;
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+include/rpl_reset.inc
+create table t1(a int auto_increment primary key, b int);
+insert into t1 values (NULL, 1);
+set insert_id=5;
+insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int)
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+select * from t1;
+a b
+1 1
+5 1
+6 1
+drop table t1;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result
new file mode 100644
index 00000000000..8dcea0daff7
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result
@@ -0,0 +1,37 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+## case #1 - last_null_bit_pos==0 in record_compare without X bit
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=TokuDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+UPDATE t1 SET c5 = 'a';
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
+## (1 column less and no varchar)
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=TokuDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+UPDATE t1 SET c5 = 'a';
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+## case #2 - X bit is wrongly set.
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=TokuDB DEFAULT CHARSET= latin1;
+INSERT INTO t1(c1) VALUES (10);
+INSERT INTO t1(c1) VALUES (NULL);
+UPDATE t1 SET c1= 0;
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_sp002_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_sp002_tokudb.result
new file mode 100644
index 00000000000..65fecef606b
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_sp002_tokudb.result
@@ -0,0 +1,233 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE test.t1 (a INT AUTO_INCREMENT KEY, t CHAR(6)) ENGINE=TokuDB;
+CREATE TABLE test.t2 (a INT AUTO_INCREMENT KEY, f INT, FOREIGN KEY(a) REFERENCES test.t1(a) ON DELETE CASCADE) ENGINE=TokuDB;
+create procedure test.p1(IN i CHAR(6))
+begin
+INSERT INTO test.t1 (t) VALUES (i);
+INSERT INTO test.t2 VALUES (NULL,LAST_INSERT_ID());
+end|
+create procedure test.p2(IN i INT)
+begin
+DELETE FROM test.t1 where a < i;
+end|
+
+< -- test 1 call p1 -- >
+------------------------
+SET FOREIGN_KEY_CHECKS=1;
+call test.p1('texas');
+call test.p1('Live');
+call test.p1('next');
+call test.p1('to');
+call test.p1('OK');
+call test.p1('MySQL');
+
+< -- test 1 select master after p1 -- >
+---------------------------------------
+SELECT * FROM test.t1;
+a t
+1 texas
+2 Live
+3 next
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+
+< -- test 1 select slave after p1 -- >
+--------------------------------------
+SELECT * FROM test.t1;
+a t
+1 texas
+2 Live
+3 next
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+
+< -- test 1 call p2 & select master -- >
+----------------------------------------
+call test.p2(4);
+SELECT * FROM test.t1;
+a t
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+4 4
+5 5
+6 6
+
+< -- test 1 select slave after p2 -- >
+--------------------------------------
+SELECT * FROM test.t1;
+a t
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+4 4
+5 5
+6 6
+
+< -- End test 1 Begin test 2 -- >
+---------------------------------
+SET FOREIGN_KEY_CHECKS=0;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+CREATE TABLE test.t1 (a INT, t CHAR(6), PRIMARY KEY(a)) ENGINE=TokuDB;
+CREATE TABLE test.t2 (a INT, f INT, FOREIGN KEY(a) REFERENCES test.t1(a) ON UPDATE CASCADE, PRIMARY KEY(a)) ENGINE=TokuDB;
+CREATE PROCEDURE test.p1(IN nm INT, IN ch CHAR(6))
+BEGIN
+INSERT INTO test.t1 (a,t) VALUES (nm, ch);
+INSERT INTO test.t2 VALUES (nm, LAST_INSERT_ID());
+END|
+CREATE PROCEDURE test.p2(IN i INT)
+BEGIN
+UPDATE test.t1 SET a = i*10 WHERE a = i;
+END|
+SET FOREIGN_KEY_CHECKS=1;
+CALL test.p1(1,'texas');
+CALL test.p1(2,'Live');
+CALL test.p1(3,'next');
+CALL test.p1(4,'to');
+CALL test.p1(5,'OK');
+CALL test.p1(6,'MySQL');
+
+< -- test 2 select Master after p1 -- >
+---------------------------------------
+SELECT * FROM test.t1;
+a t
+1 texas
+2 Live
+3 next
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+1 6
+2 6
+3 6
+4 6
+5 6
+6 6
+
+< -- test 2 select Slave after p1 -- >
+--------------------------------------
+SELECT * FROM test.t1;
+a t
+1 texas
+2 Live
+3 next
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+1 6
+2 6
+3 6
+4 6
+5 6
+6 6
+
+< -- test 2 call p2 & select Master -- >
+----------------------------------------
+CALL test.p2(2);
+CALL test.p2(4);
+CALL test.p2(6);
+SELECT * FROM test.t1;
+a t
+1 texas
+3 next
+5 OK
+20 Live
+40 to
+60 MySQL
+SELECT * FROM test.t2;
+a f
+1 6
+3 6
+5 6
+20 6
+40 6
+60 6
+
+< -- test 1 select Slave after p2 -- >
+--------------------------------------
+SELECT * FROM test.t1;
+a t
+1 texas
+3 next
+5 OK
+20 Live
+40 to
+60 MySQL
+SELECT * FROM test.t2;
+a f
+1 6
+3 6
+5 6
+20 6
+40 6
+60 6
+
+< -- End test 2 Begin test 3 -- >
+---------------------------------
+CREATE TABLE test.t3 (a INT AUTO_INCREMENT KEY, t CHAR(6))ENGINE=TokuDB;
+CREATE PROCEDURE test.p3(IN n INT)
+begin
+CASE n
+WHEN 2 THEN
+DELETE from test.t3;
+ELSE
+INSERT INTO test.t3 VALUES (NULL,'NONE');
+END CASE;
+end|
+SET AUTOCOMMIT=0;
+START TRANSACTION;
+ROLLBACK;
+select * from test.t3;
+a t
+select * from test.t3;
+a t
+START TRANSACTION;
+COMMIT;
+select * from test.t3;
+a t
+98 NONE
+select * from test.t3;
+a t
+98 NONE
+SET AUTOCOMMIT=1;
+SET FOREIGN_KEY_CHECKS=0;
+DROP PROCEDURE test.p3;
+DROP PROCEDURE test.p1;
+DROP PROCEDURE test.p2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result
new file mode 100644
index 00000000000..b783e42bd7b
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result
@@ -0,0 +1,48 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE PROCEDURE test.p1(IN i INT)
+BEGIN
+DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (num INT,PRIMARY KEY(num))ENGINE=TokuDB;
+START TRANSACTION;
+INSERT INTO test.t1 VALUES(i);
+savepoint t1_save;
+INSERT INTO test.t1 VALUES (14);
+ROLLBACK to savepoint t1_save;
+COMMIT;
+END|
+
+< ---- Master selects-- >
+-------------------------
+CALL test.p1(12);
+SELECT * FROM test.t1;
+num
+12
+
+< ---- Slave selects-- >
+------------------------
+include/sync_slave_sql_with_master.inc
+SELECT * FROM test.t1;
+num
+12
+
+< ---- Master selects-- >
+-------------------------
+CALL test.p1(13);
+SELECT * FROM test.t1;
+num
+13
+
+< ---- Slave selects-- >
+------------------------
+include/sync_slave_sql_with_master.inc
+SELECT * FROM test.t1;
+num
+13
+DROP PROCEDURE test.p1;
+DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result
new file mode 100644
index 00000000000..13e80030937
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result
@@ -0,0 +1,190 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+STOP SLAVE;
+SET @my_sql_mode= @@global.sql_mode;
+SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
+START SLAVE;
+CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE=TokuDB;
+CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE=TokuDB;
+CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE=TokuDB;
+CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE=TokuDB;
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=TokuDB;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=TokuDB;
+CREATE TABLE t4 (a INT) ENGINE=TokuDB;
+CREATE TABLE t5 (a INT, b INT, c INT) ENGINE=TokuDB;
+CREATE TABLE t6 (a INT, b INT, c INT) ENGINE=TokuDB;
+CREATE TABLE t7 (a INT NOT NULL) ENGINE=TokuDB;
+CREATE TABLE t8 (a INT NOT NULL) ENGINE=TokuDB;
+CREATE TABLE t9 (a INT) ENGINE=TokuDB;
+ALTER TABLE t1_int ADD x INT DEFAULT 42;
+ALTER TABLE t1_bit
+ADD x BIT(3) DEFAULT b'011',
+ADD y BIT(5) DEFAULT b'10101',
+ADD z BIT(2) DEFAULT b'10';
+ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
+ALTER TABLE t1_nodef ADD x INT NOT NULL, ADD y INT NOT NULL, ADD z INT NOT NULL;
+ALTER TABLE t2 DROP b;
+ALTER TABLE t4 MODIFY a FLOAT;
+ALTER TABLE t5 MODIFY b FLOAT;
+ALTER TABLE t6 MODIFY c FLOAT;
+ALTER TABLE t7 ADD e1 INT, ADD e2 INT, ADD e3 INT, ADD e4 INT,
+ADD e5 INT, ADD e6 INT, ADD e7 INT, ADD e8 INT;
+ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
+ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
+ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
+ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
+set @@global.slave_exec_mode= 'IDEMPOTENT';
+INSERT INTO t1_int VALUES (2, 4, 4711);
+INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
+INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
+**** On Master ****
+INSERT INTO t1_int VALUES (1,2);
+INSERT INTO t1_int VALUES (2,5);
+INSERT INTO t1_bit VALUES (1,2);
+INSERT INTO t1_bit VALUES (2,5);
+INSERT INTO t1_char VALUES (1,2);
+INSERT INTO t1_char VALUES (2,5);
+SELECT * FROM t1_int ORDER BY a;
+a b
+1 2
+2 5
+SELECT * FROM t1_bit ORDER BY a;
+a b
+1 2
+2 5
+SELECT * FROM t1_char ORDER BY a;
+a b
+1 2
+2 5
+**** On Slave ****
+set @@global.slave_exec_mode= default;
+SELECT a,b,x FROM t1_int ORDER BY a;
+a b x
+1 2 42
+2 5 4711
+SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
+a b HEX(x) HEX(y) HEX(z)
+1 2 3 15 2
+2 5 5 1C 1
+SELECT a,b,x FROM t1_char ORDER BY a;
+a b x
+1 2 Just a test
+2 5 Foo is a bar
+**** On Master ****
+UPDATE t1_int SET b=2*b WHERE a=2;
+UPDATE t1_char SET b=2*b WHERE a=2;
+UPDATE t1_bit SET b=2*b WHERE a=2;
+SELECT * FROM t1_int ORDER BY a;
+a b
+1 2
+2 10
+SELECT * FROM t1_bit ORDER BY a;
+a b
+1 2
+2 10
+SELECT * FROM t1_char ORDER BY a;
+a b
+1 2
+2 10
+**** On Slave ****
+SELECT a,b,x FROM t1_int ORDER BY a;
+a b x
+1 2 42
+2 10 4711
+SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
+a b HEX(x) HEX(y) HEX(z)
+1 2 3 15 2
+2 10 5 1C 1
+SELECT a,b,x FROM t1_char ORDER BY a;
+a b x
+1 2 Just a test
+2 10 Foo is a bar
+INSERT INTO t9 VALUES (2);
+INSERT INTO t1_nodef VALUES (1,2);
+select count(*) from t1_nodef;
+count(*)
+1
+INSERT INTO t9 VALUES (2);
+**** On Master ****
+INSERT INTO t2 VALUES (2,4);
+SELECT * FROM t2;
+a b
+2 4
+**** On Slave ****
+SELECT * FROM t2;
+a
+2
+include/check_slave_is_running.inc
+INSERT INTO t9 VALUES (4);
+INSERT INTO t4 VALUES (4);
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+INSERT INTO t9 VALUES (5);
+INSERT INTO t5 VALUES (5,10,25);
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+INSERT INTO t9 VALUES (6);
+INSERT INTO t6 VALUES (6,12,36);
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+INSERT INTO t9 VALUES (6);
+include/check_slave_is_running.inc
+INSERT INTO t7 VALUES (1),(2),(3);
+INSERT INTO t8 VALUES (1),(2),(3);
+SELECT * FROM t7 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t8 ORDER BY a;
+a
+1
+2
+3
+SELECT * FROM t7 ORDER BY a;
+a e1 e2 e3 e4 e5 e6 e7 e8
+1 NULL NULL NULL NULL NULL NULL NULL NULL
+2 NULL NULL NULL NULL NULL NULL NULL NULL
+3 NULL NULL NULL NULL NULL NULL NULL NULL
+SELECT * FROM t8 ORDER BY a;
+a e1 e2 e3 e4 e5 e6 e7 e8
+1 0 0 0 0 0 0 0 0
+2 0 0 0 0 0 0 0 0
+3 0 0 0 0 0 0 0 0
+**** On Master ****
+TRUNCATE t1_nodef;
+SET SQL_LOG_BIN=0;
+INSERT INTO t1_nodef VALUES (1,2);
+INSERT INTO t1_nodef VALUES (2,4);
+SET SQL_LOG_BIN=1;
+**** On Slave ****
+INSERT INTO t1_nodef VALUES (1,2,3,4,5);
+INSERT INTO t1_nodef VALUES (2,4,6,8,10);
+**** On Master ****
+UPDATE t1_nodef SET b=2*b WHERE a=1;
+SELECT * FROM t1_nodef ORDER BY a;
+a b
+1 4
+2 4
+**** On Slave ****
+SELECT * FROM t1_nodef ORDER BY a;
+a b x y z
+1 4 3 4 5
+2 4 6 8 10
+**** On Master ****
+DELETE FROM t1_nodef WHERE a=2;
+SELECT * FROM t1_nodef ORDER BY a;
+a b
+1 4
+**** On Slave ****
+SELECT * FROM t1_nodef ORDER BY a;
+a b x y z
+1 4 3 4 5
+**** Cleanup ****
+DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
+DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
+SET @@global.sql_mode= @my_sql_mode;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result
new file mode 100644
index 00000000000..d2bc4c148d5
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result
@@ -0,0 +1,31 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 BIT, c2 INT) Engine=TokuDB;
+INSERT INTO `t1` VALUES ( 1, 1 );
+UPDATE t1 SET c1=NULL where c2=1;
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+DELETE FROM t1 WHERE c2=1 LIMIT 1;
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 CHAR) Engine=TokuDB;
+INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
+SELECT * FROM t1;
+c1
+w
+UPDATE t1 SET c1=NULL WHERE c1='w';
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+DELETE FROM t1 LIMIT 2;
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result
new file mode 100644
index 00000000000..80d24bd31b2
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result
@@ -0,0 +1,138 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t4 (
+id INT(5) unsigned NOT NULL auto_increment,
+name varchar(15) NOT NULL default '',
+number varchar(35) NOT NULL default 'default',
+PRIMARY KEY (id),
+UNIQUE KEY unique_rec (name,number)
+) ENGINE=TokuDB;
+LOAD DATA
+INFILE '../../std_data/loaddata_pair.dat'
+REPLACE INTO TABLE t4
+(name,number);
+SELECT * FROM t4;
+id name number
+1 XXX 12345
+2 XXY 12345
+SELECT * FROM t4;
+id name number
+1 XXX 12345
+2 XXY 12345
+LOAD DATA
+INFILE '../../std_data/loaddata_pair.dat'
+REPLACE INTO TABLE t4
+(name,number);
+SELECT * FROM t4;
+id name number
+4 XXX 12345
+5 XXY 12345
+SELECT * FROM t4;
+id name number
+4 XXX 12345
+5 XXY 12345
+FLUSH LOGS;
+FLUSH LOGS;
+DROP DATABASE IF EXISTS mysqltest1;
+CREATE DATABASE mysqltest1;
+CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT) ENGINE=InnoDB;
+CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="TokuDB";
+SET AUTOCOMMIT = 0;
+-------- switch to slave --------
+ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
+SHOW CREATE TABLE mysqltest1.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+-------- switch to master --------
+INSERT INTO mysqltest1.t1 SET f1= 1;
+DROP TEMPORARY TABLE mysqltest1.tmp;
+ROLLBACK;
+Warnings:
+Warning # Some temporary tables were dropped, but these operations could not be rolled back.
+SHOW CREATE TABLE mysqltest1.tmp;
+ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist
+######### Must return no rows here #########
+SELECT COUNT(*) FROM mysqltest1.t1;
+COUNT(*)
+0
+INSERT INTO mysqltest1.t1 SET f1= 2;
+CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT) ENGINE=InnoDB;
+ROLLBACK;
+Warnings:
+Warning # The creation of some temporary tables could not be rolled back.
+SHOW CREATE TABLE mysqltest1.tmp2;
+Table Create Table
+tmp2 CREATE TEMPORARY TABLE `tmp2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+######### Must return no rows here #########
+SELECT COUNT(*) FROM mysqltest1.t1;
+COUNT(*)
+0
+-------- switch to slave --------
+SHOW CREATE TABLE mysqltest1.tmp;
+ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist
+SHOW CREATE TABLE mysqltest1.tmp2;
+ERROR 42S02: Table 'mysqltest1.tmp2' doesn't exist
+######### for SBR, t1 has two rows here: the transaction not rolled back since t1 uses MyISAM #########
+######### for MBR, t1 has one row here: the transaction not rolled back since t1 uses MyISAM #########
+SELECT COUNT(*) FROM mysqltest1.t1;
+COUNT(*)
+2
+FLUSH LOGS;
+-------- switch to master --------
+FLUSH LOGS;
+DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2;
+DROP DATABASE mysqltest1;
+End of 5.1 tests
+#
+# Bug#39675 rename tables on innodb tables with pending
+# transactions causes slave data issue.
+#
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+CREATE TABLE t1 (
+id INT PRIMARY KEY auto_increment,
+b INT DEFAULT NULL
+) ENGINE=TokuDB;
+CREATE TABLE t2 (
+id INT PRIMARY KEY auto_increment,
+b INT DEFAULT NULL
+) ENGINE=TokuDB;
+INSERT INTO t1 (b) VALUES (1),(2),(3);
+BEGIN;
+INSERT INTO t1(b) VALUES (4);
+-------- switch to master1 --------
+RENAME TABLE t1 TO t3, t2 TO t1;;
+-------- switch to master --------
+COMMIT;
+-------- switch to master1 --------
+-------- switch to master --------
+SELECT * FROM t1;
+id b
+SELECT * FROM t3;
+id b
+1 1
+2 2
+3 3
+4 4
+-------- switch to slave --------
+SELECT * FROM t1;
+id b
+SELECT * FROM t3;
+id b
+1 1
+2 2
+3 3
+4 4
+-------- switch to master --------
+DROP TABLE t1;
+DROP TABLE t3;
+End of 6.0 tests
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result
new file mode 100644
index 00000000000..009c020b496
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result
@@ -0,0 +1,145 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+use test;
+CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON
+UPDATE CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE=TokuDB;
+CREATE TABLE test.bykey_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE=TokuDB
+PARTITION BY KEY(id) partitions 5;
+CREATE TABLE test.byrange_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE=TokuDB
+PARTITION BY RANGE(id)
+SUBPARTITION BY hash(id) subpartitions 2
+(PARTITION pa1 values less than (10),
+PARTITION pa2 values less than (20),
+PARTITION pa3 values less than (30),
+PARTITION pa4 values less than (40),
+PARTITION pa5 values less than (50),
+PARTITION pa6 values less than (60),
+PARTITION pa7 values less than (70),
+PARTITION pa8 values less than (80),
+PARTITION pa9 values less than (90),
+PARTITION pa10 values less than (100),
+PARTITION pa11 values less than MAXVALUE);
+CREATE PROCEDURE test.proc_norm()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM test.regular_tbl INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM test.regular_tbl WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CREATE PROCEDURE test.proc_bykey()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO test.bykey_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM test.bykey_tbl INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM test.bykey_tbl WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CREATE PROCEDURE test.proc_byrange()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user = CURRENT_USER();
+SET local_uuid=UUID();
+WHILE ins_count > 0 DO
+INSERT INTO test.byrange_tbl VALUES (NULL, NOW(), USER(), UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM test.byrange_tbl INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM test.byrange_tbl WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CALL test.proc_norm();
+SELECT count(*) as "Master regular" FROM test.regular_tbl;
+Master regular 500
+CALL test.proc_bykey();
+SELECT count(*) as "Master bykey" FROM test.bykey_tbl;
+Master bykey 500
+CALL test.proc_byrange();
+SELECT count(*) as "Master byrange" FROM test.byrange_tbl;
+Master byrange 500
+show create table test.byrange_tbl;
+Table byrange_tbl
+Create Table CREATE TABLE `byrange_tbl` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ `user` char(255) DEFAULT NULL,
+ `uuidf` longblob,
+ `fkid` mediumint(9) DEFAULT NULL,
+ `filler` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=TokuDB AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (id)
+SUBPARTITION BY HASH (id)
+SUBPARTITIONS 2
+(PARTITION pa1 VALUES LESS THAN (10) ENGINE = TokuDB,
+ PARTITION pa2 VALUES LESS THAN (20) ENGINE = TokuDB,
+ PARTITION pa3 VALUES LESS THAN (30) ENGINE = TokuDB,
+ PARTITION pa4 VALUES LESS THAN (40) ENGINE = TokuDB,
+ PARTITION pa5 VALUES LESS THAN (50) ENGINE = TokuDB,
+ PARTITION pa6 VALUES LESS THAN (60) ENGINE = TokuDB,
+ PARTITION pa7 VALUES LESS THAN (70) ENGINE = TokuDB,
+ PARTITION pa8 VALUES LESS THAN (80) ENGINE = TokuDB,
+ PARTITION pa9 VALUES LESS THAN (90) ENGINE = TokuDB,
+ PARTITION pa10 VALUES LESS THAN (100) ENGINE = TokuDB,
+ PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = TokuDB) */
+SELECT count(*) "Slave norm" FROM test.regular_tbl;
+Slave norm 500
+SELECT count(*) "Slave bykey" FROM test.bykey_tbl;
+Slave bykey 500
+SELECT count(*) "Slave byrange" FROM test.byrange_tbl;
+Slave byrange 500
+DROP PROCEDURE test.proc_norm;
+DROP PROCEDURE test.proc_bykey;
+DROP PROCEDURE test.proc_byrange;
+DROP TABLE test.regular_tbl;
+DROP TABLE test.bykey_tbl;
+DROP TABLE test.byrange_tbl;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result
new file mode 100644
index 00000000000..bfcb5a92b68
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result
@@ -0,0 +1,35 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+use test;
+CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE=TokuDB;
+CREATE PROCEDURE test.proc_norm()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM test.regular_tbl INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM test.regular_tbl WHERE id = del_count;
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CALL test.proc_norm();
+DROP PROCEDURE test.proc_norm;
+DROP TABLE test.regular_tbl;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result
index cd8608f4387..c77cbbc71c9 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result
index ae2aea84287..e178b8ad137 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_delete_pk_lookup1.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result
new file mode 100644
index 00000000000..7f2e9465829
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result
@@ -0,0 +1,159 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+==========MASTER==========
+show global variables like 'binlog_format%';
+Variable_name Value
+binlog_format MIXED
+show session variables like 'binlog_format%';
+Variable_name Value
+binlog_format MIXED
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+MIXED MIXED
+==========SLAVE===========
+show global variables like 'binlog_format%';
+Variable_name Value
+binlog_format MIXED
+show session variables like 'binlog_format%';
+Variable_name Value
+binlog_format MIXED
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+MIXED MIXED
+
+******************** DDL for database ********************
+DROP DATABASE IF EXISTS test_rpl;
+DROP DATABASE IF EXISTS test_rpl_1;
+CREATE DATABASE test_rpl_1 CHARACTER SET utf8 COLLATE utf8_general_ci;
+ALTER DATABASE test_rpl_1 CHARACTER SET latin1 COLLATE latin1_general_ci;
+DROP DATABASE test_rpl_1;
+CREATE DATABASE test_rpl CHARACTER SET utf8 COLLATE utf8_general_ci;
+ALTER DATABASE test_rpl CHARACTER SET latin1 COLLATE latin1_swedish_ci;
+==========MASTER==========
+SHOW DATABASES LIKE 'test_rpl%';
+Database (test_rpl%)
+test_rpl
+==========SLAVE===========
+SHOW DATABASES LIKE 'test_rpl%';
+Database (test_rpl%)
+test_rpl
+USE test_rpl;
+
+******************** DDL for tables ********************
+CREATE TABLE t0 (a int auto_increment not null, c int not null, PRIMARY KEY(a), KEY index2 (c)) ENGINE=TokuDB;
+ALTER TABLE t0 DROP INDEX index2;
+ALTER TABLE t0 ADD COLUMN b char(254);
+ALTER TABLE t0 ADD INDEX index1 (b);
+ALTER TABLE t0 DROP COLUMN c;
+RENAME TABLE t0 TO t1;
+CREATE TABLE t2 LIKE t1;
+==========MASTER==========
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ `b` char(254) DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ KEY `index1` (`b`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ `b` char(254) DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ KEY `index1` (`b`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+==========SLAVE===========
+USE test_rpl;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ `b` char(254) DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ KEY `index1` (`b`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ `b` char(254) DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ KEY `index1` (`b`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+
+******************** DDL for indexes ********************
+ALTER TABLE t2 ADD COLUMN d datetime;
+CREATE INDEX index2 on t2 (d);
+CREATE INDEX index3 on t2 (a, d);
+==========MASTER==========
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ `b` char(254) DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ KEY `index1` (`b`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ `b` char(254) DEFAULT NULL,
+ `d` datetime DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ KEY `index1` (`b`),
+ KEY `index2` (`d`),
+ KEY `index3` (`a`,`d`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+==========SLAVE===========
+USE test_rpl;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ `b` char(254) DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ KEY `index1` (`b`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ `b` char(254) DEFAULT NULL,
+ `d` datetime DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ KEY `index1` (`b`),
+ KEY `index2` (`d`),
+ KEY `index3` (`a`,`d`)
+) ENGINE=TokuDB DEFAULT CHARSET=latin1
+ALTER TABLE t2 DROP COLUMN d;
+
+
+******************** SHOW BINLOG EVENTS ********************
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # DROP DATABASE IF EXISTS test_rpl
+master-bin.000001 # Query # # DROP DATABASE IF EXISTS test_rpl_1
+master-bin.000001 # Query # # CREATE DATABASE test_rpl_1 CHARACTER SET utf8 COLLATE utf8_general_ci
+master-bin.000001 # Query # # ALTER DATABASE test_rpl_1 CHARACTER SET latin1 COLLATE latin1_general_ci
+master-bin.000001 # Query # # DROP DATABASE test_rpl_1
+master-bin.000001 # Query # # CREATE DATABASE test_rpl CHARACTER SET utf8 COLLATE utf8_general_ci
+master-bin.000001 # Query # # ALTER DATABASE test_rpl CHARACTER SET latin1 COLLATE latin1_swedish_ci
+master-bin.000001 # Query # # use `test_rpl`; CREATE TABLE t0 (a int auto_increment not null, c int not null, PRIMARY KEY(a), KEY index2 (c)) ENGINE=TokuDB
+master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t0 DROP INDEX index2
+master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t0 ADD COLUMN b char(254)
+master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t0 ADD INDEX index1 (b)
+master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t0 DROP COLUMN c
+master-bin.000001 # Query # # use `test_rpl`; RENAME TABLE t0 TO t1
+master-bin.000001 # Query # # use `test_rpl`; CREATE TABLE t2 LIKE t1
+master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t2 ADD COLUMN d datetime
+master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index2 on t2 (d)
+master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index3 on t2 (a, d)
+master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t2 DROP COLUMN d
+drop database test_rpl;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result
new file mode 100644
index 00000000000..9300d29bb29
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result
@@ -0,0 +1,1106 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+==========MASTER==========
+show global variables like 'binlog_format%';
+Variable_name Value
+binlog_format MIXED
+show session variables like 'binlog_format%';
+Variable_name Value
+binlog_format MIXED
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+MIXED MIXED
+==========SLAVE===========
+show global variables like 'binlog_format%';
+Variable_name Value
+binlog_format MIXED
+show session variables like 'binlog_format%';
+Variable_name Value
+binlog_format MIXED
+select @@global.binlog_format, @@session.binlog_format;
+@@global.binlog_format @@session.binlog_format
+MIXED MIXED
+CREATE DATABASE test_rpl;
+
+******************** PREPARE TESTING ********************
+USE test_rpl;
+CREATE TABLE t1 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=TokuDB;
+CREATE TABLE t2 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=TokuDB;
+INSERT INTO t1 VALUES(1, 't1, text 1');
+INSERT INTO t1 VALUES(2, 't1, text 2');
+INSERT INTO t2 VALUES(1, 't2, text 1');
+
+******************** DELETE ********************
+DELETE FROM t1 WHERE a = 1;
+DELETE FROM t2 WHERE b <> UUID();
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+2 t1, text 2
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+2 t1, text 2
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** INSERT ********************
+INSERT INTO t1 VALUES(1, 't1, text 1');
+INSERT INTO t1 VALUES(2, UUID());
+INSERT INTO t2 SELECT * FROM t1;
+INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1';
+DELETE FROM t1 WHERE a = 2;
+DELETE FROM t2 WHERE a = 2;
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 t1, text 1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1
+SELECT * FROM t2 ORDER BY a;
+a b
+1 t2, text 1
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 t1, text 1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1
+SELECT * FROM t2 ORDER BY a;
+a b
+1 t2, text 1
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** LOAD DATA INFILE ********************
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;
+SELECT * FROM t1 ORDER BY a;
+a b
+10 line A
+20 line B
+30 line C
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+3
+SELECT * FROM t1 ORDER BY a;
+a b
+10 line A
+20 line B
+30 line C
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+3
+SELECT * FROM t1 ORDER BY a;
+a b
+10 line A
+20 line B
+30 line C
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** REPLACE ********************
+INSERT INTO t1 VALUES(1, 't1, text 1');
+INSERT INTO t1 VALUES(2, 't1, text 2');
+INSERT INTO t1 VALUES(3, 't1, text 3');
+REPLACE INTO t1 VALUES(1, 't1, text 11');
+REPLACE INTO t1 VALUES(2, UUID());
+REPLACE INTO t1 SET a=3, b='t1, text 33';
+DELETE FROM t1 WHERE a = 2;
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+SELECT * FROM t1 ORDER BY a;
+a b
+1 t1, text 11
+3 t1, text 33
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+SELECT * FROM t1 ORDER BY a;
+a b
+1 t1, text 11
+3 t1, text 33
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** SELECT ********************
+INSERT INTO t1 VALUES(1, 't1, text 1');
+SELECT * FROM t1 WHERE b <> UUID() ORDER BY a;
+a b
+1 t1, text 1
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** JOIN ********************
+INSERT INTO t1 VALUES(1, 'CCC');
+INSERT INTO t1 VALUES(2, 'DDD');
+INSERT INTO t2 VALUES(1, 'DDD');
+INSERT INTO t2 VALUES(2, 'CCC');
+SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a ORDER BY t1.a,t2.a;
+a b a b
+1 CCC 1 DDD
+2 DDD 2 CCC
+SELECT * FROM t1 INNER JOIN t2 ON t1.b = t2.b ORDER BY t1.a,t2.a;
+a b a b
+1 CCC 2 CCC
+2 DDD 1 DDD
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** UNION ********************
+INSERT INTO t1 VALUES(1, 't1, text 1');
+INSERT INTO t2 VALUES(1, 't2, text 1');
+SELECT * FROM t1 UNION SELECT * FROM t2 WHERE t2.b <> UUID();
+a b
+1 t1, text 1
+1 t2, text 1
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** TRUNCATE ********************
+INSERT INTO t1 VALUES(1, 't1, text 1');
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 t1, text 1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 t1, text 1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+TRUNCATE t1;
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+SELECT * FROM t1 ORDER BY a;
+a b
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+0
+SELECT * FROM t1 ORDER BY a;
+a b
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** UPDATE ********************
+INSERT INTO t1 VALUES(1, 't1, text 1');
+INSERT INTO t2 VALUES(1, 't2, text 1');
+UPDATE t1 SET b = 't1, text 1 updated' WHERE a = 1;
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 t1, text 1 updated
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1
+SELECT * FROM t2 ORDER BY a;
+a b
+1 t2, text 1
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 t1, text 1 updated
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1
+SELECT * FROM t2 ORDER BY a;
+a b
+1 t2, text 1
+UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test';
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 test
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1
+SELECT * FROM t2 ORDER BY a;
+a b
+1 test
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 test
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1
+SELECT * FROM t2 ORDER BY a;
+a b
+1 test
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** DESCRIBE ********************
+DESCRIBE t1;
+Field Type Null Key Default Extra
+a int(11) NO PRI NULL auto_increment
+b char(254) YES NULL
+DESCRIBE t2 b;
+Field Type Null Key Default Extra
+b char(254) YES NULL
+
+******************** USE ********************
+USE test_rpl;
+
+******************** TRANSACTION ********************
+START TRANSACTION;
+INSERT INTO t1 VALUES (1, 'start');
+COMMIT;
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 start
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 start
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+START TRANSACTION;
+INSERT INTO t1 VALUES (2, 'rollback');
+ROLLBACK;
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 start
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 start
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+START TRANSACTION;
+INSERT INTO t1 VALUES (3, 'before savepoint s1');
+SAVEPOINT s1;
+INSERT INTO t1 VALUES (4, 'after savepoint s1');
+ROLLBACK TO SAVEPOINT s1;
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+SELECT * FROM t1 ORDER BY a;
+a b
+1 start
+3 before savepoint s1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 start
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+START TRANSACTION;
+INSERT INTO t1 VALUES (5, 'before savepoint s2');
+SAVEPOINT s2;
+INSERT INTO t1 VALUES (6, 'after savepoint s2');
+INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID()));
+RELEASE SAVEPOINT s2;
+COMMIT;
+DELETE FROM t1 WHERE a = 7;
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+SELECT * FROM t1 ORDER BY a;
+a b
+1 start
+3 before savepoint s1
+5 before savepoint s2
+6 after savepoint s2
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4
+SELECT * FROM t1 ORDER BY a;
+a b
+1 start
+3 before savepoint s1
+5 before savepoint s2
+6 after savepoint s2
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** LOCK TABLES ********************
+LOCK TABLES t1 READ , t2 READ;
+UNLOCK TABLES;
+
+******************** TRANSACTION ISOLATION LEVEL ********************
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+
+******************** CREATE USER ********************
+CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111';
+==========MASTER==========
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 N
+==========SLAVE===========
+USE test_rpl;
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 N
+
+******************** GRANT ********************
+GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost';
+==========MASTER==========
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 Y
+==========SLAVE===========
+USE test_rpl;
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 Y
+
+******************** REVOKE ********************
+REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost';
+==========MASTER==========
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 N
+==========SLAVE===========
+USE test_rpl;
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 N
+
+******************** SET PASSWORD ********************
+SET PASSWORD FOR 'user_test_rpl'@'localhost' = '*0000000000000000000000000000000000000000';
+==========MASTER==========
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+localhost user_test_rpl *0000000000000000000000000000000000000000 N
+==========SLAVE===========
+USE test_rpl;
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+localhost user_test_rpl *0000000000000000000000000000000000000000 N
+
+******************** RENAME USER ********************
+RENAME USER 'user_test_rpl'@'localhost' TO 'user_test_rpl_2'@'localhost';
+==========MASTER==========
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N
+==========SLAVE===========
+USE test_rpl;
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N
+
+******************** DROP USER ********************
+DROP USER 'user_test_rpl_2'@'localhost';
+==========MASTER==========
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+==========SLAVE===========
+USE test_rpl;
+SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password select_priv
+INSERT INTO t1 VALUES(100, 'test');
+
+******************** ANALYZE ********************
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test_rpl.t1 analyze status OK
+
+******************** CHECK TABLE ********************
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test_rpl.t1 check status OK
+
+******************** CHECKSUM TABLE ********************
+CHECKSUM TABLE t1;
+Table Checksum
+test_rpl.t1 1837058639
+
+******************** OPTIMIZE TABLE ********************
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test_rpl.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test_rpl.t1 optimize status OK
+
+******************** REPAIR TABLE ********************
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test_rpl.t1 repair note The storage engine for the table doesn't support repair
+
+******************** SET VARIABLE ********************
+SET @test_rpl_var = 1;
+SHOW VARIABLES LIKE 'test_rpl_var';
+Variable_name Value
+
+******************** SHOW ********************
+==========MASTER==========
+SHOW DATABASES LIKE 'test_rpl%';
+Database (test_rpl%)
+test_rpl
+==========SLAVE===========
+SHOW DATABASES LIKE 'test_rpl%';
+Database (test_rpl%)
+test_rpl
+
+******************** PROCEDURE ********************
+CREATE PROCEDURE p1 ()
+BEGIN
+UPDATE t1 SET b = 'test' WHERE a = 201;
+END|
+CREATE PROCEDURE p2 ()
+BEGIN
+UPDATE t1 SET b = UUID() WHERE a = 202;
+END|
+INSERT INTO t1 VALUES(201, 'test 201');
+CALL p1();
+INSERT INTO t1 VALUES(202, 'test 202');
+CALL p2();
+DELETE FROM t1 WHERE a = 202;
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+SELECT * FROM t1 ORDER BY a;
+a b
+100 test
+201 test
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+2
+SELECT * FROM t1 ORDER BY a;
+a b
+100 test
+201 test
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+ALTER PROCEDURE p1 COMMENT 'p1';
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** TRIGGER ********************
+CREATE TRIGGER tr1 BEFORE INSERT ON t1
+FOR EACH ROW BEGIN
+INSERT INTO t2 SET a = NEW.a, b = NEW.b;
+END|
+INSERT INTO t1 VALUES (1, 'test');
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 test
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1
+SELECT * FROM t2 ORDER BY a;
+a b
+1 test
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 test
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1
+SELECT * FROM t2 ORDER BY a;
+a b
+1 test
+DELETE FROM t1;
+DELETE FROM t2;
+DROP TRIGGER tr1;
+
+
+******************** EVENTS ********************
+GRANT EVENT ON *.* TO 'root'@'localhost';
+INSERT INTO t1 VALUES(1, 'test1');
+CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1;
+==========MASTER==========
+SHOW EVENTS;
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+==========SLAVE===========
+USE test_rpl;
+SHOW EVENTS;
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 test1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 test1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 test1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 test1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+ALTER EVENT e1 RENAME TO e2;
+==========MASTER==========
+SHOW EVENTS;
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+==========SLAVE===========
+USE test_rpl;
+SHOW EVENTS;
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+==========MASTER==========
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 test1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+==========SLAVE===========
+USE test_rpl;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+SELECT * FROM t1 ORDER BY a;
+a b
+1 test1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+0
+SELECT * FROM t2 ORDER BY a;
+a b
+DROP EVENT e2;
+==========MASTER==========
+SHOW EVENTS;
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+==========SLAVE===========
+USE test_rpl;
+SHOW EVENTS;
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+DELETE FROM t1;
+DELETE FROM t2;
+
+******************** VIEWS ********************
+INSERT INTO t1 VALUES(1, 'test1');
+INSERT INTO t1 VALUES(2, 'test2');
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1;
+CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID();
+==========MASTER==========
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci
+SELECT * FROM v1 ORDER BY a;
+a b
+1 test1
+==========SLAVE===========
+USE test_rpl;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci
+SELECT * FROM v1 ORDER BY a;
+a b
+1 test1
+ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2;
+==========MASTER==========
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci
+SELECT * FROM v1 ORDER BY a;
+a b
+2 test2
+==========SLAVE===========
+USE test_rpl;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci
+SELECT * FROM v1 ORDER BY a;
+a b
+2 test2
+DROP VIEW v1;
+DROP VIEW v2;
+DELETE FROM t1;
+DELETE FROM t2;
+
+
+******************** SHOW BINLOG EVENTS ********************
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # CREATE DATABASE test_rpl
+master-bin.000001 # Query # # use `test_rpl`; CREATE TABLE t1 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=TokuDB
+master-bin.000001 # Query # # use `test_rpl`; CREATE TABLE t2 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=TokuDB
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(2, 't1, text 2')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test_rpl.t2)
+master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test_rpl.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1'
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2 WHERE a = 2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(2, 't1, text 2')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(3, 't1, text 3')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; REPLACE INTO t1 VALUES(1, 't1, text 11')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; REPLACE INTO t1 SET a=3, b='t1, text 33'
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 'CCC')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(2, 'DDD')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES(1, 'DDD')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES(2, 'CCC')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test_rpl`; TRUNCATE t1
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; UPDATE t1 SET b = 't1, text 1 updated' WHERE a = 1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test'
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (1, 'start')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (3, 'before savepoint s1')
+master-bin.000001 # Query # # SAVEPOINT `s1`
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (5, 'before savepoint s2')
+master-bin.000001 # Query # # SAVEPOINT `s2`
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (6, 'after savepoint s2')
+master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 7
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test_rpl`; CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111'
+master-bin.000001 # Query # # use `test_rpl`; GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost'
+master-bin.000001 # Query # # use `test_rpl`; REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost'
+master-bin.000001 # Query # # use `test_rpl`; SET PASSWORD FOR 'user_test_rpl'@'localhost'='*0000000000000000000000000000000000000000'
+master-bin.000001 # Query # # use `test_rpl`; RENAME USER 'user_test_rpl'@'localhost' TO 'user_test_rpl_2'@'localhost'
+master-bin.000001 # Query # # use `test_rpl`; DROP USER 'user_test_rpl_2'@'localhost'
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(100, 'test')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test_rpl`; ANALYZE TABLE t1
+master-bin.000001 # Query # # use `test_rpl`; OPTIMIZE TABLE t1
+master-bin.000001 # Query # # use `test_rpl`; REPAIR TABLE t1
+master-bin.000001 # Query # # use `test_rpl`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+BEGIN
+UPDATE t1 SET b = 'test' WHERE a = 201;
+END
+master-bin.000001 # Query # # use `test_rpl`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`()
+BEGIN
+UPDATE t1 SET b = UUID() WHERE a = 202;
+END
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(201, 'test 201')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; UPDATE t1 SET b = 'test' WHERE a = 201
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(202, 'test 202')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1 WHERE a = 202
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test_rpl`; ALTER PROCEDURE p1 COMMENT 'p1'
+master-bin.000001 # Query # # use `test_rpl`; DROP PROCEDURE p1
+master-bin.000001 # Query # # use `test_rpl`; DROP PROCEDURE p2
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test_rpl`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1
+FOR EACH ROW BEGIN
+INSERT INTO t2 SET a = NEW.a, b = NEW.b;
+END
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
+master-bin.000001 # Table_map # # table_id: # (test_rpl.t2)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test_rpl`; DROP TRIGGER tr1
+master-bin.000001 # Query # # use `test_rpl`; GRANT EVENT ON *.* TO 'root'@'localhost'
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 'test1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test_rpl`; CREATE DEFINER=`root`@`localhost` EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1
+master-bin.000001 # Query # # use `test_rpl`; ALTER EVENT e1 RENAME TO e2
+master-bin.000001 # Query # # use `test_rpl`; DROP EVENT e2
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(1, 'test1')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES(2, 'test2')
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 1
+master-bin.000001 # Query # # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS SELECT * FROM t1 WHERE b <> UUID()
+master-bin.000001 # Query # # use `test_rpl`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 2
+master-bin.000001 # Query # # use `test_rpl`; DROP VIEW v1
+master-bin.000001 # Query # # use `test_rpl`; DROP VIEW v2
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t1
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
+master-bin.000001 # Xid # # COMMIT /* XID */
+drop database test_rpl;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result
index 6db2036d933..5926cdda565 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ff.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result
index 3bcd3e8ccdd..0b5ac77481f 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result
index 6db2036d933..5926cdda565 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tf.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result
index 6db2036d933..5926cdda565 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_tt.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result
index fc961fd0c13..162655f9896 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup0.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result
index 5325f6c3c6d..3c909718426 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc0_lookup1.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result
index 5325f6c3c6d..3c909718426 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup0.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result
index 5325f6c3c6d..3c909718426 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_pk_uc1_lookup1.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result
index 0b958b89d0f..941010071ae 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup0.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, b bigint not null, c bigint not null, primary key(a), unique key(c)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result
index 83dcdb394df..6a0b1126710 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_update_unique_uc0_lookup1.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, b bigint not null, c bigint not null, primary key(a), unique key(c)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result
index 6db2036d933..5926cdda565 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result
index 3bcd3e8ccdd..0b5ac77481f 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_pk_uc1.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, primary key(a)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result
index 9eb1f2edf20..60ffc0d0530 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, b bigint not null, primary key(a), unique key(b)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result
index 3bed6ea282a..2f2cf58032e 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_write_unique_uc1.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists t;
create table t (a bigint not null, b bigint not null, primary key(a), unique key(b)) engine=tokudb;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result
new file mode 100644
index 00000000000..8c2fec847a9
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result
@@ -0,0 +1,48 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+include/rpl_reset.inc
+**** On Master ****
+CREATE TABLE t1 (a INT, b LONG) ENGINE=TokuDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+include/sync_slave_sql_with_master.inc
+**** On Master ****
+TRUNCATE TABLE t1;
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+==== Test using a table with delete triggers ====
+**** On Master ****
+SET @count := 1;
+CREATE TABLE t2 (a INT, b LONG) ENGINE=TokuDB;
+CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
+include/sync_slave_sql_with_master.inc
+**** On Master ****
+TRUNCATE TABLE t1;
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t2, slave:t2]
+DROP TABLE t1,t2;
+include/sync_slave_sql_with_master.inc
+include/rpl_reset.inc
+**** On Master ****
+CREATE TABLE t1 (a INT, b LONG) ENGINE=TokuDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+include/sync_slave_sql_with_master.inc
+**** On Master ****
+DELETE FROM t1;
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t1, slave:t1]
+==== Test using a table with delete triggers ====
+**** On Master ****
+SET @count := 1;
+CREATE TABLE t2 (a INT, b LONG) ENGINE=TokuDB;
+CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
+include/sync_slave_sql_with_master.inc
+**** On Master ****
+DELETE FROM t1;
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:t2, slave:t2]
+DROP TABLE t1,t2;
+include/sync_slave_sql_with_master.inc
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result
new file mode 100644
index 00000000000..426c5dbeb3f
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result
@@ -0,0 +1,13 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = '';
+CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=TokuDB;
+INSERT INTO t1 VALUES (b'0', b'01', b'101');
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result b/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result
index 78a66421446..add5e6b9529 100644
--- a/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result
+++ b/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result
@@ -1,4 +1,7 @@
include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
CREATE TABLE t1(`a` INT) ENGINE=TokuDB;
CREATE TABLE t2(`a` INT) ENGINE=InnoDB;
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_deadlock_tokudb-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_deadlock_tokudb-slave.opt
new file mode 100644
index 00000000000..3819e7c3f7b
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_deadlock_tokudb-slave.opt
@@ -0,0 +1 @@
+--innodb_lock_wait_timeout=4 --slave-transaction-retries=2 --max-relay-log-size=4096
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_deadlock_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_deadlock_tokudb.test
new file mode 100644
index 00000000000..86d28a12ad3
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_deadlock_tokudb.test
@@ -0,0 +1,8 @@
+-- source include/not_ndb_default.inc
+-- source include/have_tokudb.inc
+-- source include/not_mts_slave_parallel_workers.inc
+-- source include/not_relay_log_info_table.inc
+-- source include/not_master_info_table.inc
+
+let $engine_type=TokuDB;
+-- source extra/rpl_tests/rpl_deadlock.test
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_extra_col_master_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_extra_col_master_tokudb.test
new file mode 100644
index 00000000000..4ee8fd38010
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_extra_col_master_tokudb.test
@@ -0,0 +1,11 @@
+#############################################################
+# Purpose: To test having extra columns on the master WL#3915
+#############################################################
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+-- source include/have_tokudb.inc
+
+let $engine_type=TokuDB;
+--source extra/rpl_tests/rpl_extra_col_master.test
+
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_extra_col_slave_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_extra_col_slave_tokudb.test
new file mode 100644
index 00000000000..b3d157a513d
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_extra_col_slave_tokudb.test
@@ -0,0 +1,7 @@
+-- source include/have_binlog_format_row.inc
+-- source include/have_tokudb.inc
+-- source include/master-slave.inc
+
+let $engine_type='TokuDB';
+-- source extra/rpl_tests/rpl_extra_col_slave.test
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_foreign_key_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_foreign_key_tokudb.test
new file mode 100644
index 00000000000..d798cfd4a62
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_foreign_key_tokudb.test
@@ -0,0 +1,4 @@
+-- source include/not_ndb_default.inc
+-- source include/have_tokudb.inc
+let $engine_type=TokuDB;
+-- source extra/rpl_tests/rpl_foreign_key.test
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_mixed_row_tokudb-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_mixed_row_tokudb-master.opt
new file mode 100644
index 00000000000..96f0ce3f36c
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_mixed_row_tokudb-master.opt
@@ -0,0 +1 @@
+--default-storage-engine=MyISAM
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_not_null_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_not_null_tokudb.test
new file mode 100644
index 00000000000..8fde1c3415b
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_not_null_tokudb.test
@@ -0,0 +1,20 @@
+#################################################################################
+# This test checks if the replication between "null" fields to either "null"
+# fields or "not null" fields works properly. In the first case, the execution
+# should work fine. In the second case, it may fail according to the sql_mode
+# being used.
+#
+# The test is devided in three main parts:
+#
+# 1 - NULL --> NULL (no failures)
+# 2 - NULL --> NOT NULL ( sql-mode = STRICT and failures)
+# 3 - NULL --> NOT NULL ( sql-mode != STRICT and no failures)
+#
+#################################################################################
+--source include/master-slave.inc
+--source include/have_tokudb.inc
+--source include/have_binlog_format_row.inc
+
+let $engine=Innodb;
+--source extra/rpl_tests/rpl_not_null.test
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb-master.opt
new file mode 100644
index 00000000000..4426a9c9746
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb-master.opt
@@ -0,0 +1 @@
+--log-warnings=0
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb-slave.opt
new file mode 100644
index 00000000000..b351df53683
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb-slave.opt
@@ -0,0 +1,5 @@
+--log-warnings=0 --slave-transaction-retries=0
+
+
+
+
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test
new file mode 100644
index 00000000000..efb60fac2ba
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb.test
@@ -0,0 +1,15 @@
+#Want to skip this test from daily Valgrind execution
+--source include/no_valgrind_without_big.inc
+#
+# WL#5569 MTS
+#
+# The test is similar to rpl_parallel (see further instruction there) but
+# checks and provides benchmarking data with load to innodb tables.
+#
+
+--source include/master-slave.inc
+
+connection master;
+source extra/rpl_tests/rpl_parallel_load_tokudb.test;
+
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt
new file mode 100644
index 00000000000..2c35be69b98
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk-slave.opt
@@ -0,0 +1,2 @@
+--read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=OFF --slave-parallel-workers=2
+
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test
new file mode 100644
index 00000000000..fb42f40bb62
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_delete_pk.test
@@ -0,0 +1,63 @@
+# test replicated delete rows log events on a table with a primary key.
+# the slave is read only with tokudb rpl row lookups OFF.
+
+source include/have_tokudb.inc;
+let $engine=tokudb;
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+# initialize
+connection master;
+disable_warnings;
+drop table if exists t;
+enable_warnings;
+
+connection slave;
+# show variables like 'read_only';
+# show variables like 'tokudb_rpl_%';
+
+# insert some rows
+connection master;
+# select @@binlog_format;
+# select @@autocommit;
+eval create table t (a bigint not null, primary key(a)) engine=$engine;
+# show create table t;
+insert into t values (1);
+insert into t values (2),(3);
+insert into t values (4);
+
+# wait for the inserts to finish on the slave
+connection master;
+sync_slave_with_master;
+# source include/sync_slave_sql_with_master.inc;
+
+# diff tables
+connection master;
+--let $diff_tables= master:test.t, slave:test.t
+source include/diff_tables.inc;
+
+# delete a row
+connection master;
+delete from t where a=2;
+select unix_timestamp() into @tstart;
+
+# wait for the delete to finish on the slave
+connection master;
+sync_slave_with_master;
+# source include/sync_slave_sql_with_master.inc;
+connection master;
+select unix_timestamp() into @tend;
+select @tend-@tstart <= 5; # assert no delay in the delete time
+
+# diff tables
+--let $diff_tables= master:test.t, slave:test.t
+source include/diff_tables.inc;
+
+# cleanup
+connection master;
+drop table if exists t;
+sync_slave_with_master;
+# source include/sync_slave_sql_with_master.inc;
+
+source include/rpl_end.inc;
+
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt
new file mode 100644
index 00000000000..d84d7111bd6
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0-slave.opt
@@ -0,0 +1 @@
+--read-only=ON --tokudb-rpl-unique-checks-delay=10000 --tokudb-rpl-unique-checks=OFF --tokudb-rpl-lookup-rows-delay=10000 --tokudb-rpl-lookup-rows=OFF --slave-parallel-workers=2
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test
new file mode 100644
index 00000000000..998987349c7
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_update_pk_uc0_lookup0.test
@@ -0,0 +1,70 @@
+# test replicated update rows log events on a table with a primary key.
+
+source include/have_tokudb.inc;
+let $engine=tokudb;
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+# initialize
+connection master;
+disable_warnings;
+drop table if exists t;
+enable_warnings;
+
+connection slave;
+# show variables like 'read_only';
+# show variables like 'tokudb_rpl_%';
+
+# insert some rows
+connection master;
+# select @@binlog_format;
+# select @@autocommit;
+eval create table t (a bigint not null, b bigint not null, primary key(a)) engine=$engine;
+# show create table t;
+insert into t values (1,0);
+insert into t values (2,0),(3,0);
+insert into t values (4,0);
+
+# wait for the inserts to finish on the slave
+connection master;
+sync_slave_with_master;
+# source include/sync_slave_sql_with_master.inc;
+
+# diff tables
+connection master;
+--let $diff_tables= master:test.t, slave:test.t
+source include/diff_tables.inc;
+
+# delete a row
+connection master;
+update t set b=b+1 where a=2;
+update t set b=b+2 where a=1;
+update t set b=b+3 where a=4;
+update t set b=b+4 where a=3;
+update t set b=b+1 where 1<=a and a<=3;
+select unix_timestamp() into @tstart;
+
+# wait for the delete to finish on the slave
+connection master;
+sync_slave_with_master;
+# source include/sync_slave_sql_with_master.inc;
+connection master;
+select unix_timestamp() into @tend;
+select @tend-@tstart <= 5; # assert no delay in the delete time
+
+connection slave;
+select * from t;
+
+# diff tables
+--let $diff_tables= master:test.t, slave:test.t
+source include/diff_tables.inc;
+
+# cleanup
+connection master;
+drop table if exists t;
+
+sync_slave_with_master;
+# source include/sync_slave_sql_with_master.inc;
+
+source include/rpl_end.inc;
+
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt
new file mode 100644
index 00000000000..9e4f2f7048d
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk-slave.opt
@@ -0,0 +1,2 @@
+--read-only=ON --tokudb-rpl-unique-checks-delay=5000 --tokudb-rpl-unique-checks=OFF --slave-parallel-workers=2
+
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test
new file mode 100644
index 00000000000..c77e4b49605
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_parallel_tokudb_write_pk.test
@@ -0,0 +1,53 @@
+# test replicated write rows log events on a table with a primary key.
+# the slave is read only with tokudb unique checks disabled.
+
+source include/have_tokudb.inc;
+let $engine=tokudb;
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+# initialize
+connection master;
+disable_warnings;
+drop table if exists t;
+enable_warnings;
+
+connection slave;
+# show variables like 'read_only';
+# show variables like 'tokudb_rpl_unique_checks%';
+
+# insert some rows
+connection master;
+# select @@binlog_format;
+# select @@autocommit;
+eval create table t (a bigint not null, primary key(a)) engine=$engine;
+# show create table t;
+select unix_timestamp() into @tstart;
+insert into t values (1);
+insert into t values (2),(3);
+insert into t values (4);
+
+sync_slave_with_master;
+# source include/sync_slave_sql_with_master.inc;
+
+connection master;
+select unix_timestamp()-@tstart <= 10;
+
+connection slave;
+# insert into t values (5); # test read-only
+# show create table t;
+
+# diff tables
+connection master;
+--let $diff_tables= master:test.t, slave:test.t
+source include/diff_tables.inc;
+
+# cleanup
+connection master;
+drop table if exists t;
+
+sync_slave_with_master;
+# source include/sync_slave_sql_with_master.inc;
+
+source include/rpl_end.inc;
+
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_partition_tokudb-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_partition_tokudb-master.opt
new file mode 100644
index 00000000000..0eed7aaadad
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_partition_tokudb-master.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=0
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_partition_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_partition_tokudb.test
new file mode 100644
index 00000000000..a80363cc91d
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_partition_tokudb.test
@@ -0,0 +1,12 @@
+# Test of partitioning features with replication for InnoDB
+--source include/have_tokudb.inc
+--source include/have_partition.inc
+--source include/master-slave.inc
+
+# Set the default connection to 'master'
+
+let $engine_type=TokuDB;
+
+--source suite/rpl/include/rpl_partition.inc
+
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_relay_space_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_relay_space_tokudb.test
new file mode 100644
index 00000000000..232ec944c16
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_relay_space_tokudb.test
@@ -0,0 +1,4 @@
+-- source include/not_ndb_default.inc
+-- source include/have_tokudb.inc
+let $engine_type=TokuDB;
+-- source extra/rpl_tests/rpl_sv_relay_space.test
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_row_basic_3tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_row_basic_3tokudb.test
new file mode 100644
index 00000000000..d600137bec4
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_row_basic_3tokudb.test
@@ -0,0 +1,11 @@
+-- source include/have_tokudb.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+connection slave;
+let $bit_field_special = ALL_LOSSY;
+let $type= 'INNODB' ;
+let $extra_index= ;
+-- source extra/rpl_tests/rpl_row_basic.test
+
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_row_blob_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_row_blob_tokudb.test
new file mode 100644
index 00000000000..b96219a0c50
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_row_blob_tokudb.test
@@ -0,0 +1,15 @@
+#################################
+# Wrapper for rpl_row_blob.test#
+#################################
+########################################################
+# By JBM 2005-02-15 Wrapped to allow reuse of test code#
+# Added to skip if ndb is default #
+########################################################
+-- source include/not_ndb_default.inc
+-- source include/have_tokudb.inc
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type=TokuDB;
+-- source extra/rpl_tests/rpl_row_blob.test
+
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_row_log_tokudb-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_row_log_tokudb-master.opt
new file mode 100644
index 00000000000..773ec62bef2
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_row_log_tokudb-master.opt
@@ -0,0 +1,2 @@
+--skip-external-locking
+--default-storage-engine=MyISAM
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_row_log_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_row_log_tokudb.test
new file mode 100644
index 00000000000..bc624d4d89c
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_row_log_tokudb.test
@@ -0,0 +1,15 @@
+###################################
+# Wrapper for rpl_row_log.test #
+# Added wrapper so that MyISAM & #
+# Innodb and NDB could all use the#
+# Same test. NDB produced a diff #
+# bin-log #
+###################################
+-- source include/not_ndb_default.inc
+-- source include/have_binlog_format_row.inc
+-- source include/have_tokudb.inc
+-- source include/master-slave.inc
+let $engine_type=TokuDB;
+-- source extra/rpl_tests/rpl_log.test
+
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_row_rec_comp_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_row_rec_comp_tokudb.test
new file mode 100644
index 00000000000..8d84de1df7d
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_row_rec_comp_tokudb.test
@@ -0,0 +1,11 @@
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+-- source include/have_tokudb.inc
+
+#
+# BUG#52868 Wrong handling of NULL value during update, replication out of sync
+#
+
+-- let $engine= TokuDB
+-- source extra/rpl_tests/rpl_record_compare.test
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_row_sp002_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_row_sp002_tokudb.test
new file mode 100644
index 00000000000..82c1e17f488
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_row_sp002_tokudb.test
@@ -0,0 +1,4 @@
+-- source include/not_ndb_default.inc
+-- source include/have_tokudb.inc
+let $engine_type=TokuDB;
+-- source extra/rpl_tests/rpl_row_sp002.test
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_row_sp007_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_row_sp007_tokudb.test
new file mode 100644
index 00000000000..6deaa68d23e
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_row_sp007_tokudb.test
@@ -0,0 +1,4 @@
+-- source include/not_ndb_default.inc
+-- source include/have_tokudb.inc
+let $engine_type=TokuDB;
+-- source extra/rpl_tests/rpl_row_sp007.test
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_row_tabledefs_3tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_row_tabledefs_3tokudb.test
new file mode 100644
index 00000000000..e4558d0e87a
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_row_tabledefs_3tokudb.test
@@ -0,0 +1,10 @@
+
+-- source include/have_binlog_format_row.inc
+-- source include/have_tokudb.inc
+-- source include/master-slave.inc
+
+let $engine_type=TokuDB;
+-- source extra/rpl_tests/rpl_row_tabledefs.test
+
+
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_set_null_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_set_null_tokudb.test
new file mode 100644
index 00000000000..78ae341b29f
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_set_null_tokudb.test
@@ -0,0 +1,7 @@
+-- source include/have_binlog_format_mixed_or_row.inc
+-- source include/master-slave.inc
+-- source include/have_tokudb.inc
+
+-- let $engine= TokuDB
+-- source extra/rpl_tests/rpl_set_null.test
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_stm_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_stm_tokudb.test
new file mode 100644
index 00000000000..72daaefd3fb
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_stm_tokudb.test
@@ -0,0 +1,11 @@
+# File for specialities regarding replication from or to InnoDB
+# tables.
+
+source include/master-slave.inc;
+source include/have_tokudb.inc;
+source include/have_binlog_format_statement.inc;
+# gtids disabled because it tests DROP TEMPORARY inside a transaction
+source include/not_gtid_enabled.inc;
+
+source extra/rpl_tests/rpl_tokudb.test;
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb-master.opt
new file mode 100644
index 00000000000..0eed7aaadad
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb-master.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=0
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430-master.opt
new file mode 100644
index 00000000000..0eed7aaadad
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430-master.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=0
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430-slave.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430-slave.opt
new file mode 100644
index 00000000000..0eed7aaadad
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430-slave.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=0
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430.test
new file mode 100644
index 00000000000..4cc7f032db9
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug28430.test
@@ -0,0 +1,159 @@
+#Want to skip this test from daily Valgrind execution
+--source include/no_valgrind_without_big.inc
+
+--source include/have_tokudb.inc
+--source include/have_partition.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/master-slave.inc
+
+# Set the default connection to 'master'
+
+--vertical_results
+
+let $engine_type=TokuDB;
+
+######## Creat Table Section #########
+use test;
+
+eval CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON
+ UPDATE CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type;
+
+eval CREATE TABLE test.bykey_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+ CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type
+ PARTITION BY KEY(id) partitions 5;
+
+eval CREATE TABLE test.byrange_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+ CURRENT_TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type
+ PARTITION BY RANGE(id)
+ SUBPARTITION BY hash(id) subpartitions 2
+ (PARTITION pa1 values less than (10),
+ PARTITION pa2 values less than (20),
+ PARTITION pa3 values less than (30),
+ PARTITION pa4 values less than (40),
+ PARTITION pa5 values less than (50),
+ PARTITION pa6 values less than (60),
+ PARTITION pa7 values less than (70),
+ PARTITION pa8 values less than (80),
+ PARTITION pa9 values less than (90),
+ PARTITION pa10 values less than (100),
+ PARTITION pa11 values less than MAXVALUE);
+
+######## Create SPs, Functions, Views and Triggers Section ##############
+
+delimiter |;
+CREATE PROCEDURE test.proc_norm()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM test.regular_tbl INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM test.regular_tbl WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+CREATE PROCEDURE test.proc_bykey()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO test.bykey_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM test.bykey_tbl INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM test.bykey_tbl WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+CREATE PROCEDURE test.proc_byrange()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user = CURRENT_USER();
+ SET local_uuid=UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO test.byrange_tbl VALUES (NULL, NOW(), USER(), UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM test.byrange_tbl INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM test.byrange_tbl WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+delimiter ;|
+
+############ Finish Setup Section ###################
+
+
+############ Test Section ###################
+
+CALL test.proc_norm();
+SELECT count(*) as "Master regular" FROM test.regular_tbl;
+CALL test.proc_bykey();
+SELECT count(*) as "Master bykey" FROM test.bykey_tbl;
+CALL test.proc_byrange();
+SELECT count(*) as "Master byrange" FROM test.byrange_tbl;
+
+--sync_slave_with_master
+connection slave;
+show create table test.byrange_tbl;
+SELECT count(*) "Slave norm" FROM test.regular_tbl;
+SELECT count(*) "Slave bykey" FROM test.bykey_tbl;
+SELECT count(*) "Slave byrange" FROM test.byrange_tbl;
+
+###### CLEAN UP SECTION ##############
+
+connection master;
+DROP PROCEDURE test.proc_norm;
+DROP PROCEDURE test.proc_bykey;
+DROP PROCEDURE test.proc_byrange;
+DROP TABLE test.regular_tbl;
+DROP TABLE test.bykey_tbl;
+DROP TABLE test.byrange_tbl;
+
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug30888.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug30888.test
new file mode 100644
index 00000000000..406e9c2a63a
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_bug30888.test
@@ -0,0 +1,66 @@
+--source include/have_tokudb.inc
+--source include/have_binlog_format_mixed_or_row.inc
+--source include/master-slave.inc
+
+# Set the default connection to 'master'
+
+--vertical_results
+
+#let $engine_type=TokuDB;
+let $engine_type=TokuDB;
+
+######## Creat Table Section #########
+use test;
+
+eval CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+ fkid MEDIUMINT, filler VARCHAR(255),
+ PRIMARY KEY(id)) ENGINE=$engine_type;
+
+######## Create SPs, Functions, Views and Triggers Section ##############
+
+delimiter |;
+CREATE PROCEDURE test.proc_norm()
+BEGIN
+ DECLARE ins_count INT DEFAULT 1000;
+ DECLARE del_count INT;
+ DECLARE cur_user VARCHAR(255);
+ DECLARE local_uuid VARCHAR(255);
+ DECLARE local_time TIMESTAMP;
+
+ SET local_time= NOW();
+ SET cur_user= CURRENT_USER();
+ SET local_uuid= UUID();
+
+ WHILE ins_count > 0 DO
+ INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ ins_count,'Going to test MBR for MySQL');
+ SET ins_count = ins_count - 1;
+ END WHILE;
+
+ SELECT MAX(id) FROM test.regular_tbl INTO del_count;
+ WHILE del_count > 0 DO
+ DELETE FROM test.regular_tbl WHERE id = del_count;
+ SET del_count = del_count - 2;
+ END WHILE;
+END|
+
+delimiter ;|
+
+############ Finish Setup Section ###################
+
+
+############ Test Section ###################
+
+CALL test.proc_norm();
+
+--sync_slave_with_master
+
+###### CLEAN UP SECTION ##############
+
+connection master;
+DROP PROCEDURE test.proc_norm;
+DROP TABLE test.regular_tbl;
+
+--source include/rpl_end.inc
+
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_ddl.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_ddl.test
new file mode 100644
index 00000000000..5614769307d
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_ddl.test
@@ -0,0 +1,9 @@
+#########################################
+# Purpose: testing the replication in mixed mode
+# Requirements: define binlog format for mysqld as in example below:
+# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
+#########################################
+--source include/have_binlog_format_mixed.inc
+--source include/have_tokudb.inc
+let $engine_type=TokuDB;
+--source suite/rpl/include/rpl_mixed_ddl.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt
new file mode 100644
index 00000000000..fd3de58d816
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml-master.opt
@@ -0,0 +1,2 @@
+--tokudb_pk_insert_mode=2
+
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test
new file mode 100644
index 00000000000..c27625abd7f
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_tokudb_mixed_dml.test
@@ -0,0 +1,9 @@
+#########################################
+# Purpose: testing the replication in mixed mode
+# Requirements: define binlog format for mysqld as in example below:
+# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
+#########################################
+--source include/have_binlog_format_mixed.inc
+--source include/have_tokudb.inc
+let $engine_type=TokuDB;
+--source suite/rpl/include/rpl_mixed_dml.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_truncate_3tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_truncate_3tokudb.test
new file mode 100644
index 00000000000..8c2cf7ca4ba
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_truncate_3tokudb.test
@@ -0,0 +1,4 @@
+--source include/have_tokudb.inc
+--source include/not_ndb_default.inc
+let $engine=TokuDB;
+--source extra/rpl_tests/rpl_truncate.test
diff --git a/storage/tokudb/mysql-test/rpl/t/rpl_typeconv_tokudb.test b/storage/tokudb/mysql-test/rpl/t/rpl_typeconv_tokudb.test
new file mode 100644
index 00000000000..0f73e60f278
--- /dev/null
+++ b/storage/tokudb/mysql-test/rpl/t/rpl_typeconv_tokudb.test
@@ -0,0 +1,26 @@
+--source include/have_binlog_format_row.inc
+--source include/have_tokudb.inc
+--source include/master-slave.inc
+
+#
+# BUG#49618: Field length stored incorrectly in binary log for InnoDB
+#
+
+connection slave;
+SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = '';
+
+connection master;
+CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=TokuDB;
+INSERT INTO t1 VALUES (b'0', b'01', b'101');
+sync_slave_with_master;
+
+let $diff_tables= master:t1, slave:t1;
+source include/diff_tables.inc;
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+--source include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/t/tokudb_innodb_xa_crash.test b/storage/tokudb/mysql-test/rpl/t/tokudb_innodb_xa_crash.test
index 07b117947a0..97818a597e2 100644
--- a/storage/tokudb/mysql-test/rpl/t/tokudb_innodb_xa_crash.test
+++ b/storage/tokudb/mysql-test/rpl/t/tokudb_innodb_xa_crash.test
@@ -1,6 +1,6 @@
+--source include/master-slave.inc
--source include/have_tokudb.inc
--source include/have_innodb.inc
---source include/master-slave.inc
eval CREATE TABLE t1(`a` INT) ENGINE=TokuDB;
eval CREATE TABLE t2(`a` INT) ENGINE=InnoDB;