diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-01 18:15:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-01 18:15:00 +0000 |
commit | a2a2e32c02643a0cec111511220227703fda1cd5 (patch) | |
tree | 69cc2b631234c2a8e026b9cd4d72676c61c594df /mysql-test/suite/rpl | |
parent | Releasing progress-linux version 1:10.11.8-1~progress7.99u1. (diff) | |
download | mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.tar.xz mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.zip |
Merging upstream version 1:11.4.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/rpl')
165 files changed, 15685 insertions, 432 deletions
diff --git a/mysql-test/suite/rpl/include/multisource.inc b/mysql-test/suite/rpl/include/multisource.inc index 96c4a9aa..8d9fa1f4 100644 --- a/mysql-test/suite/rpl/include/multisource.inc +++ b/mysql-test/suite/rpl/include/multisource.inc @@ -38,7 +38,8 @@ change master 'abc2' to master_host=''; eval change master 'master1' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', -master_user='root'; +master_user='root', +master_ssl_verify_server_cert=0; start slave 'master1'; set default_master_connection = 'master1'; @@ -160,6 +161,7 @@ eval change master to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', +master_ssl_verify_server_cert=0, master_use_gtid=no; start slave; diff --git a/mysql-test/suite/rpl/include/rpl_change_master_demote.inc b/mysql-test/suite/rpl/include/rpl_change_master_demote.inc index 932a2b87..d14f0a2b 100644 --- a/mysql-test/suite/rpl/include/rpl_change_master_demote.inc +++ b/mysql-test/suite/rpl/include/rpl_change_master_demote.inc @@ -29,7 +29,7 @@ if (`SELECT strcmp("$ignore_domain_ids","") != 0`) --echo # gtid_current_pos calculation --let $current_pos= `SELECT @@gtid_current_pos` --replace_result $SLAVE_MYPORT SLAVE_PORT ---eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SLAVE_MYPORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 $extra_cm_args +--eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SLAVE_MYPORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 $extra_cm_args SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC; --let $slave_pos= `SELECT @@gtid_slave_pos` --echo # Validating gtid_slave_pos == gtid_binlog_pos.. diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test index 680d5724..028c833a 100644 --- a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test +++ b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test @@ -397,8 +397,7 @@ sync_slave_with_master; STOP SLAVE; --source include/reset_slave.inc eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5), - d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP - ON UPDATE CURRENT_TIMESTAMP, + d TIMESTAMP NOT NULL DEFAULT 0, e INT NOT NULL, f text not null, g text, diff --git a/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test index 18175928..f87ea01f 100644 --- a/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test +++ b/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test @@ -24,7 +24,7 @@ # # let $debug_sync_action= 'now signal signal_name'; # -# The $dbug_sync_point becomes the value of @@global.debug generating +# The $dbug_sync_point becomes the value of @@global.debug_dbug generating # a newly started IO-slave thread's session value. # Notice incremental operations to add and remove dbug_execute_if_name # from the global variable allows propagation more dbug arguments @@ -68,7 +68,7 @@ source include/wait_for_slave_io_error.inc; # deactivate the sync point of get_master_version_and_clock() # now to avoid restarting IO-thread to re-enter it. -# There will be a new IO thread forked out with its @@session.debug +# There will be a new IO thread forked out with its @@session.debug_dbug # unset. set @@global.debug_dbug= @old_dbug; diff --git a/mysql-test/suite/rpl/include/rpl_gtid_index.inc b/mysql-test/suite/rpl/include/rpl_gtid_index.inc new file mode 100644 index 00000000..262d43d0 --- /dev/null +++ b/mysql-test/suite/rpl/include/rpl_gtid_index.inc @@ -0,0 +1,187 @@ +# Include file for main test rpl.rpl_gtid_index. +# Test GTID indexes with given parameters. +# +# Parameters: +# $NUM_POS Number of GTIDs/binlog positions to create +# $NUM_DOMAIN Number of different domains to use +# $NUM_SERVER Number of different server_id to use +# $NUM_SLAVE_CONNECTS How many GTID slave connect positions to test +# $RND_SEED Random seed + + +--echo *** Testing $NUM_POS GTIDs with $NUM_SLAVE_CONNECTS test connects + +--connection master +DELETE FROM t1 WHERE a >= 1000; +# Rotate binlogs to make new GTID index settings take effect. +FLUSH NO_WRITE_TO_BINLOG BINARY LOGS; + +# Prepare some random values, but deterministic between test runs. +CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT) + ENGINE=InnoDB; +INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1); +eval +INSERT INTO rand_data(idx, domain_id, server_id) +SELECT seq, + @tmp:=floor($NUM_DOMAIN*POW(rand($RND_SEED),2)), + 100 + $NUM_SERVER*@tmp + floor($NUM_SERVER*rand($RND_SEED)) + FROM seq_1_to_$NUM_POS; +# Let's check that the test data is deterministic. +# If this changes due to some server changes, it's fine, the .result can just +# be updated. But we want it to be identical between test runs on same code, +# to facilitate debugging test failures. +SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data; + +# Create some data for the binlog (and GTID index), recording the correct +# binlog positions and GTIDs. +CREATE TABLE gtid_data( + idx INT PRIMARY KEY, + gtid VARCHAR(44), + gtid_pos VARCHAR(255), + file VARCHAR(100), + pos INT, + row_count INT, + KEY(file, pos)) ENGINE=InnoDB; +--let $gtid= `SELECT @@last_gtid` + +--source include/save_master_gtid.inc + +--connection slave +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc + +--connection master +SET @orig_domain_id= @@gtid_domain_id; +SET @orig_server_id= @@server_id; +--let $i= 0 +--let $rotate_point= `SELECT floor($NUM_POS/2)` +--let $base_count= `SELECT COUNT(*) FROM t1` +--disable_query_log +while ($i < $NUM_POS) { + --let $file= query_get_value(SHOW MASTER STATUS, File, 1) + --let $pos= query_get_value(SHOW MASTER STATUS, Position, 1) + --let $gtid_pos= `SELECT @@gtid_binlog_pos` + --let $row_count= `SELECT $base_count + $i` + eval SET gtid_domain_id= (SELECT domain_id FROM rand_data WHERE idx=$i+1); + eval SET server_id= (SELECT server_id FROM rand_data WHERE idx=$i+1); + BEGIN; + eval INSERT INTO gtid_data(idx, gtid, gtid_pos, file, pos, row_count) + VALUES ($i, '$gtid', '$gtid_pos', '$file', $pos, $row_count); + eval INSERT INTO t1 VALUES ($i + 1000, 0); + COMMIT; +--let $gtid= `SELECT @@last_gtid` + inc $i; + if ($i==$rotate_point) { + FLUSH NO_WRITE_TO_BINLOG BINARY LOGS; + } +} +--enable_query_log +SET gtid_domain_id= @orig_domain_id; +SET server_id= @orig_server_id; + +SELECT COUNT(*) FROM gtid_data; + +# Test that BINLOG_GTID_POS returns correct positions for every GTID position. +--echo *** The result should be empty, otherwise some result is wrong: +SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos) + FROM gtid_data + WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos)) + ORDER BY idx; + +# Prepare to rewind the slave to this point to test again on same binlog. +--connection slave +SET @orig_pos= @@GLOBAL.gtid_slave_pos; +SET @orig_t1_limit= (SELECT MAX(a) FROM t1); + +--echo *** Now connect the slave to each position in turn, and test that +--echo *** the right amount of data is replicated at each point. +--let $old_silent= $keep_include_silent +--let $keep_include_silent= 1 +--let $i= 0 +--disable_query_log +while ($i < $NUM_POS) { + --connection master + --let $gtid_pos= `SELECT gtid_pos FROM gtid_data WHERE idx=$i` + --let $master_count= `SELECT row_count FROM gtid_data WHERE idx=$i` + --connection slave + --disable_result_log + eval START SLAVE UNTIL master_gtid_pos='$gtid_pos'; + --enable_result_log + --let $res= `SELECT MASTER_GTID_WAIT('$gtid_pos')` + if ($res != 0) { + --die "FAIL: MASTER_GTID_WAIT($gtid_pos) returned $res, should have been 0" + } + --source include/wait_for_slave_to_stop.inc + --let $slave_count = `SELECT COUNT(*) FROM t1` + if ($master_count != $slave_count) { + SELECT * FROM gtid_data ORDER BY file, pos; + SELECT * FROM t1 ORDER BY a; + --die "Not all rows replicated. $master_count on master but $slave_count on slave." + } + --let $i= `SELECT $i + ceil($NUM_POS / $NUM_SLAVE_CONNECTS)` +} +--enable_query_log + +--echo *** Test slave connecting to some GTID positions where the position in +--echo *** the master's binlog is different between the different domains. +--echo *** Revind the slave and test on the same binlog data from the master as before. +--connection slave +SET sql_log_bin= 0; +TRUNCATE gtid_data; +DELETE FROM t1 WHERE a > @orig_t1_limit; +SET sql_log_bin= 1; +SET GLOBAL gtid_slave_pos= @orig_pos; + +--let $i= 0 +--disable_query_log +while ($i <= $NUM_DOMAIN) { + # Build a GTID position from GTIDs that are picked at different locations + # in the gtid_data table for each domain. + --connection master + let $until_pos=` + SELECT GROUP_CONCAT(gtid SEPARATOR ',') + FROM gtid_data + WHERE idx IN ( + SELECT MAX(gtid_data.idx) AS pick + FROM gtid_data + INNER JOIN rand_data ON (rand_data.idx = gtid_data.idx) + WHERE gtid_data.idx*$NUM_DOMAIN <= (domain_id + $i)*$NUM_POS + GROUP BY domain_id + )`; + --connection slave + --disable_result_log + eval START SLAVE UNTIL master_gtid_pos='$until_pos'; + --enable_result_log + --let $res= `SELECT MASTER_GTID_WAIT('$until_pos')` + if ($res != 0) { + --die "FAIL: MASTER_GTID_WAIT($until_pos) returned $res, should have been 0" + } + --source include/wait_for_slave_to_stop.inc + + inc $i; +} +--enable_query_log +--let $keep_include_silent= $old_silent + +# Check that everything was replicated (nothing skipped). +# We have one less row on the slave since the last UNTIL is the one before +# the master inserted the last row. +--connection master +--let $master_count= `SELECT COUNT(*)-1 FROM t1` +--connection slave +--let $slave_count= `SELECT COUNT(*) FROM t1` +if ($master_count != $slave_count) { + SELECT * FROM gtid_data ORDER BY file, pos; + SELECT * FROM t1 ORDER BY a; + --die "Not all rows replicated. $master_count on master but $slave_count on slave." +} + +--connection master +DROP TABLE gtid_data, rand_data; +--source include/save_master_gtid.inc + +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +--connection master diff --git a/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test b/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test new file mode 100644 index 00000000..4f907d0b --- /dev/null +++ b/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test @@ -0,0 +1,375 @@ +# +# Helper file to run through test cases to validate that the replica will stop +# at the correct place when running STOP SLAVE UNTIL with options +# SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS. +# +# MTR Parameters: +# ssu_before_gtids (Boolean): Indicates whether to test SQL_BEFORE_GTIDS, +# (when true), or SQL_AFTER_GTIDS (when false). +# + +--let $include_filename= rpl_gtid_until_before_after_gtids.inc +--source include/begin_include_file.inc + +if ($ssu_before_gtids) +{ + --let $ssu_opt=SQL_BEFORE_GTIDS +} +if (!$ssu_before_gtids) +{ + --let $ssu_opt=SQL_AFTER_GTIDS +} + +--echo # +--echo # Test Setup ($ssu_opt) + +--echo # Clean primary and replica states +--connection master +--source include/save_master_gtid.inc +--connection slave +--source include/stop_slave.inc +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc +--source include/reset_slave.inc +--connection master +RESET MASTER; +set session gtid_domain_id=0; + +--echo # Initialize test data +--connection master +create table t1 (a int); +create table t2 (a int); + +# Set the value counters to use on insertions. Note they are only set once per +# test, subsequent invocations of this .inc file continue to increment the +# previous values. +if (!$t1_ctr) +{ + --let $t1_ctr= 100 + --let $t2_ctr= 200 +} + +--source include/save_master_gtid.inc + +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Test Case 1 ($ssu_opt): For a single-dimensional binlog state and a +--echo # STOP SLAVE UNTIL gtid position with one GTID, the replica should +if ($ssu_before_gtids) +{ +--echo # execute events up until the GTID is encountered, and immediately stop +} +if (!$ssu_before_gtids) +{ +--echo # execute events up until the GTID is encountered, finish replicating +--echo # that event group, and then stop +} + +--connection slave +--source include/stop_slave.inc +--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1) + +--connection master +set session gtid_domain_id=0; +--eval INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr +if ($ssu_before_gtids) +{ + --let $expected_stop_gtid= `SELECT @@gtid_binlog_pos` +} +--eval INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr +--let $until_gtid= `SELECT @@gtid_binlog_pos` +if (!$ssu_before_gtids) +{ + --let $expected_stop_gtid= `SELECT @@gtid_binlog_pos` +} +--eval INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr + +--connection slave +--eval START SLAVE UNTIL $ssu_opt="$until_gtid" + +--echo # Ensure the slave started +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_comparison= != +--let $slave_param_value= $initial_slave_pos +--source include/wait_for_slave_param.inc +--let $slave_param_comparison= = + +--source include/wait_for_slave_to_stop.inc +--let $actual_stop_gtid= `SELECT @@gtid_slave_pos` + +if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`) +{ + --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid) + --die Expected stop gtid != actual stop gtid +} + +--echo # Clean replica state +--connection master +--source include/save_master_gtid.inc +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Test Case 2 ($ssu_opt): If a provided until GTID doesn't exist in the +--echo # binary log due to a gap, once an event is seen that is beyond the +--echo # until GTID, the slave should immediately stop. Note the behavior of +--echo # this test case should be the same between SQL_BEFORE_GTIDS and +--echo # SQL_AFTER_GTIDS. + +--connection slave +--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1) +--source include/stop_slave.inc + +--connection master +set session gtid_domain_id=0; +--eval INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr +--eval INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr + + +--echo # Skip a seq_no +--let $binlog_pos= `SELECT @@gtid_binlog_pos` +--let $domain_id= `SELECT @@gtid_domain_id` +--let $server_id= `SELECT @@server_id` +--let $last_seq_no= `SELECT REGEXP_SUBSTR('$binlog_pos','[0-9]+\\\$')` + +--let $skipped_seq_no= `SELECT ($last_seq_no + 1)` +--let $new_seq_no= `SELECT ($skipped_seq_no + 1)` +--eval set @@session.gtid_seq_no= $new_seq_no + +--let $until_gtid= $domain_id-$server_id-$skipped_seq_no +--let $expected_stop_gtid= $binlog_pos + +--eval INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr + +--connection slave +--eval START SLAVE UNTIL $ssu_opt="$until_gtid" + +--echo # Ensure the slave started +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_comparison= != +--let $slave_param_value= $initial_slave_pos +--source include/wait_for_slave_param.inc +--let $slave_param_comparison= = + +--source include/wait_for_slave_to_stop.inc +--let $actual_stop_gtid= `SELECT @@gtid_slave_pos` + +if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`) +{ + --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid) + --die Expected stop gtid != actual stop gtid +} + +--connection slave +--source include/start_slave.inc +--connection master +--sync_slave_with_master + + +--echo # +--echo # Test Case 3 ($ssu_opt): For a multi-dimensional binlog state and a +--echo # STOP SLAVE UNTIL gtid position with one GTID, the replica should +--echo # execute events from only the specified domain until the provided GTID +if ($ssu_before_gtids) +{ +--echo # is encountered, and immediately stop +} +if (!$ssu_before_gtids) +{ +--echo # is encountered, finish replicating that event group, and then stop +} + +--connection slave +--source include/stop_slave.inc +--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1) + +--connection master +set session gtid_domain_id=0; +--eval INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr + +set session gtid_domain_id=1; +--eval INSERT INTO t2 VALUES ($t2_ctr) +--inc $t2_ctr +--eval INSERT INTO t2 VALUES ($t2_ctr) +--inc $t2_ctr + +if ($ssu_before_gtids) +{ + # Will have GTIDs for both domains 0 and 1 + --let $binlog_pos= `SELECT @@gtid_binlog_pos` + --let $expected_stop_gtid= `SELECT REGEXP_SUBSTR('$binlog_pos','0-[0-9]+-[0-9]+')` +} + +set session gtid_domain_id=0; +--eval INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr + +--let $binlog_pos= `SELECT @@gtid_binlog_pos` + +# Just the GTID for domain 0 +--let $until_gtid= `SELECT REGEXP_SUBSTR('$binlog_pos','0-[0-9]+-[0-9]+')` + +if (!$ssu_before_gtids) +{ + --let $expected_stop_gtid= $until_gtid +} + +set session gtid_domain_id=1; +--eval INSERT INTO t2 VALUES ($t2_ctr) +--inc $t2_ctr +set session gtid_domain_id=0; + +--connection slave +--eval START SLAVE UNTIL $ssu_opt="$until_gtid" + +--echo # Ensure the slave started +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_comparison= != +--let $slave_param_value= $initial_slave_pos +--source include/wait_for_slave_param.inc +--let $slave_param_comparison= = + +--source include/wait_for_slave_to_stop.inc +--let $actual_stop_gtid= `SELECT @@gtid_slave_pos` + +if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`) +{ + --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid) + --die Expected stop gtid != actual stop gtid +} + +--connection slave +--source include/start_slave.inc +--connection master +--sync_slave_with_master + + +--echo # +--echo # Test Case 4 ($ssu_opt): For a multi-dimensional binlog state and a +--echo # STOP SLAVE UNTIL gtid position with multiple GTIDs, the replica should +if ($ssu_before_gtids) +{ +--echo # for each domain, execute events only up until its provided GTID, and +--echo # once all domains have hit their end point, immediately stop. +} +if (!$ssu_before_gtids) +{ +--echo # stop executing events as soon as all listed GTIDs in the UNTIL list +--echo # have been executed. +} + +--connection slave +--source include/stop_slave.inc +--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1) + +--connection master +--eval SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr + +if ($ssu_before_gtids) +{ + # Save binlog pos for domain 0 + --let $expected_stop_gtid_d0= `SELECT REGEXP_SUBSTR(@@global.gtid_binlog_pos,'0-[0-9]+-[0-9]+')` + --echo # Tagging domain 0 stop: $expected_stop_gtid_d0 +} + +--eval SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr + +--eval SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES ($t2_ctr) +--inc $t2_ctr + +if ($ssu_before_gtids) +{ + # Save binlog pos for domain 1 + --let $expected_stop_gtid_d1= `SELECT REGEXP_SUBSTR(@@global.gtid_binlog_pos,'1-[0-9]+-[0-9]+')` + --let $expected_stop_gtid= $expected_stop_gtid_d0,$expected_stop_gtid_d1 +} + +--eval SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES ($t2_ctr) +--inc $t2_ctr + +--let $until_gtid= `SELECT @@gtid_binlog_pos` +if (!$ssu_before_gtids) +{ + --let $expected_stop_gtid= $until_gtid +} + +--eval SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES ($t1_ctr) +--inc $t1_ctr +--eval SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES ($t2_ctr) +--inc $t2_ctr + +--connection slave +--eval START SLAVE UNTIL $ssu_opt="$until_gtid" + +--echo # Ensure the slave started +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_comparison= != +--let $slave_param_value= $initial_slave_pos +--source include/wait_for_slave_param.inc +--let $slave_param_comparison= = + +--source include/wait_for_slave_to_stop.inc +--let $actual_stop_gtid= `SELECT @@gtid_slave_pos` + +if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`) +{ + --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid) + --die Expected stop gtid != actual stop gtid +} + +--connection slave +--source include/start_slave.inc +--connection master +--sync_slave_with_master + + +--echo # +--echo # Error Case 1: Not providing a valid GTID should result in a syntax +--echo # error + +--connection slave +--source include/stop_slave.inc + +--error ER_INCORRECT_GTID_STATE +--eval START SLAVE UNTIL $ssu_opt="a" + +--error ER_INCORRECT_GTID_STATE +--eval START SLAVE UNTIL $ssu_opt="0" + +--error ER_INCORRECT_GTID_STATE +--eval START SLAVE UNTIL $ssu_opt="0-1" + +--error ER_INCORRECT_GTID_STATE +--eval START SLAVE UNTIL $ssu_opt="0-1-" + +--error ER_INCORRECT_GTID_STATE +--eval START SLAVE UNTIL $ssu_opt="a-b-c" + +--source include/start_slave.inc + +--echo # +--echo # Cleanup test data +--connection master +DROP TABLE t1, t2; +--source include/save_master_gtid.inc +--connection slave +--source include/sync_with_master_gtid.inc + +--let $include_filename= rpl_gtid_until_before_after_gtids.inc +--source include/end_include_file.inc diff --git a/mysql-test/suite/rpl/include/rpl_row_blob.test b/mysql-test/suite/rpl/include/rpl_row_blob.test index 5cd7b6b4..408a2351 100644 --- a/mysql-test/suite/rpl/include/rpl_row_blob.test +++ b/mysql-test/suite/rpl/include/rpl_row_blob.test @@ -173,3 +173,21 @@ DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; # ensure cleanup on slave as well: --sync_slave_with_master + +--echo # +--echo # MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types +--echo # +--connection master +CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt)); +INSERT INTO t () VALUES (),(),(); +DELETE FROM t; + +DROP TABLE t; +--sync_slave_with_master +--connection master +CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt) STORED); +INSERT INTO t () VALUES (),(),(); +DELETE FROM t; + +DROP TABLE t; +--sync_slave_with_master diff --git a/mysql-test/suite/rpl/my.cnf b/mysql-test/suite/rpl/my.cnf index d61e32ed..fa0a2c26 100644 --- a/mysql-test/suite/rpl/my.cnf +++ b/mysql-test/suite/rpl/my.cnf @@ -6,3 +6,5 @@ # E.g. after !include ../my.cnf, in your `test.cnf`, specify your configuration # in option group e.g [mysqld.x], so that number `x` corresponds to the number # in the rpl server topology. +[mariadbd] +slave_connections_needed_for_purge=0 diff --git a/mysql-test/suite/rpl/r/grant_replication_slave.result b/mysql-test/suite/rpl/r/grant_replication_slave.result index 6ded7e72..b8de7e9f 100644 --- a/mysql-test/suite/rpl/r/grant_replication_slave.result +++ b/mysql-test/suite/rpl/r/grant_replication_slave.result @@ -38,6 +38,6 @@ drop database mysqltest1; connection slave; stop slave; change master to master_user='root'; -start slave; +include/start_slave.inc include/rpl_end.inc drop user rpl@localhost; diff --git a/mysql-test/suite/rpl/r/max_binlog_total_size.result b/mysql-test/suite/rpl/r/max_binlog_total_size.result new file mode 100644 index 00000000..f88e373d --- /dev/null +++ b/mysql-test/suite/rpl/r/max_binlog_total_size.result @@ -0,0 +1,49 @@ +include/master-slave.inc +[connection master] +# +# MDEV-31404 Implement binlog_space_limit +# +# Test that master is not deleting binary logs before slave has a +# chance to digest them +select @@global.max_binlog_total_size; +@@global.max_binlog_total_size +1500 +select @@global.max_binlog_size; +@@global.max_binlog_size +4096 +connection slave; +STOP SLAVE IO_THREAD; +include/wait_for_slave_io_to_stop.inc +connection master; +kill DUMP_THREAD; +CREATE TABLE `t1` ( +`v1` int(11) DEFAULT NULL, +`v2` varchar(8000) DEFAULT NULL, +KEY `v1` (`v1`) +); +FLUSH LOGS; +FLUSH LOGS; +FLUSH LOGS; +show binary logs; +Log_name File_size +binary.000001 # +binary.000002 # +binary.000003 # +binary.000004 # +INSERT INTO t1 VALUES (0,repeat("a",3000)); +show binary logs; +Log_name File_size +binary.000001 # +binary.000002 # +binary.000003 # +binary.000004 # +connection slave; +START SLAVE IO_THREAD; +connection master; +connection slave; +connection master; +DROP TABLE t1; +show binary logs; +Log_name File_size +binary.000004 # +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_000010.result b/mysql-test/suite/rpl/r/rpl_000010.result index a86d71bd..0b3a67bf 100644 --- a/mysql-test/suite/rpl/r/rpl_000010.result +++ b/mysql-test/suite/rpl/r/rpl_000010.result @@ -16,4 +16,5 @@ n connection master; drop table t1; connection slave; +include/wait_for_slave_to_start.inc include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_alter_extra_persistent.result b/mysql-test/suite/rpl/r/rpl_alter_extra_persistent.result index 96df87d8..b1b72830 100644 --- a/mysql-test/suite/rpl/r/rpl_alter_extra_persistent.result +++ b/mysql-test/suite/rpl/r/rpl_alter_extra_persistent.result @@ -32,8 +32,24 @@ a z1 z2 4 5 6 5 6 7 6 7 8 -#UPDATE query +alter table t1 add column z3 int default(a+2); connection master; +insert into t1 values(7); +insert into t1 values(8); +connection slave; +select * from t1 order by a; +a z1 z2 z3 +1 2 3 3 +2 3 4 4 +3 4 5 5 +4 5 6 6 +5 6 7 7 +6 7 8 8 +7 8 9 9 +8 9 10 10 +connection master; +delete from t1 where a > 6; +#UPDATE query update t1 set a = a+10; select * from t1 order by a; a @@ -45,13 +61,13 @@ a 16 connection slave; select * from t1 order by a; -a z1 z2 -11 12 13 -12 13 14 -13 14 15 -14 15 16 -15 16 17 -16 17 18 +a z1 z2 z3 +11 12 13 3 +12 13 14 4 +13 14 15 5 +14 15 16 6 +15 16 17 7 +16 17 18 8 connection master; update t1 set a = a-10; select * from t1 order by a; @@ -64,13 +80,13 @@ a 6 connection slave; select * from t1 order by a; -a z1 z2 -1 2 3 -2 3 4 -3 4 5 -4 5 6 -5 6 7 -6 7 8 +a z1 z2 z3 +1 2 3 3 +2 3 4 4 +3 4 5 5 +4 5 6 6 +5 6 7 7 +6 7 8 8 #DELETE quert connection master; delete from t1 where a > 2 and a < 4; @@ -83,12 +99,12 @@ a 6 connection slave; select * from t1 order by a; -a z1 z2 -1 2 3 -2 3 4 -4 5 6 -5 6 7 -6 7 8 +a z1 z2 z3 +1 2 3 3 +2 3 4 4 +4 5 6 6 +5 6 7 7 +6 7 8 8 #REPLACE query connection master; replace into t1 values(1); @@ -96,13 +112,13 @@ replace into t1 values(3); replace into t1 values(1); connection slave; select * from t1 order by a; -a z1 z2 -1 2 3 -2 3 4 -3 4 5 -4 5 6 -5 6 7 -6 7 8 +a z1 z2 z3 +1 2 3 3 +2 3 4 4 +3 4 5 5 +4 5 6 6 +5 6 7 7 +6 7 8 8 #SELECT query connection master; select * from t1 where a > 2 and a < 4; @@ -110,8 +126,8 @@ a 3 connection slave; select * from t1 where a > 2 and a < 4; -a z1 z2 -3 4 5 +a z1 z2 z3 +3 4 5 5 #UPDATE with SELECT query connection master; update t1 set a = a + 10 where a > 2 and a < 4; @@ -125,13 +141,13 @@ a 13 connection slave; select * from t1 order by a; -a z1 z2 -1 2 3 -2 3 4 -4 5 6 -5 6 7 -6 7 8 -13 14 15 +a z1 z2 z3 +1 2 3 3 +2 3 4 4 +4 5 6 6 +5 6 7 7 +6 7 8 8 +13 14 15 5 connection master; update t1 set a = a - 10 where a = 13; select * from t1 order by a; @@ -144,13 +160,13 @@ a 6 connection slave; select * from t1 order by a; -a z1 z2 -1 2 3 -2 3 4 -3 4 5 -4 5 6 -5 6 7 -6 7 8 +a z1 z2 z3 +1 2 3 3 +2 3 4 4 +3 4 5 5 +4 5 6 6 +5 6 7 7 +6 7 8 8 #Break Unique Constraint alter table t1 add column z4 int as (a % 6) persistent unique; connection master; @@ -168,27 +184,27 @@ a connection slave; include/wait_for_slave_sql_error.inc [errno=1062] select * from t1 order by a; -a z1 z2 z4 -1 2 3 1 -2 3 4 2 -3 4 5 3 -4 5 6 4 -5 6 7 5 -6 7 8 0 +a z1 z2 z3 z4 +1 2 3 3 1 +2 3 4 4 2 +3 4 5 5 3 +4 5 6 6 4 +5 6 7 7 5 +6 7 8 8 0 alter table t1 drop column z4; start slave; include/wait_for_slave_sql_to_start.inc connection master; connection slave; select * from t1 order by a; -a z1 z2 -1 2 3 -2 3 4 -3 4 5 -4 5 6 -5 6 7 -6 7 8 -7 8 9 +a z1 z2 z3 +1 2 3 3 +2 3 4 4 +3 4 5 5 +4 5 6 6 +5 6 7 7 +6 7 8 8 +7 8 9 9 connection master; select * from t1 order by a; a @@ -200,4 +216,161 @@ a 6 7 drop table t1; +connection slave; +connection master; +set binlog_row_image=minimal; +create table t1(a int primary key auto_increment, b int unique); +insert into t1 values(1, 1); +insert into t1 values(2, 2); +insert into t1 values(3, 3); +insert into t1 values(4, 4); +insert into t1 values(5, 5); +connection slave; +alter table t1 add column d1 int default (b), +add column z1 int as (b+1) virtual, +add column z2 int as (b+2) persistent; +connection master; +insert into t1 values(6, 6); +update t1 set a = 11 where a = 1; +update t1 set b = 12 where b = 2; +delete from t1 where a = 3; +delete from t1 where b = 5; +update t1 set b = 16 where a = 6; +connection slave; +select * from t1; +a b d1 z1 z2 +11 1 1 2 3 +2 12 2 13 14 +4 4 4 5 6 +6 16 6 17 18 +# Cleanup +connection master; +drop table t1; +connection slave; +connection master; +set binlog_row_image=minimal; +# +# MDEV-29069 ER_KEY_NOT_FOUND upon online autoinc addition and +# concurrent DELETE +# +create or replace table t (a int); +insert into t values (10),(20),(30); +connection slave; +alter table t add pk int auto_increment primary key; +connection master; +delete from t where a = 20; +update t set a = a + 1 where a = 10; +connection slave; +select * from t; +a pk +11 1 +30 3 +connection master; +# +# Add clumsy DEFAULT +# +create or replace table t (a int); +insert into t values (10),(20),(30); +connection slave; +alter table t add b int default(RAND() * 20), add key(b), +algorithm=copy, lock=none; +connection master; +delete from t where a = 20; +update t set a = a + 1 where a = 10; +connection slave; +select a from t; +a +11 +30 +connection master; +# CURRENT_TIMESTAMP +create or replace table t (a int); +insert into t values (10),(20),(30); +connection slave; +alter table t add b timestamp default CURRENT_TIMESTAMP, add key(b); +connection master; +delete from t where a = 20; +update t set a = a + 1 where a = 10; +connection slave; +select a from t; +a +11 +30 +connection master; +# CURRENT_TIMESTAMP, mixed key +create or replace table t (a int); +insert into t values (10),(20),(30); +connection slave; +alter table t add b timestamp default CURRENT_TIMESTAMP, add key(a, b); +connection master; +delete from t where a = 20; +update t set a = a + 1 where a = 10; +connection slave; +select a from t; +a +11 +30 +connection master; +# Mixed primary key +create or replace table t (a int); +insert into t values (10),(20),(30); +connection slave; +alter table t add b int default (1), add primary key(b, a); +connection master; +delete from t where a = 20; +update t set a = a + 1 where a = 10; +connection slave; +select a from t; +a +11 +30 +connection master; +# +# Normal row, could be used as a key +# +create or replace table t (a int); +insert into t values (10),(20),(30); +connection slave; +alter table t add b int as (a * 10) unique; +connection master; +delete from t where a = 20; +update t set a = a + 1 where a = 10; +connection slave; +select * from t; +a b +11 110 +30 300 +connection master; +# +# Add key for old row +# +create or replace table t (a int); +insert into t values (10),(20),(30); +connection slave; +alter table t add unique(a); +connection master; +delete from t where a = 20; +update t set a = a + 1 where a = 10; +connection slave; +select * from t; +a +11 +30 +# Cleanup +connection master; +connection slave; +connection master; +drop table t; +# +# MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types +# +create table t(geo geometrycollection default st_geomfromtext('point(1 1)')); +insert into t () values (),(),(); +connection slave; +alter table t add vcol9 point as (geo), add key(vcol9); +connection master; +delete from t; +connection slave; +connection master; +drop table t; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_alter_instant.result b/mysql-test/suite/rpl/r/rpl_alter_innodb.result index 35380fde..35380fde 100644 --- a/mysql-test/suite/rpl/r/rpl_alter_instant.result +++ b/mysql-test/suite/rpl/r/rpl_alter_innodb.result diff --git a/mysql-test/suite/rpl/r/rpl_alter_online_debug.result b/mysql-test/suite/rpl/r/rpl_alter_online_debug.result new file mode 100644 index 00000000..d0040b39 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_alter_online_debug.result @@ -0,0 +1,84 @@ +include/master-slave.inc +[connection master] +connection master; +call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); +connection slave; +call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); +# MDEV-31804 Assertion `thd->m_transaction_psi == __null' fails upon +# replicating online ALTER +connection master; +create table t (a char(8)) engine=myisam; +insert into t values ('foo'),('bar'); +set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter'; +set @old_slave_exec_mode= @@global.slave_exec_mode; +set @@global.slave_exec_mode= idempotent; +alter table t force; +connection master1; +set debug_sync= 'now wait_for go_dml'; +insert into t (a) values ('qux'); +set debug_sync= 'now signal go_alter'; +connection master; +connection slave; +connection master; +drop table t; +set global slave_exec_mode= @old_slave_exec_mode; +set debug_sync= reset; +# +# End of 11.2 tests (Single-phase alter) +# +connection slave; +include/stop_slave.inc +set global slave_parallel_threads=3; +set global slave_parallel_mode= optimistic; +set global binlog_row_image=MINIMAL; +connection master; +# +# MDEV-31755 Replica's DML event deadlocks wit online alter table +# +# Three threads for SA,U,CA +create table t (id int, a int, primary key (id)) engine=innodb; +insert into t values (1,10), (2,20); +set @@session.binlog_alter_two_phase=1; +set debug_sync= 'alter_table_online_downgraded signal ready wait_for go'; +alter table t add c text default('qqq') after id, algorithm=copy, lock=none; +connection master1; +set debug_sync= 'now wait_for ready'; +update t set a = 1; +set debug_sync= 'now signal go'; +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +select * from t; +id c a +1 qqq 1 +2 qqq 1 +connection master; +drop table t; +# MDEV-31838 Assertion fails on replica upon parallel +# replication with two-phase alter and MINIMAL row image +create table t (id int, a int, primary key(id)) engine=aria; +insert into t values (1,0); +set @@session.binlog_alter_two_phase=1; +set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter'; +alter table t force, algorithm=copy, lock=none; +connection master1; +set binlog_row_image=MINIMAL; +set debug_sync= 'now wait_for go_dml'; +update ignore t set a = 1; +set debug_sync= 'now signal go_alter'; +connection master; +drop table t; +connection slave; +connection master; +# +# End of 11.2 tests (Two-phase alter) +# +connection slave; +include/stop_slave.inc +set global binlog_row_image=FULL; +set global slave_parallel_threads=0; +set global slave_parallel_mode= optimistic; +include/start_slave.inc +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_bug26395.result b/mysql-test/suite/rpl/r/rpl_bug26395.result index 7c54e7b2..9053c332 100644 --- a/mysql-test/suite/rpl/r/rpl_bug26395.result +++ b/mysql-test/suite/rpl/r/rpl_bug26395.result @@ -8,7 +8,7 @@ Table Create Table tinnodb CREATE TABLE `tinnodb` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -set @old_debug= @@debug; +set @old_debug= @@debug_dbug; set @@debug_dbug= 'd,do_not_write_xid'; ==== Test ==== INSERT INTO tinnodb VALUES (1); diff --git a/mysql-test/suite/rpl/r/rpl_change_master_demote.result b/mysql-test/suite/rpl/r/rpl_change_master_demote.result index 2114ac4a..5deb412c 100644 --- a/mysql-test/suite/rpl/r/rpl_change_master_demote.result +++ b/mysql-test/suite/rpl/r/rpl_change_master_demote.result @@ -24,7 +24,7 @@ GTID_CURRENT_POS GTID_SLAVE_POS # First ensure gtid_slave_pos after master_demote_to_slave matches # gtid_current_pos calculation -CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ; SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC; VARIABLE_NAME GLOBAL_VALUE GTID_BINLOG_POS @@ -91,7 +91,7 @@ GTID_CURRENT_POS 0-1-2 GTID_SLAVE_POS # First ensure gtid_slave_pos after master_demote_to_slave matches # gtid_current_pos calculation -CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ; SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC; VARIABLE_NAME GLOBAL_VALUE GTID_BINLOG_POS 0-1-2 @@ -151,7 +151,7 @@ GTID_CURRENT_POS 0-1-6 GTID_SLAVE_POS 0-2-5 # First ensure gtid_slave_pos after master_demote_to_slave matches # gtid_current_pos calculation -CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ; SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC; VARIABLE_NAME GLOBAL_VALUE GTID_BINLOG_POS 0-1-6 @@ -213,7 +213,7 @@ GTID_CURRENT_POS 0-1-10 GTID_SLAVE_POS 0-1-10 # First ensure gtid_slave_pos after master_demote_to_slave matches # gtid_current_pos calculation -CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ; SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC; VARIABLE_NAME GLOBAL_VALUE GTID_BINLOG_POS 0-1-10 @@ -278,7 +278,7 @@ GTID_CURRENT_POS 0-1-14,1-1-2 GTID_SLAVE_POS 0-2-13 # First ensure gtid_slave_pos after master_demote_to_slave matches # gtid_current_pos calculation -CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ; SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC; VARIABLE_NAME GLOBAL_VALUE GTID_BINLOG_POS 0-1-14,1-1-2 @@ -361,7 +361,7 @@ GTID_CURRENT_POS 0-1-18,1-1-2,2-1-2 GTID_SLAVE_POS 0-1-18,1-1-2 # First ensure gtid_slave_pos after master_demote_to_slave matches # gtid_current_pos calculation -CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ; SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC; VARIABLE_NAME GLOBAL_VALUE GTID_BINLOG_POS 0-1-18,1-3-4,2-1-2,4-3-2 @@ -427,7 +427,7 @@ GTID_CURRENT_POS 0-2-21,1-3-4,2-1-3,3-1-2,4-3-2 GTID_SLAVE_POS 0-2-21,1-3-4,2-1-2,4-3-2 # First ensure gtid_slave_pos after master_demote_to_slave matches # gtid_current_pos calculation -CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3); +CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3); SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC; VARIABLE_NAME GLOBAL_VALUE GTID_BINLOG_POS 0-1-18,1-3-4,2-1-3,3-1-2,4-3-2 @@ -527,7 +527,7 @@ GTID_CURRENT_POS 0-1-26,1-3-4,2-1-3,3-1-2,4-3-2 GTID_SLAVE_POS 0-1-26,1-3-4,2-1-3,3-1-2,4-3-2 # First ensure gtid_slave_pos after master_demote_to_slave matches # gtid_current_pos calculation -CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3); +CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3); SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC; VARIABLE_NAME GLOBAL_VALUE GTID_BINLOG_POS 0-1-26,1-3-4,2-1-3,3-1-2,4-3-2 @@ -593,7 +593,7 @@ GTID_CURRENT_POS 0-2-29,1-3-4,2-1-3,3-1-2,4-3-2 GTID_SLAVE_POS 0-2-29,1-3-4,2-1-3,3-1-2,4-3-2 # First ensure gtid_slave_pos after master_demote_to_slave matches # gtid_current_pos calculation -CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3); +CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3); SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC; VARIABLE_NAME GLOBAL_VALUE GTID_BINLOG_POS 0-1-26,1-3-4,2-1-3,3-1-2,4-3-2 diff --git a/mysql-test/suite/rpl/r/rpl_checksum_cache.result b/mysql-test/suite/rpl/r/rpl_checksum_cache.result index e8f221cc..b908c546 100644 --- a/mysql-test/suite/rpl/r/rpl_checksum_cache.result +++ b/mysql-test/suite/rpl/r/rpl_checksum_cache.result @@ -121,13 +121,54 @@ connection slave; include/diff_tables.inc [master:test.t1, slave:test.t1] include/diff_tables.inc [master:test.t2, slave:test.t2] include/diff_tables.inc [master:test.t3, slave:test.t3] +*** Test switching checksum algorithm while ongoing transactions have pre-computed checksum in their binlog cache *** +connection master; +CREATE TABLE t4 (a INT, b INT, c VARCHAR(1024), PRIMARY KEY (a,b)) ENGINE=InnoDB; +BEGIN; +INSERT INTO t4 VALUES (1, 1, "small, pre-computed checksums"); +connection server_1; +BEGIN; +INSERT INTO t4 VALUES (2, 1, "big, pre-computed checksums"); +set @@global.binlog_checksum = NONE; +connection master; +INSERT INTO t4 VALUES (1, 2, "done"); +COMMIT; +connection server_1; +INSERT INTO t4 VALUES (2, 22, "done"); +COMMIT; +connection master; +BEGIN; +INSERT INTO t4 VALUES (3, 1, "small, no pre-computed checksums"); +connection server_1; +BEGIN; +INSERT INTO t4 VALUES (4, 1, "big, no pre-computed checksums"); +set @@global.binlog_checksum = CRC32; +connection master; +INSERT INTO t4 VALUES (3, 2, "done"); +COMMIT; +connection server_1; +INSERT INTO t4 VALUES (4, 22, "done"); +COMMIT; +connection slave; +*** Test the --binlog-legacy-event-pos option. +connection master; +FLUSH BINARY LOGS; +BEGIN; +INSERT INTO t4 VALUES (5, 1, "Zero end_log_pos"); +COMMIT; +set @@global.binlog_legacy_event_pos= 1; +BEGIN; +INSERT INTO t4 VALUES (6, 1, "Non-zero end_log_pos"); +COMMIT; +set @@global.binlog_legacy_event_pos= 0; +connection slave; connection master; begin; delete from t1; delete from t2; delete from t3; commit; -drop table t1, t2, t3; +drop table t1, t2, t3, t4; set @@global.binlog_cache_size = @save_binlog_cache_size; set @@global.binlog_checksum = @save_binlog_checksum; set @@global.master_verify_checksum = @save_master_verify_checksum; diff --git a/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result b/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result index 2596d346..9dd4aed2 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result +++ b/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result @@ -32,7 +32,7 @@ include/sync_with_master_gtid.inc connection server_1; set @@global.gtid_strict_mode = true; set @@global.rpl_semi_sync_slave_enabled = 1; -CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=SLAVE_POS; +CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS; include/start_slave.inc ... is done. ## A. no out-of-order gtid error for own transaction made round trip diff --git a/mysql-test/suite/rpl/r/rpl_connection.result b/mysql-test/suite/rpl/r/rpl_connection.result index 9fb17b5f..4ca15c47 100644 --- a/mysql-test/suite/rpl/r/rpl_connection.result +++ b/mysql-test/suite/rpl/r/rpl_connection.result @@ -8,5 +8,5 @@ START SLAVE; include/wait_for_slave_io_error.inc [errno=1045, 1593] include/stop_slave_sql.inc CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= ''; -START SLAVE; +include/start_slave.inc include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_cross_version.result b/mysql-test/suite/rpl/r/rpl_cross_version.result deleted file mode 100644 index 1b67542c..00000000 --- a/mysql-test/suite/rpl/r/rpl_cross_version.result +++ /dev/null @@ -1,22 +0,0 @@ -include/master-slave.inc -[connection master] -==== Initialize ==== -connection slave; -include/stop_slave.inc -RESET SLAVE; -include/setup_fake_relay_log.inc -Setting up fake replication from MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001 -==== Test ==== -start slave sql_thread; -include/wait_for_slave_param.inc [Exec_Master_Log_Pos] -==== a prove that the fake has been processed successfully ==== -SELECT COUNT(*) - 17920 as zero FROM t3; -zero -0 -==== Clean up ==== -include/stop_slave_sql.inc -include/cleanup_fake_relay_log.inc -Warnings: -Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos' -drop table t1, t3; -include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_ctype_collate_implicit.result b/mysql-test/suite/rpl/r/rpl_ctype_collate_implicit.result new file mode 100644 index 00000000..0616b22e --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_ctype_collate_implicit.result @@ -0,0 +1,83 @@ +include/master-slave.inc +[connection master] +# +# MDEV-30164 System variable for default collations +# +connection master; +SET @@character_set_collations='utf8mb3=uca1400_ai_ci,' + 'utf8mb4=uca1400_ai_ci,' + 'ucs2=uca1400_ai_ci,' + 'utf16=uca1400_ai_ci,' + 'utf32=uca1400_ai_ci'; +connection master; +CREATE TABLE t1 AS SELECT CHAR(0x61 USING utf8mb4); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `CHAR(0x61 USING utf8mb4)` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +connection slave; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `CHAR(0x61 USING utf8mb4)` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +connection master; +DROP TABLE t1; +connection slave; +connection master; +CREATE TABLE t1 AS SELECT CONVERT('a' USING utf8mb4); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `CONVERT('a' USING utf8mb4)` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +connection slave; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `CONVERT('a' USING utf8mb4)` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +connection master; +DROP TABLE t1; +connection slave; +connection master; +CREATE TABLE t1 ( +c0 TEXT CHARACTER SET utf8mb3, +c1 TEXT CHARACTER SET utf8mb4, +c2 TEXT CHARACTER SET utf16, +c3 TEXT CHARACTER SET utf32, +c4 TEXT CHARACTER SET ucs2 +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c0` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `c1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL, + `c2` text CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL, + `c3` text CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL, + `c4` text CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +connection slave; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c0` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `c1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL, + `c2` text CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL, + `c3` text CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL, + `c4` text CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +connection master; +DROP TABLE t1; +connection slave; +connection master; +CREATE DATABASE db1 CHARACTER SET utf8mb4; +connection slave; +SHOW CREATE DATABASE db1; +Database Create Database +db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci */ +connection master; +DROP DATABASE db1; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.rdiff b/mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.rdiff index aaadbb28..d803f8be 100644 --- a/mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.rdiff +++ b/mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.rdiff @@ -1,5 +1,5 @@ ---- mysql-test/suite/rpl/r/rpl_delayed_slave.result 2016-10-14 21:14:02.338075590 +0200 -+++ mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.reject 2016-10-14 21:17:51.296986686 +0200 +--- mysql-test/suite/rpl/r/rpl_delayed_slave.result ++++ mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.reject @@ -45,7 +45,6 @@ # wait for first query to execute # sleep 1*T diff --git a/mysql-test/suite/rpl/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result index 3712527a..1b132c20 100644 --- a/mysql-test/suite/rpl/r/rpl_drop_db.result +++ b/mysql-test/suite/rpl/r/rpl_drop_db.result @@ -6,8 +6,6 @@ create database mysqltest1; create table mysqltest1.t1 (n int); insert into mysqltest1.t1 values (1); select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt'; -Warnings: -Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead create table mysqltest1.t2 (n int); create table mysqltest1.t3 (n int); drop database mysqltest1; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result index ea784e7f..5a9eb5ee 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result @@ -260,8 +260,7 @@ connection slave; STOP SLAVE; include/reset_slave.inc CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5), -d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -ON UPDATE CURRENT_TIMESTAMP, +d TIMESTAMP NOT NULL DEFAULT 0, e INT NOT NULL, f text not null, g text, diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result new file mode 100644 index 00000000..adbee24d --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result @@ -0,0 +1,46 @@ +include/master-slave.inc +[connection master] +set binlog_row_image=minimal; +connection slave; +stop slave; +set global binlog_row_image=minimal; +include/reset_slave.inc +create table t1 ( +a int key, b blob, c char(5), +d char(10) as (concat(trim(c), '-U')) unique, +e char(10) as (concat('S', b)) stored) engine=innodb; +connection master; +create table t1 (a int primary key, b blob, c char(5)) engine=innodb; +reset master; +connection slave; +start slave; +connection master; +set timestamp=unix_timestamp('2010-10-10 10:10:10'); +insert t1 values (1,'.','Kyle'),(2,'?','JOE'),(3,'!','QA'), (4, '$', '4TH'); +update t1 set c='UPD' where a=3; +update t1 set b='#' where a=2; +delete from t1 where a=4; +select * from t1; +a b c +1 . Kyle +2 # JOE +3 ! UPD +connection slave; +select * from t1; +a b c d e +1 . Kyle Kyle-U S. +2 # JOE JOE-U S# +3 ! UPD UPD-U S! +select d from t1; +d +JOE-U +Kyle-U +UPD-U +select * from t1 where d='JOE-U'; +a b c d e +2 # JOE JOE-U S# +connection master; +drop table t1; +connection slave; +set global binlog_row_image=full; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result index 8ad7e987..d0fb5a30 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result @@ -260,8 +260,7 @@ connection slave; STOP SLAVE; include/reset_slave.inc CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5), -d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -ON UPDATE CURRENT_TIMESTAMP, +d TIMESTAMP NOT NULL DEFAULT 0, e INT NOT NULL, f text not null, g text, diff --git a/mysql-test/suite/rpl/r/rpl_geometry.result b/mysql-test/suite/rpl/r/rpl_geometry.result index 01dad7b0..b2c9503f 100644 --- a/mysql-test/suite/rpl/r/rpl_geometry.result +++ b/mysql-test/suite/rpl/r/rpl_geometry.result @@ -14,4 +14,14 @@ insert into t2(c) values (null); connection slave; connection master; drop table t1, t2; +# +# MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types +# +create table t(geo geometrycollection default st_geomfromtext('point(1 1)'), +vc point as (geo)); +insert into t () values (),(),(); +delete from t; +connection slave; +connection master; +drop table t; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result b/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result index f4d257c2..98daf309 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result @@ -28,7 +28,6 @@ include/show_events.inc Log_name Pos Event_type Server_id End_log_pos Info slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -slave-relay-bin.000002 # Gtid_list # # [] slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001 slave-relay-bin.000002 # Gtid # # GTID #-#-# slave-relay-bin.000002 # Gtid_list # # [#-#-#] diff --git a/mysql-test/suite/rpl/r/rpl_gtid_index.result b/mysql-test/suite/rpl/r/rpl_gtid_index.result new file mode 100644 index 00000000..a4cd2491 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_gtid_index.result @@ -0,0 +1,366 @@ +include/master-slave.inc +[connection master] +connection slave; +include/stop_slave.inc +CHANGE MASTER TO master_use_gtid= slave_pos; +include/start_slave.inc +connection master; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (0, 0); +*** Test looking up a lot of different event positions and GTIDs. +CREATE FUNCTION gtid_eq(a VARCHAR(255), b VARCHAR(255)) RETURNS BOOLEAN DETERMINISTIC +BEGIN +DECLARE g VARCHAR(255); +IF a IS NULL OR b IS NULL OR LENGTH(a) != LENGTH(b) THEN +RETURN FALSE; +END IF; +SET a= CONCAT(a, ','); +SET b= CONCAT(',', b, ','); +WHILE LENGTH(a) > 0 DO +SET g= REGEXP_SUBSTR(a, '^[^,]+,'); +SET a= SUBSTRING(a, LENGTH(g)+1); +SET b= REPLACE(b, CONCAT(',', g), ','); +END WHILE; +RETURN b = ','; +END // +SET @old_page_size= @@GLOBAL.binlog_gtid_index_page_size; +SET @old_span_min= @@GLOBAL.binlog_gtid_index_span_min; +*** A fair amount of work with default GTID index settings. +*** Testing 200 GTIDs with 50 test connects +connection master; +DELETE FROM t1 WHERE a >= 1000; +FLUSH NO_WRITE_TO_BINLOG BINARY LOGS; +CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT) +ENGINE=InnoDB; +INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1); +INSERT INTO rand_data(idx, domain_id, server_id) +SELECT seq, +@tmp:=floor(5*POW(rand(42),2)), +100 + 5*@tmp + floor(5*rand(42)) +FROM seq_1_to_200; +SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data; +COUNT(*) SUM(domain_id) SUM(server_id) +201 285 21852 +CREATE TABLE gtid_data( +idx INT PRIMARY KEY, +gtid VARCHAR(44), +gtid_pos VARCHAR(255), +file VARCHAR(100), +pos INT, +row_count INT, +KEY(file, pos)) ENGINE=InnoDB; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/stop_slave.inc +connection master; +SET @orig_domain_id= @@gtid_domain_id; +SET @orig_server_id= @@server_id; +SET gtid_domain_id= @orig_domain_id; +SET server_id= @orig_server_id; +SELECT COUNT(*) FROM gtid_data; +COUNT(*) +200 +*** The result should be empty, otherwise some result is wrong: +SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos) +FROM gtid_data +WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos)) +ORDER BY idx; +idx gtid_pos BINLOG_GTID_POS(file, pos) +connection slave; +SET @orig_pos= @@GLOBAL.gtid_slave_pos; +SET @orig_t1_limit= (SELECT MAX(a) FROM t1); +*** Now connect the slave to each position in turn, and test that +*** the right amount of data is replicated at each point. +*** Test slave connecting to some GTID positions where the position in +*** the master's binlog is different between the different domains. +*** Revind the slave and test on the same binlog data from the master as before. +connection slave; +SET sql_log_bin= 0; +TRUNCATE gtid_data; +DELETE FROM t1 WHERE a > @orig_t1_limit; +SET sql_log_bin= 1; +SET GLOBAL gtid_slave_pos= @orig_pos; +connection master; +connection slave; +connection master; +DROP TABLE gtid_data, rand_data; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +connection master; +*** A lot of GTIDs with small btree pages to stress the Btree code. +SET GLOBAL binlog_gtid_index_page_size= 64; +SET GLOBAL binlog_gtid_index_span_min= 1; +*** Testing 1000 GTIDs with 50 test connects +connection master; +DELETE FROM t1 WHERE a >= 1000; +FLUSH NO_WRITE_TO_BINLOG BINARY LOGS; +CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT) +ENGINE=InnoDB; +INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1); +INSERT INTO rand_data(idx, domain_id, server_id) +SELECT seq, +@tmp:=floor(10*POW(rand(150),2)), +100 + 5*@tmp + floor(5*rand(150)) +FROM seq_1_to_1000; +SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data; +COUNT(*) SUM(domain_id) SUM(server_id) +1001 2881 116394 +CREATE TABLE gtid_data( +idx INT PRIMARY KEY, +gtid VARCHAR(44), +gtid_pos VARCHAR(255), +file VARCHAR(100), +pos INT, +row_count INT, +KEY(file, pos)) ENGINE=InnoDB; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/stop_slave.inc +connection master; +SET @orig_domain_id= @@gtid_domain_id; +SET @orig_server_id= @@server_id; +SET gtid_domain_id= @orig_domain_id; +SET server_id= @orig_server_id; +SELECT COUNT(*) FROM gtid_data; +COUNT(*) +1000 +*** The result should be empty, otherwise some result is wrong: +SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos) +FROM gtid_data +WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos)) +ORDER BY idx; +idx gtid_pos BINLOG_GTID_POS(file, pos) +connection slave; +SET @orig_pos= @@GLOBAL.gtid_slave_pos; +SET @orig_t1_limit= (SELECT MAX(a) FROM t1); +*** Now connect the slave to each position in turn, and test that +*** the right amount of data is replicated at each point. +*** Test slave connecting to some GTID positions where the position in +*** the master's binlog is different between the different domains. +*** Revind the slave and test on the same binlog data from the master as before. +connection slave; +SET sql_log_bin= 0; +TRUNCATE gtid_data; +DELETE FROM t1 WHERE a > @orig_t1_limit; +SET sql_log_bin= 1; +SET GLOBAL gtid_slave_pos= @orig_pos; +connection master; +connection slave; +connection master; +DROP TABLE gtid_data, rand_data; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +connection master; +*** Small page size with sparse index. +SET GLOBAL binlog_gtid_index_page_size= 64; +SET GLOBAL binlog_gtid_index_span_min= 2048; +*** Testing 200 GTIDs with 50 test connects +connection master; +DELETE FROM t1 WHERE a >= 1000; +FLUSH NO_WRITE_TO_BINLOG BINARY LOGS; +CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT) +ENGINE=InnoDB; +INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1); +INSERT INTO rand_data(idx, domain_id, server_id) +SELECT seq, +@tmp:=floor(10*POW(rand(666),2)), +100 + 5*@tmp + floor(5*rand(666)) +FROM seq_1_to_200; +SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data; +COUNT(*) SUM(domain_id) SUM(server_id) +201 599 23410 +CREATE TABLE gtid_data( +idx INT PRIMARY KEY, +gtid VARCHAR(44), +gtid_pos VARCHAR(255), +file VARCHAR(100), +pos INT, +row_count INT, +KEY(file, pos)) ENGINE=InnoDB; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/stop_slave.inc +connection master; +SET @orig_domain_id= @@gtid_domain_id; +SET @orig_server_id= @@server_id; +SET gtid_domain_id= @orig_domain_id; +SET server_id= @orig_server_id; +SELECT COUNT(*) FROM gtid_data; +COUNT(*) +200 +*** The result should be empty, otherwise some result is wrong: +SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos) +FROM gtid_data +WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos)) +ORDER BY idx; +idx gtid_pos BINLOG_GTID_POS(file, pos) +connection slave; +SET @orig_pos= @@GLOBAL.gtid_slave_pos; +SET @orig_t1_limit= (SELECT MAX(a) FROM t1); +*** Now connect the slave to each position in turn, and test that +*** the right amount of data is replicated at each point. +*** Test slave connecting to some GTID positions where the position in +*** the master's binlog is different between the different domains. +*** Revind the slave and test on the same binlog data from the master as before. +connection slave; +SET sql_log_bin= 0; +TRUNCATE gtid_data; +DELETE FROM t1 WHERE a > @orig_t1_limit; +SET sql_log_bin= 1; +SET GLOBAL gtid_slave_pos= @orig_pos; +connection master; +connection slave; +connection master; +DROP TABLE gtid_data, rand_data; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +connection master; +*** Medium page size. +SET GLOBAL binlog_gtid_index_page_size= 512; +SET GLOBAL binlog_gtid_index_span_min= 512; +*** Testing 200 GTIDs with 50 test connects +connection master; +DELETE FROM t1 WHERE a >= 1000; +FLUSH NO_WRITE_TO_BINLOG BINARY LOGS; +CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT) +ENGINE=InnoDB; +INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1); +INSERT INTO rand_data(idx, domain_id, server_id) +SELECT seq, +@tmp:=floor(10*POW(rand(1024),2)), +100 + 5*@tmp + floor(5*rand(1024)) +FROM seq_1_to_200; +SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data; +COUNT(*) SUM(domain_id) SUM(server_id) +201 555 23160 +CREATE TABLE gtid_data( +idx INT PRIMARY KEY, +gtid VARCHAR(44), +gtid_pos VARCHAR(255), +file VARCHAR(100), +pos INT, +row_count INT, +KEY(file, pos)) ENGINE=InnoDB; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/stop_slave.inc +connection master; +SET @orig_domain_id= @@gtid_domain_id; +SET @orig_server_id= @@server_id; +SET gtid_domain_id= @orig_domain_id; +SET server_id= @orig_server_id; +SELECT COUNT(*) FROM gtid_data; +COUNT(*) +200 +*** The result should be empty, otherwise some result is wrong: +SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos) +FROM gtid_data +WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos)) +ORDER BY idx; +idx gtid_pos BINLOG_GTID_POS(file, pos) +connection slave; +SET @orig_pos= @@GLOBAL.gtid_slave_pos; +SET @orig_t1_limit= (SELECT MAX(a) FROM t1); +*** Now connect the slave to each position in turn, and test that +*** the right amount of data is replicated at each point. +*** Test slave connecting to some GTID positions where the position in +*** the master's binlog is different between the different domains. +*** Revind the slave and test on the same binlog data from the master as before. +connection slave; +SET sql_log_bin= 0; +TRUNCATE gtid_data; +DELETE FROM t1 WHERE a > @orig_t1_limit; +SET sql_log_bin= 1; +SET GLOBAL gtid_slave_pos= @orig_pos; +connection master; +connection slave; +connection master; +DROP TABLE gtid_data, rand_data; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +connection master; +*** Large page size. +SET GLOBAL binlog_gtid_index_page_size= 16384; +SET GLOBAL binlog_gtid_index_span_min= 1; +*** Testing 200 GTIDs with 50 test connects +connection master; +DELETE FROM t1 WHERE a >= 1000; +FLUSH NO_WRITE_TO_BINLOG BINARY LOGS; +CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT) +ENGINE=InnoDB; +INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1); +INSERT INTO rand_data(idx, domain_id, server_id) +SELECT seq, +@tmp:=floor(10*POW(rand(12345),2)), +100 + 5*@tmp + floor(5*rand(12345)) +FROM seq_1_to_200; +SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data; +COUNT(*) SUM(domain_id) SUM(server_id) +201 571 23252 +CREATE TABLE gtid_data( +idx INT PRIMARY KEY, +gtid VARCHAR(44), +gtid_pos VARCHAR(255), +file VARCHAR(100), +pos INT, +row_count INT, +KEY(file, pos)) ENGINE=InnoDB; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/stop_slave.inc +connection master; +SET @orig_domain_id= @@gtid_domain_id; +SET @orig_server_id= @@server_id; +SET gtid_domain_id= @orig_domain_id; +SET server_id= @orig_server_id; +SELECT COUNT(*) FROM gtid_data; +COUNT(*) +200 +*** The result should be empty, otherwise some result is wrong: +SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos) +FROM gtid_data +WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos)) +ORDER BY idx; +idx gtid_pos BINLOG_GTID_POS(file, pos) +connection slave; +SET @orig_pos= @@GLOBAL.gtid_slave_pos; +SET @orig_t1_limit= (SELECT MAX(a) FROM t1); +*** Now connect the slave to each position in turn, and test that +*** the right amount of data is replicated at each point. +*** Test slave connecting to some GTID positions where the position in +*** the master's binlog is different between the different domains. +*** Revind the slave and test on the same binlog data from the master as before. +connection slave; +SET sql_log_bin= 0; +TRUNCATE gtid_data; +DELETE FROM t1 WHERE a > @orig_t1_limit; +SET sql_log_bin= 1; +SET GLOBAL gtid_slave_pos= @orig_pos; +connection master; +connection slave; +connection master; +DROP TABLE gtid_data, rand_data; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +connection master; +connection master; +SET GLOBAL binlog_gtid_index_page_size= @old_page_size; +SET GLOBAL binlog_gtid_index_span_min= @old_span_min; +DROP TABLE t1; +DROP FUNCTION gtid_eq; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result b/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result index 92430be1..af562e93 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result @@ -335,7 +335,8 @@ a b *** Now let the old master join up as slave. *** connection server_1; CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2, -master_user = "root", master_use_gtid = slave_pos, master_demote_to_slave=1; +master_user = "root", master_ssl_verify_server_cert=0, +master_use_gtid = slave_pos, master_demote_to_slave=1; include/start_slave.inc SELECT * FROM t1 ORDER BY a; a diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result index 9524dafb..c2a1cd28 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result @@ -12,7 +12,8 @@ include/wait_for_slave_to_stop.inc reset slave all; connection server_1; CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2, -master_user='root', MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1; +master_user='root', master_ssl_verify_server_cert=0, +MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1; include/start_slave.inc include/wait_for_slave_to_start.inc connection server_2; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result index 58953491..fee14722 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result @@ -6,7 +6,7 @@ connection server_2; create table t2 (i int); connection server_3; set default_master_connection = 'm2'; -change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos; +change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos; include/start_slave.inc connection server_2; insert into t2 values (1); diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result index 665fc536..5fba9966 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result @@ -44,7 +44,7 @@ RESET MASTER; SET GLOBAL gtid_slave_pos= '0-2-10'; connection server_1; CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2, -master_user= 'root', master_use_gtid=CURRENT_POS; +master_user= 'root', master_ssl_verify_server_cert=0, master_use_gtid=CURRENT_POS; START SLAVE; connection server_2; INSERT INTO t1 VALUES (11); diff --git a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result index 8b896560..6a31eedc 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result @@ -20,8 +20,8 @@ a b 2 1 include/stop_slave.inc connection server_1; -CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT, -master_user = 'root'; +CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT, master_ssl_verify_server_cert=0, +master_user = 'root', master_ssl_verify_server_cert=0; START SLAVE; include/wait_for_slave_to_start.inc connection server_2; @@ -50,7 +50,7 @@ INSERT INTO t1 VALUES (5, 1); INSERT INTO t1 VALUES (6, 1); include/save_master_gtid.inc connection server_2; -CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT; +CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, master_ssl_verify_server_cert=0; START SLAVE; include/sync_with_master_gtid.inc SELECT * FROM t1 ORDER BY a; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_until_before_after_gtids.result b/mysql-test/suite/rpl/r/rpl_gtid_until_before_after_gtids.result new file mode 100644 index 00000000..dd9035d3 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_gtid_until_before_after_gtids.result @@ -0,0 +1,239 @@ +include/master-slave.inc +[connection master] +include/rpl_gtid_until_before_after_gtids.inc +# +# Test Setup (SQL_BEFORE_GTIDS) +# Clean primary and replica states +connection master; +connection slave; +connection master; +RESET MASTER; +set session gtid_domain_id=0; +# Initialize test data +connection master; +create table t1 (a int); +create table t2 (a int); +connection slave; +# +# Test Case 1 (SQL_BEFORE_GTIDS): For a single-dimensional binlog state and a +# STOP SLAVE UNTIL gtid position with one GTID, the replica should +# execute events up until the GTID is encountered, and immediately stop +connection slave; +connection master; +set session gtid_domain_id=0; +INSERT INTO t1 VALUES (100); +INSERT INTO t1 VALUES (101); +INSERT INTO t1 VALUES (102); +connection slave; +START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1-4"; +# Ensure the slave started +# Clean replica state +connection master; +connection slave; +# +# Test Case 2 (SQL_BEFORE_GTIDS): If a provided until GTID doesn't exist in the +# binary log due to a gap, once an event is seen that is beyond the +# until GTID, the slave should immediately stop. Note the behavior of +# this test case should be the same between SQL_BEFORE_GTIDS and +# SQL_AFTER_GTIDS. +connection slave; +connection master; +set session gtid_domain_id=0; +INSERT INTO t1 VALUES (103); +INSERT INTO t1 VALUES (104); +# Skip a seq_no +set @@session.gtid_seq_no= 9; +INSERT INTO t1 VALUES (105); +connection slave; +START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1-8"; +# Ensure the slave started +connection slave; +connection master; +connection slave; +# +# Test Case 3 (SQL_BEFORE_GTIDS): For a multi-dimensional binlog state and a +# STOP SLAVE UNTIL gtid position with one GTID, the replica should +# execute events from only the specified domain until the provided GTID +# is encountered, and immediately stop +connection slave; +connection master; +set session gtid_domain_id=0; +INSERT INTO t1 VALUES (106); +set session gtid_domain_id=1; +INSERT INTO t2 VALUES (200); +INSERT INTO t2 VALUES (201); +set session gtid_domain_id=0; +INSERT INTO t1 VALUES (107); +set session gtid_domain_id=1; +INSERT INTO t2 VALUES (202); +set session gtid_domain_id=0; +connection slave; +START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1-11"; +# Ensure the slave started +connection slave; +connection master; +connection slave; +# +# Test Case 4 (SQL_BEFORE_GTIDS): For a multi-dimensional binlog state and a +# STOP SLAVE UNTIL gtid position with multiple GTIDs, the replica should +# for each domain, execute events only up until its provided GTID, and +# once all domains have hit their end point, immediately stop. +connection slave; +connection master; +SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (108); +# Tagging domain 0 stop: 0-1-12 +SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (109); +SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (203); +SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (204); +SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (110); +SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (205); +connection slave; +START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1-13,1-1-5"; +# Ensure the slave started +connection slave; +connection master; +connection slave; +# +# Error Case 1: Not providing a valid GTID should result in a syntax +# error +connection slave; +START SLAVE UNTIL SQL_BEFORE_GTIDS="a"; +ERROR HY000: Could not parse GTID list +START SLAVE UNTIL SQL_BEFORE_GTIDS="0"; +ERROR HY000: Could not parse GTID list +START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1"; +ERROR HY000: Could not parse GTID list +START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1-"; +ERROR HY000: Could not parse GTID list +START SLAVE UNTIL SQL_BEFORE_GTIDS="a-b-c"; +ERROR HY000: Could not parse GTID list +# +# Cleanup test data +connection master; +DROP TABLE t1, t2; +connection slave; +include/rpl_gtid_until_before_after_gtids.inc +# +# Test Setup (SQL_AFTER_GTIDS) +# Clean primary and replica states +connection master; +connection slave; +connection master; +RESET MASTER; +set session gtid_domain_id=0; +# Initialize test data +connection master; +create table t1 (a int); +create table t2 (a int); +connection slave; +# +# Test Case 1 (SQL_AFTER_GTIDS): For a single-dimensional binlog state and a +# STOP SLAVE UNTIL gtid position with one GTID, the replica should +# execute events up until the GTID is encountered, finish replicating +# that event group, and then stop +connection slave; +connection master; +set session gtid_domain_id=0; +INSERT INTO t1 VALUES (111); +INSERT INTO t1 VALUES (112); +INSERT INTO t1 VALUES (113); +connection slave; +START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-4"; +# Ensure the slave started +# Clean replica state +connection master; +connection slave; +# +# Test Case 2 (SQL_AFTER_GTIDS): If a provided until GTID doesn't exist in the +# binary log due to a gap, once an event is seen that is beyond the +# until GTID, the slave should immediately stop. Note the behavior of +# this test case should be the same between SQL_BEFORE_GTIDS and +# SQL_AFTER_GTIDS. +connection slave; +connection master; +set session gtid_domain_id=0; +INSERT INTO t1 VALUES (114); +INSERT INTO t1 VALUES (115); +# Skip a seq_no +set @@session.gtid_seq_no= 9; +INSERT INTO t1 VALUES (116); +connection slave; +START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-8"; +# Ensure the slave started +connection slave; +connection master; +connection slave; +# +# Test Case 3 (SQL_AFTER_GTIDS): For a multi-dimensional binlog state and a +# STOP SLAVE UNTIL gtid position with one GTID, the replica should +# execute events from only the specified domain until the provided GTID +# is encountered, finish replicating that event group, and then stop +connection slave; +connection master; +set session gtid_domain_id=0; +INSERT INTO t1 VALUES (117); +set session gtid_domain_id=1; +INSERT INTO t2 VALUES (206); +INSERT INTO t2 VALUES (207); +set session gtid_domain_id=0; +INSERT INTO t1 VALUES (118); +set session gtid_domain_id=1; +INSERT INTO t2 VALUES (208); +set session gtid_domain_id=0; +connection slave; +START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-11"; +# Ensure the slave started +connection slave; +connection master; +connection slave; +# +# Test Case 4 (SQL_AFTER_GTIDS): For a multi-dimensional binlog state and a +# STOP SLAVE UNTIL gtid position with multiple GTIDs, the replica should +# stop executing events as soon as all listed GTIDs in the UNTIL list +# have been executed. +connection slave; +connection master; +SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (119); +SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (120); +SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (209); +SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (210); +SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (121); +SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (211); +connection slave; +START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-13,1-1-5"; +# Ensure the slave started +connection slave; +connection master; +connection slave; +# +# Error Case 1: Not providing a valid GTID should result in a syntax +# error +connection slave; +START SLAVE UNTIL SQL_AFTER_GTIDS="a"; +ERROR HY000: Could not parse GTID list +START SLAVE UNTIL SQL_AFTER_GTIDS="0"; +ERROR HY000: Could not parse GTID list +START SLAVE UNTIL SQL_AFTER_GTIDS="0-1"; +ERROR HY000: Could not parse GTID list +START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-"; +ERROR HY000: Could not parse GTID list +START SLAVE UNTIL SQL_AFTER_GTIDS="a-b-c"; +ERROR HY000: Could not parse GTID list +# +# Cleanup test data +connection master; +DROP TABLE t1, t2; +connection slave; +# +# Error Case 2: Providing both SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS +# should result in a syntax error +connection slave; +START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-1" SQL_BEFORE_GTIDS="0-1-1"; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SQL_BEFORE_GTIDS="0-1-1"' at line 1 +# +# Cleanup +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/rpl_end.inc +# End of rpl_gtid_until_before_gtids.test diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result index c9baf960..42cf90bc 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result @@ -52,7 +52,7 @@ connection master; drop table if exists t1; connection slave; set @@global.slave_net_timeout= 10; -change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.5; +change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_ssl_verify_server_cert=0, master_heartbeat_period= 0.5; show status like 'Slave_heartbeat_period';; Variable_name Slave_heartbeat_period Value 0.500 diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result index 533290d2..7f11b856 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result @@ -24,7 +24,7 @@ Heartbeat event has received *** Clean up *** include/stop_slave.inc CHANGE MASTER TO -MASTER_SSL=0, +MASTER_SSL=1, MASTER_SSL_CA='', MASTER_SSL_CERT='', MASTER_SSL_KEY=''; diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result index 28573576..6b06fff1 100644 --- a/mysql-test/suite/rpl/r/rpl_hrtime.result +++ b/mysql-test/suite/rpl/r/rpl_hrtime.result @@ -52,7 +52,7 @@ SET TIMESTAMP=1293832861.123456/*!*/; SET @@session.time_zone='+03:00'/*!*/; insert t1 (b,c) values (now(6), now(6)) /*!*/; -SET TIMESTAMP=1293832861.123456/*!*/; +SET TIMESTAMP=1293832861/*!*/; COMMIT /*!*/; START TRANSACTION @@ -68,7 +68,7 @@ START TRANSACTION SET TIMESTAMP=1643756522.654321/*!*/; insert t1 (b,c) values (now(), now()) /*!*/; -SET TIMESTAMP=1643756522.654321/*!*/; +SET TIMESTAMP=1643756522/*!*/; COMMIT /*!*/; START TRANSACTION @@ -76,7 +76,7 @@ START TRANSACTION SET TIMESTAMP=1643756522.654321/*!*/; insert t1 (b,c) values (0,0) /*!*/; -SET TIMESTAMP=1643756522.654321/*!*/; +SET TIMESTAMP=1643756522/*!*/; COMMIT /*!*/; START TRANSACTION @@ -84,7 +84,7 @@ START TRANSACTION SET TIMESTAMP=1643756522.654321/*!*/; insert t1 (a,b,c) values (0,0,now(6)) /*!*/; -SET TIMESTAMP=1643756522.654321/*!*/; +SET TIMESTAMP=1643756522/*!*/; COMMIT /*!*/; SET TIMESTAMP=1643756522/*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result index 2ecc3ac1..063e568f 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result @@ -51,10 +51,6 @@ DELETE FROM test.regular_tbl WHERE id = del_count; SET del_count = del_count - 2; END WHILE; END| -Warnings: -Level Warning -Code 1287 -Message '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead CREATE PROCEDURE test.proc_bykey() BEGIN DECLARE ins_count INT DEFAULT 1000; @@ -76,10 +72,6 @@ DELETE FROM test.bykey_tbl WHERE id = del_count; SET del_count = del_count - 2; END WHILE; END| -Warnings: -Level Warning -Code 1287 -Message '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead CREATE PROCEDURE test.proc_byrange() BEGIN DECLARE ins_count INT DEFAULT 1000; @@ -101,10 +93,6 @@ DELETE FROM test.byrange_tbl WHERE id = del_count; SET del_count = del_count - 2; END WHILE; END| -Warnings: -Level Warning -Code 1287 -Message '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead begin; CALL test.proc_norm(); commit; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result index da6888e7..d4640a36 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result @@ -26,10 +26,6 @@ DELETE FROM test.regular_tbl WHERE id = del_count; SET del_count = del_count - 2; END WHILE; END| -Warnings: -Level Warning -Code 1287 -Message '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead CALL test.proc_norm(); connection slave; connection master; diff --git a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff index 1946228f..d1a101e5 100644 --- a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff +++ b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff @@ -1,5 +1,5 @@ ---- suite/rpl/r/rpl_insert_delayed.result 2016-03-25 19:44:43.408210896 +0400 -+++ suite/rpl/r/rpl_insert_delayed,stmt.reject 2016-03-25 23:55:18.396360848 +0400 +--- suite/rpl/r/rpl_insert_delayed.result ++++ suite/rpl/r/rpl_insert_delayed,stmt.reject @@ -18,19 +18,19 @@ insert delayed into t1 values(10, "my name"); flush table t1; diff --git a/mysql-test/suite/rpl/r/rpl_invoked_features.result b/mysql-test/suite/rpl/r/rpl_invoked_features.result index 3cfd40d5..c8acf49c 100644 --- a/mysql-test/suite/rpl/r/rpl_invoked_features.result +++ b/mysql-test/suite/rpl/r/rpl_invoked_features.result @@ -1,15 +1,8 @@ include/master-slave.inc [connection master] -USE test; -DROP VIEW IF EXISTS v1,v11; -DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p11; -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP EVENT IF EXISTS e1; -DROP EVENT IF EXISTS e11; - +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Event Scheduler: .* Duplicate entry '10' for key 'a'"); +# Create tables CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=myisam; INSERT INTO t1 VALUES (1,1,'1'); INSERT INTO t1 VALUES (2,2,UUID()); @@ -22,7 +15,7 @@ INSERT INTO t11 VALUES (2,2,UUID()); CREATE TABLE t12 (a INT UNIQUE, b INT, c VARCHAR(64)) ENGINE=innodb; INSERT INTO t12 VALUES (1,1,'1'); INSERT INTO t12 VALUES (2,2,UUID()); - +# Create invoked features CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v11 AS SELECT * FROM t11; CREATE TRIGGER t1_tr1 BEFORE INSERT ON t1 FOR EACH ROW @@ -45,7 +38,7 @@ BEGIN UPDATE t12 SET c = ''; UPDATE t13 SET c = ''; END| -CREATE EVENT e1 ON SCHEDULE EVERY 10 SECOND DISABLE DO +CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DISABLE DO BEGIN ALTER EVENT e1 DISABLE; CALL p1(10, ''); @@ -78,7 +71,7 @@ CREATE PROCEDURE p11 (IN x INT, IN y VARCHAR(64)) BEGIN INSERT IGNORE INTO t11 VALUES (x,x,y); END| - +# Do some actions for non-transactional tables CREATE TABLE t3 SELECT * FROM v1; INSERT INTO t1 VALUES (3,3,''); UPDATE t1 SET c='2' WHERE a = 1; @@ -90,7 +83,7 @@ INSERT INTO t1 VALUES(6,6,f1(6)); INSERT INTO t1 VALUES (102,102,''); INSERT INTO t1 VALUES(7,7,f2(7)); INSERT INTO t1 VALUES (103,103,''); - +# Do some actions for transactional tables CREATE TABLE t13 SELECT * FROM v11; INSERT INTO t11 VALUES (3,3,''); UPDATE t11 SET c='2' WHERE a = 1; @@ -102,12 +95,12 @@ INSERT INTO t11 VALUES(6,6,f1(6)); INSERT INTO t11 VALUES (102,102,''); INSERT INTO t11 VALUES(7,7,f2(7)); INSERT INTO t11 VALUES (103,103,''); - +# Scheduler is on SET GLOBAL EVENT_SCHEDULER = on; ALTER EVENT e1 ENABLE; ALTER EVENT e11 ENABLE; SET GLOBAL EVENT_SCHEDULER = off; - +# Check original objects SHOW TABLES LIKE 't%'; Tables_in_test (t%) t1 @@ -268,7 +261,7 @@ a b 102 102 103 103 connection slave; - +# Check replicated objects SHOW TABLES LIKE 't%'; Tables_in_test (t%) t1 @@ -297,7 +290,7 @@ SELECT event_name, status FROM information_schema.events WHERE event_schema='tes event_name status e1 SLAVESIDE_DISABLED e11 SLAVESIDE_DISABLED - +# Check replicated data SELECT COUNT(*) FROM t1; COUNT(*) 12 @@ -429,7 +422,7 @@ a b 102 102 103 103 connection master; - +# Remove UUID() before comparing and sort tables UPDATE t1 SET c=''; UPDATE t2 SET c=''; UPDATE t3 SET c=''; @@ -439,10 +432,8 @@ UPDATE t13 SET c=''; ALTER TABLE t3 ORDER BY a; ALTER TABLE t13 ORDER BY a; connection slave; - - +# Compare a data from master and slave connection master; - DROP VIEW IF EXISTS v1,v11; DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13; DROP PROCEDURE IF EXISTS p1; diff --git a/mysql-test/suite/rpl/r/rpl_iodku,stmt.rdiff b/mysql-test/suite/rpl/r/rpl_iodku,stmt.rdiff index e31f1e5d..2986a47c 100644 --- a/mysql-test/suite/rpl/r/rpl_iodku,stmt.rdiff +++ b/mysql-test/suite/rpl/r/rpl_iodku,stmt.rdiff @@ -1,5 +1,5 @@ ---- r/rpl_iodku.result 2022-05-04 18:51:24.956414404 +0300 -+++ r/rpl_iodku,stmt.reject 2022-05-04 18:51:49.520106231 +0300 +--- r/rpl_iodku.result ++++ r/rpl_iodku,stmt.reject @@ -1,10 +1,15 @@ include/master-slave.inc [connection master] diff --git a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result index b1b16fb0..5ad4b3ea 100644 --- a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result +++ b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result @@ -105,4 +105,4 @@ change master to master_host='127.0.0.1'; Master-Host: 127.0.0.1 change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1'; Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1 -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0; diff --git a/mysql-test/suite/rpl/r/rpl_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv6.result index f1c5619b..fc9171d8 100644 --- a/mysql-test/suite/rpl/r/rpl_ipv6.result +++ b/mysql-test/suite/rpl/r/rpl_ipv6.result @@ -60,4 +60,4 @@ change master to master_host='127.0.0.1'; Master-Host: 127.0.0.1 change master to master_host='0:0:0:0:0:0:0:1'; Master-Host: 0:0:0:0:0:0:0:1 -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0; diff --git a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result index aae3418b..4d19d81d 100644 --- a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result +++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result @@ -27,7 +27,7 @@ NULL connection slave; include/stop_slave.inc reset slave all; -change master 'my_slave' to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root'; +change master 'my_slave' to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0; set default_master_connection = 'my_slave'; include/start_slave.inc # Call without connection name -- works (expected -1) diff --git a/mysql-test/suite/rpl/r/rpl_mdev12179.result b/mysql-test/suite/rpl/r/rpl_mdev12179.result index dcda036c..7cb750dd 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev12179.result +++ b/mysql-test/suite/rpl/r/rpl_mdev12179.result @@ -259,8 +259,6 @@ connection server_2; *** Restart the slave server to prove 'gtid_slave_pos_innodb' autodiscovery *** connection server_2; SELECT max(seq_no) FROM mysql.gtid_slave_pos_InnoDB into @seq_no; -Warnings: -Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead connection server_1; INSERT INTO t2(a) SELECT 1+MAX(a) FROM t2; include/save_master_gtid.inc diff --git a/mysql-test/suite/rpl/r/rpl_mdev33798.result b/mysql-test/suite/rpl/r/rpl_mdev33798.result index 8796e948..12431ed2 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev33798.result +++ b/mysql-test/suite/rpl/r/rpl_mdev33798.result @@ -68,7 +68,7 @@ include/sync_with_master_gtid.inc include/stop_slave.inc connection server_2; include/stop_slave.inc -CHANGE MASTER 'm2' to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos; +CHANGE MASTER 'm2' to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos, master_ssl_verify_server_cert=0; connection server_1; SET SESSION gtid_domain_id= 1; BEGIN; diff --git a/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result index 302cf235..6c20623d 100644 --- a/mysql-test/suite/rpl/r/rpl_misc_functions.result +++ b/mysql-test/suite/rpl/r/rpl_misc_functions.result @@ -42,8 +42,6 @@ INSERT INTO t1 (col_a) VALUES (test_replication_sf()); INSERT INTO t1 (col_a) VALUES (test_replication_sf()); connection slave; select * from t1 into outfile "../../tmp/t1_slave.txt"; -Warnings: -Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead connection master; create temporary table t1_slave select * from t1 where 1=0; load data infile '../../tmp/t1_slave.txt' into table t1_slave; diff --git a/mysql-test/suite/rpl/r/rpl_old_master_29078.result b/mysql-test/suite/rpl/r/rpl_old_master_29078.result index 98bd707a..911705d1 100644 --- a/mysql-test/suite/rpl/r/rpl_old_master_29078.result +++ b/mysql-test/suite/rpl/r/rpl_old_master_29078.result @@ -48,6 +48,8 @@ ROLLBACK /* added by mysqlbinlog */; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; connection slave; set global explicit_defaults_for_timestamp=0; +Warnings: +Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release include/reset_slave.inc include/start_slave.inc show create table t1; diff --git a/mysql-test/suite/rpl/r/rpl_parallel_29322.result b/mysql-test/suite/rpl/r/rpl_parallel_29322.result index 4045e579..78180410 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_29322.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_29322.result @@ -10,6 +10,8 @@ set @@session.explicit_defaults_for_timestamp = 1; connection slave; set @sav.explicit_defaults_for_timestamp = @@global.explicit_defaults_for_timestamp; set global explicit_defaults_for_timestamp = 0; +Warnings: +Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release set @sav.slave_parallel_workers = @@global.slave_parallel_workers; include/stop_slave.inc set @@global.slave_parallel_workers = 1; @@ -105,6 +107,8 @@ connection slave; # B. alternate the master and slave vars' values to (0,1) connection master; set @@session.explicit_defaults_for_timestamp = 0; +Warnings: +Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release connection slave; set @@global.explicit_defaults_for_timestamp = 1; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result index 0b317c46..45f708fb 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result @@ -270,7 +270,7 @@ connection server_2; include/stop_slave.inc SET @old_format= @@GLOBAL.binlog_format; SET GLOBAL binlog_format= MIXED; -SET @old_isolation= @@GLOBAL.tx_isolation; +SET @old_isolation= @@GLOBAL.transaction_isolation; SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED; SET GLOBAL slave_parallel_threads=0; SET GLOBAL slave_parallel_threads=10; @@ -346,7 +346,7 @@ a b 10 10 include/stop_slave.inc SET GLOBAL binlog_format= @old_format; -SET GLOBAL tx_isolation= @old_isolation; +SET GLOBAL transaction_isolation= @old_isolation; include/start_slave.inc *** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang *** connection server_1; diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result index 4172abb1..28c5ceb1 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result @@ -6,7 +6,7 @@ CREATE TABLE t2 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1,0), (2,0), (3,0); INSERT INTO t2 VALUES (1,0), (2,0); connection server_2; -SET @old_isolation= @@GLOBAL.tx_isolation; +SET @old_isolation= @@GLOBAL.transaction_isolation; SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; include/stop_slave.inc SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED; @@ -82,7 +82,7 @@ a b 10 10 connection server_2; include/stop_slave.inc -SET GLOBAL tx_isolation= @old_isolation; +SET GLOBAL transaction_isolation= @old_isolation; SET GLOBAL slave_parallel_mode=@old_parallel_mode; SET GLOBAL slave_parallel_threads=@old_parallel_threads; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result index 268ab010..8180d0c0 100644 --- a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result +++ b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result @@ -10,7 +10,7 @@ include/stop_slave.inc set @save_slave_parallel_workers= @@global.slave_parallel_workers; set @save_slave_transaction_retries= @@global.slave_transaction_retries; RESET SLAVE ALL; -CHANGE MASTER 'slave1' TO MASTER_USER='root',MASTER_PORT=$MASTER_MYPORT, MASTER_HOST='127.0.0.1', MASTER_USE_GTID=slave_pos; +CHANGE MASTER 'slave1' TO MASTER_USER='root',MASTER_PORT=$MASTER_MYPORT, MASTER_HOST='127.0.0.1', MASTER_USE_GTID=slave_pos, MASTER_SSL_VERIFY_SERVER_CERT=0; SET default_master_connection='slave1'; SET @@global.slave_parallel_workers=1; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; diff --git a/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result b/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result index 4ace84ff..695ba3a9 100644 --- a/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result +++ b/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result @@ -67,7 +67,7 @@ master_ssl_ca= '', master_ssl_cert= '', master_ssl_key= '', master_ssl_verify_server_cert=0, -master_ssl=0, +master_ssl=1, master_use_gtid=no; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result b/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result index 1734b200..e0e6681c 100644 --- a/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result +++ b/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result @@ -130,7 +130,7 @@ connection slave; include/stop_slave.inc include/reset_slave.inc include/rpl_restart_server.inc [server_number=2] -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root'; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0; connection slave; include/start_slave.inc SELECT @@GLOBAL.replicate_rewrite_db; diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index d720b0b8..4b7c1642 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -10,7 +10,7 @@ ERROR HY000: Could not initialize master info structure for ''; more error messa change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log reset slave; -change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; +change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_ssl_verify_server_cert=0; connection master; reset master; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff b/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff index 3815ec93..1154f92c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff +++ b/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff @@ -1,5 +1,5 @@ ---- /home/my/maria-test/mysql-test/suite/rpl/r/rpl_row_big_table_id.result 2019-08-18 15:19:56.829962449 +0300 -+++ /home/my/maria-test/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.reject 2019-08-18 15:20:19.253763968 +0300 +--- /home/my/maria-test/mysql-test/suite/rpl/r/rpl_row_big_table_id.result ++++ /home/my/maria-test/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.reject @@ -20,22 +20,22 @@ master-bin.000001 # Query 1 # use `test`; ALTER TABLE t comment '' master-bin.000001 # Gtid 1 # BEGIN GTID #-#-# diff --git a/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result index 08408907..9959854a 100644 --- a/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result @@ -160,4 +160,19 @@ connection master; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; connection slave; +# +# MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types +# +connection master; +CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt)); +INSERT INTO t () VALUES (),(),(); +DELETE FROM t; +DROP TABLE t; +connection slave; +connection master; +CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt) STORED); +INSERT INTO t () VALUES (),(),(); +DELETE FROM t; +DROP TABLE t; +connection slave; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result index 08408907..9959854a 100644 --- a/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result @@ -160,4 +160,19 @@ connection master; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; connection slave; +# +# MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types +# +connection master; +CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt)); +INSERT INTO t () VALUES (),(),(); +DELETE FROM t; +DROP TABLE t; +connection slave; +connection master; +CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt) STORED); +INSERT INTO t () VALUES (),(),(); +DELETE FROM t; +DROP TABLE t; +connection slave; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result index e63212db..197b4be2 100644 --- a/mysql-test/suite/rpl/r/rpl_row_create_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result @@ -243,6 +243,11 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back SHOW TABLES; Tables_in_test +tt7 +tt6 +tt5 +tt4 +tt3 t1 t2 t3 diff --git a/mysql-test/suite/rpl/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result index 8753764e..8546960b 100644 --- a/mysql-test/suite/rpl/r/rpl_row_drop.result +++ b/mysql-test/suite/rpl/r/rpl_row_drop.result @@ -6,6 +6,7 @@ CREATE TABLE t2 (a int); CREATE TEMPORARY TABLE t2 (a int, b int); SHOW TABLES; Tables_in_test +t2 t1 t2 connection slave; @@ -28,6 +29,7 @@ connection master; CREATE TEMPORARY TABLE t2 (a int, b int); SHOW TABLES; Tables_in_test +t2 t1 t2 connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result b/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result index dc6a67b4..f34c41f9 100644 --- a/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result +++ b/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result @@ -3,7 +3,7 @@ include/master-slave.inc connection slave; call mtr.add_suppression("Slave IO thread did not receive an expected Rows-log end-of-statement"); call mtr.add_suppression("Relay log write failure: could not queue event from master"); -SET @save_debug= @@global.debug; +SET @save_debug= @@global.debug_dbug; SET GLOBAL debug_dbug="+d,simulate_stmt_end_rows_event_loss"; include/stop_slave.inc CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, MASTER_USE_GTID=SLAVE_POS; diff --git a/mysql-test/suite/rpl/r/rpl_row_img_blobs.result b/mysql-test/suite/rpl/r/rpl_row_img_blobs.result index 546f42b6..0131f65d 100644 --- a/mysql-test/suite/rpl/r/rpl_row_img_blobs.result +++ b/mysql-test/suite/rpl/r/rpl_row_img_blobs.result @@ -4637,6 +4637,2323 @@ include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] connection server_1; DROP TABLE t; include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL_NODUP', RESTART SLAVE: 'N' +connection server_1; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +CON: 'server_2', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y' +connection server_2; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +CON: 'server_3', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y' +connection server_3; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +connection server_1; +### engines: MyISAM, MyISAM, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, MyISAM, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check when there is no key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the AI (they are not updated) +### will not break replication (check even if there is a key in the table) +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +connection server_1; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' connection server_1; SET SESSION binlog_row_image= 'FULL'; diff --git a/mysql-test/suite/rpl/r/rpl_row_img_eng_full_nodup.result b/mysql-test/suite/rpl/r/rpl_row_img_eng_full_nodup.result new file mode 100644 index 00000000..17973c3a --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_img_eng_full_nodup.result @@ -0,0 +1,4799 @@ +include/rpl_init.inc [topology=1->2->3] +connection server_1; +connection server_2; +connection server_3; +connection server_1; +CON: 'server_1', IMG: 'FULL_NODUP', RESTART SLAVE: 'N' +connection server_1; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +CON: 'server_2', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y' +connection server_2; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +CON: 'server_3', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y' +connection server_3; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +connection server_1; +### engines: MyISAM, MyISAM, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, MyISAM, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +CREATE TABLE t1(c1 INT NOT NULL PRIMARY KEY, c2 varchar(10) DEFAULT NULL, +c3 decimal(12,4) DEFAULT NULL); +INSERT INTO t1(c1) VALUES (1); +include/save_master_pos.inc +UPDATE t1 SET c2 = 'c2'; +include/rpl_sync.inc +FLUSH BINARY LOGS; +UPDATE t1 SET c2 = "c2_new"; +# Use 'BINLOG' statement to apply the first update row event +# BINLOG statement is same to slave applier, it should work well. +# After 'BINLOG' statement c2's value should be "c2" +SELECT * FROM t1; +c1 c2 c3 +1 c2 NULL +DROP TABLE t1; +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +connection server_1; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +connection server_2; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +connection server_3; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +connection server_1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_img_full_nodup.result b/mysql-test/suite/rpl/r/rpl_row_img_full_nodup.result new file mode 100644 index 00000000..39c9ee03 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_img_full_nodup.result @@ -0,0 +1,4784 @@ +include/rpl_init.inc [topology=1->2->3] +connection server_1; +connection server_2; +connection server_3; +connection server_1; +CON: 'server_1', IMG: 'FULL_NODUP', RESTART SLAVE: 'N' +connection server_1; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +CON: 'server_2', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y' +connection server_2; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +CON: 'server_3', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y' +connection server_3; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +connection server_1; +### engines: MyISAM, MyISAM, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, MyISAM, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, MyISAM +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +connection server_1; +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +connection server_1; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: One key +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +connection server_1; +SET SQL_LOG_BIN=0; +connection server_2; +SET SQL_LOG_BIN=0; +connection server_3; +SET SQL_LOG_BIN=0; +******* TEST: No keys +connection server_1; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_2; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_3; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +connection server_1; +SET SQL_LOG_BIN=1; +connection server_2; +SET SQL_LOG_BIN=1; +connection server_3; +SET SQL_LOG_BIN=1; +connection server_1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +connection server_1; +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +connection server_1; +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +connection server_1; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +connection server_2; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +connection server_3; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +connection server_1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_img_sequence_full_nodup.result b/mysql-test/suite/rpl/r/rpl_row_img_sequence_full_nodup.result new file mode 100644 index 00000000..c6afb2ec --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_img_sequence_full_nodup.result @@ -0,0 +1,796 @@ +include/rpl_init.inc [topology=1->2->3] +connection server_1; +connection server_2; +connection server_3; +connection server_1; +# +# binlog_row_image=FULL_NODUP should write all columns to the binary log +# +CON: 'server_1', IMG: 'FULL_NODUP', RESTART SLAVE: 'N' +connection server_1; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +CON: 'server_2', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y' +connection server_2; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +CON: 'server_3', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y' +connection server_3; +SET SESSION binlog_row_image= 'FULL_NODUP'; +SET GLOBAL binlog_row_image= 'FULL_NODUP'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL_NODUP +connection server_1; +### engines: MyISAM, MyISAM, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, MyISAM, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, InnoDB, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, InnoDB, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, MyISAM, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, MyISAM, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, InnoDB, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, InnoDB, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +connection server_1; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +connection server_2; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +connection server_3; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +connection server_3; +include/rpl_end.inc +# End of tests diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result b/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result index 08f60144..dbea479b 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result @@ -2,14 +2,24 @@ include/master-slave.inc [connection master] connection master; call mtr.add_suppression("Got an error reading communication packets"); +call mtr.add_suppression("Could not read packet:.* vio_errno: 1158"); +call mtr.add_suppression("Could not write packet:.* vio_errno: 1160"); +set @save_semi_sync_master_enabled= @@global.rpl_semi_sync_master_enabled; +set @save_semi_sync_wp= @@global.rpl_semi_sync_master_wait_point; set @save_bgc_count= @@global.binlog_commit_wait_count; set @save_bgc_usec= @@global.binlog_commit_wait_usec; set @save_debug_dbug= @@global.debug_dbug; set @@global.binlog_commit_wait_count=3; set @@global.binlog_commit_wait_usec=10000000; set @@global.debug_dbug="+d,testing_cond_var_per_thd"; +set @@global.rpl_semi_sync_master_enabled= 1; +set @@global.rpl_semi_sync_master_wait_point= AFTER_COMMIT; # Ensure semi-sync is on connection slave; +set @save_semi_sync_slave_enabled= @@global.rpl_semi_sync_master_enabled; +include/stop_slave.inc +set @@global.rpl_semi_sync_slave_enabled=1; +include/start_slave.inc connection master; # Create three transactions to binlog group commit together connection master; @@ -22,11 +32,20 @@ connection master; connection server_1; connection default; include/assert_grep.inc [Check that there is no 'Thread awaiting semi-sync ACK was awoken before its ACK' warning in error log.] +connection slave; # # Cleanup connection master; set @@global.binlog_commit_wait_count=@save_bgc_count; set @@global.binlog_commit_wait_usec=@save_bgc_usec; set @@global.debug_dbug=@save_debug_dbug; +set @@global.rpl_semi_sync_master_enabled= @save_semi_sync_master_enabled; +set @@global.rpl_semi_sync_master_wait_point= @save_semi_sync_wp; +connection slave; +include/stop_slave.inc +set @@global.rpl_semi_sync_slave_enabled= @save_semi_sync_slave_enabled; +include/start_slave.inc +connection master; drop table t1, t2, t3; +connection slave; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result b/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result index 49fdb485..b881f69a 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result @@ -63,7 +63,7 @@ connection server_2; set global rpl_semi_sync_master_enabled = 1; set global rpl_semi_sync_master_wait_point=AFTER_SYNC; connection server_1; -CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_use_gtid=SLAVE_POS; +CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS; set global rpl_semi_sync_slave_enabled = 1; set @@global.gtid_slave_pos=@@global.gtid_binlog_pos; include/start_slave.inc @@ -149,7 +149,7 @@ connection server_1; set global rpl_semi_sync_master_enabled = 1; set global rpl_semi_sync_master_wait_point=AFTER_SYNC; connection server_2; -CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_use_gtid=SLAVE_POS; +CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS; set global rpl_semi_sync_slave_enabled = 1; set @@global.gtid_slave_pos=@@global.gtid_binlog_pos; include/start_slave.inc @@ -234,7 +234,7 @@ connection server_2; set global rpl_semi_sync_master_enabled = 1; set global rpl_semi_sync_master_wait_point=AFTER_SYNC; connection server_1; -CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_use_gtid=SLAVE_POS; +CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS; set global rpl_semi_sync_slave_enabled = 1; set @@global.gtid_slave_pos=@@global.gtid_binlog_pos; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result b/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result index 3c9cf71a..fca143bd 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result @@ -11,7 +11,7 @@ create table t1 (i int); connection slave; set global rpl_semi_sync_slave_enabled = ON; CALL mtr.add_suppression("Semi-sync slave net_flush*"); -SET @save_debug= @@global.debug; +SET @save_debug= @@global.debug_dbug; SET GLOBAL debug_dbug="+d,semislave_failed_net_flush"; include/start_slave.inc connection master; diff --git a/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result b/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result index d7f87ae5..d20960a9 100644 --- a/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result +++ b/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result @@ -268,20 +268,20 @@ show status like 'Rpl_semi_sync_master_clients'; Variable_name Value Rpl_semi_sync_master_clients 1 # Test failure of select error . -SET GLOBAL debug = 'd,rpl_semisync_simulate_select_error'; +SET GLOBAL debug_dbug = 'd,rpl_semisync_simulate_select_error'; INSERT INTO t1 VALUES(3); connection slave; connection con1; # Test failure of pthread_create SET GLOBAL rpl_semi_sync_master_enabled = 0; -SET GLOBAL debug = 'd,rpl_semisync_simulate_create_thread_failure'; +SET GLOBAL debug_dbug = 'd,rpl_semisync_simulate_create_thread_failure'; SET GLOBAL rpl_semi_sync_master_enabled= ON; # Test failure of pthread_join SET GLOBAL rpl_semi_sync_master_enabled= OFF; # # Failure on registering semisync slave # -SET GLOBAL debug= 'd,rpl_semisync_simulate_add_slave_failure'; +SET GLOBAL debug_dbug= 'd,rpl_semisync_simulate_add_slave_failure'; SET GLOBAL rpl_semi_sync_master_enabled= ON; connection slave; STOP SLAVE IO_THREAD; @@ -289,7 +289,7 @@ include/wait_for_slave_io_to_stop.inc START SLAVE IO_THREAD; include/wait_for_slave_io_to_start.inc connection con1; -SET GLOBAL debug=''; +SET GLOBAL debug_dbug=''; connection slave; START SLAVE IO_THREAD; include/wait_for_slave_io_to_start.inc @@ -343,6 +343,4 @@ SET GLOBAL rpl_semi_sync_master_enabled = 0; DROP TABLE t1; connection slave; SET GLOBAL rpl_semi_sync_slave_enabled = 0; -stop slave; -start slave; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result b/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result index 46f5a7c9..8681d67f 100644 --- a/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result +++ b/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result @@ -11,7 +11,9 @@ CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER # Connection_name = 'm1' RESET SLAVE ALL; -CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root'; +CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', +MASTER_PORT=MASTER_MYPORT, MASTER_USER='root', +MASTER_SSL_VERIFY_SERVER_CERT=0; SET STATEMENT default_master_connection = 'm1' FOR START SLAVE; set default_master_connection = 'm1'; include/wait_for_slave_to_start.inc diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result index 79803cca..0c890337 100644 --- a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result @@ -3,7 +3,7 @@ include/master-slave.inc connect slave2,127.0.0.1,root,,test,$SLAVE_MYPORT2,; connection slave2; RESET SLAVE; -CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_PORT,master_user='root'; +CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_PORT,master_user='root', master_ssl_verify_server_cert=0; START SLAVE IO_THREAD; include/wait_for_slave_io_to_start.inc connection master; diff --git a/mysql-test/suite/rpl/r/rpl_skip_replication.result b/mysql-test/suite/rpl/r/rpl_skip_replication.result index 96e0a303..c17ffbb5 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_replication.result +++ b/mysql-test/suite/rpl/r/rpl_skip_replication.result @@ -12,7 +12,7 @@ SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1'; connect nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,; connection nonpriv; SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER; -ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation +ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation disconnect nonpriv; connection slave; DROP USER'nonsuperuser'@'127.0.0.1'; diff --git a/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result b/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result index f90d2126..4d0c81f4 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result +++ b/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result @@ -5,7 +5,7 @@ include/start_slave.inc Warnings: Note 1254 Slave is already running set default_master_connection = 'm2'; -change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos; +change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos; include/start_slave.inc select @@global.slave_parallel_workers as two; two diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result index ce9e4d48..8c696f25 100644 --- a/mysql-test/suite/rpl/r/rpl_ssl.result +++ b/mysql-test/suite/rpl/r/rpl_ssl.result @@ -51,7 +51,7 @@ connection slave; include/stop_slave.inc CHANGE MASTER TO master_user = 'root', -master_ssl = 0, +master_ssl = 1, master_ssl_ca = '', master_ssl_cert = '', master_ssl_key = ''; diff --git a/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result index 0cb21716..c6721d2f 100644 --- a/mysql-test/suite/rpl/r/rpl_ssl1.result +++ b/mysql-test/suite/rpl/r/rpl_ssl1.result @@ -7,7 +7,7 @@ create table t1 (t int); connection slave; stop slave; include/wait_for_slave_to_stop.inc -change master to master_user='replssl',master_password=''; +change master to master_user='replssl',master_password='',master_ssl=0; start slave; connection master; insert into t1 values (1); @@ -16,7 +16,11 @@ select * from t1; t include/wait_for_slave_io_error.inc [errno=1045] include/stop_slave_sql.inc -change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem'; +change master to +master_ssl=1, +master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', +master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', +master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem'; start slave; include/wait_for_slave_to_start.inc connection master; @@ -61,7 +65,6 @@ connection master; create table t1 (t int); insert into t1 values (1); connection slave; -on slave select * from t1; t 1 @@ -72,14 +75,42 @@ Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem' Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem' include/check_slave_is_running.inc connection master; +create user replssl@127.0.0.1 identified by "sslrepl"; +grant replication slave on *.* to replssl@127.0.0.1 require ssl; +connection slave; +stop slave; +include/wait_for_slave_to_stop.inc +change master to +master_host="127.0.0.1", +master_user='replssl', +master_password="sslrepl", +master_ssl=1, +master_ssl_verify_server_cert=1, +master_ssl_ca ='', +master_ssl_cert='', +master_ssl_key=''; +start slave; +include/wait_for_slave_to_start.inc +show tables; +Tables_in_test +t1 +connection master; drop table t1; connection slave; +show tables; +Tables_in_test include/stop_slave.inc CHANGE MASTER TO master_host="127.0.0.1", +master_user='root', +master_password='', master_ssl_ca ='', master_ssl_cert='', master_ssl_key='', master_ssl_verify_server_cert=0, -master_ssl=0; +master_ssl=1; +connection master; +drop user replssl@127.0.0.1; +connection slave; +drop user replssl@127.0.0.1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result b/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result index 2b53fde5..15c1ae00 100644 --- a/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result +++ b/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result @@ -5,7 +5,7 @@ include/stop_slave.inc CHANGE MASTER TO MASTER_USE_GTID=NO; include/start_slave.inc connection slave; -SET @old_debug_slave= @@global.debug; +SET @old_debug_slave= @@global.debug_dbug; stop slave; SET GLOBAL slave_parallel_threads=4; set global slave_parallel_mode=optimistic; @@ -13,7 +13,7 @@ set global gtid_strict_mode=1; start slave; connection master; call mtr.add_suppression("ALTER query started at .+ could not be completed"); -SET @old_debug_master= @@global.debug; +SET @old_debug_master= @@global.debug_dbug; set binlog_alter_two_phase=true; create table t3( a int primary key, b int) engine=innodb; connection master; diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result b/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result index 76f9cbcd..39b98042 100644 --- a/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result +++ b/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result @@ -1,7 +1,7 @@ include/master-slave.inc [connection master] connection slave; -SET @old_debug_slave= @@global.debug; +SET @old_debug_slave= @@global.debug_dbug; include/stop_slave.inc SET GLOBAL slave_parallel_threads=4; set global slave_parallel_mode=optimistic; @@ -9,7 +9,7 @@ set global gtid_strict_mode=1; set global debug_dbug="+d,rpl_slave_stop_CA_before_binlog"; include/start_slave.inc connection master; -SET @old_debug_master= @@global.debug; +SET @old_debug_master= @@global.debug_dbug; set global debug_dbug="+d,start_alter_delay_master"; set global binlog_alter_two_phase=true; create table t1( a int primary key, b int) engine=myisam; @@ -112,10 +112,10 @@ set global binlog_alter_two_phase = 0; SET GLOBAL debug_dbug= @old_debug_master; set DEBUG_SYNC= 'RESET'; connection slave; -stop slave; +include/stop_slave.inc set global slave_parallel_threads = 0;; set global slave_parallel_mode = optimistic;; set global gtid_strict_mode = 0;; set DEBUG_SYNC= 'RESET'; -start slave; +include/start_slave.inc include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result index 492e9ac3..3651ead1 100644 --- a/mysql-test/suite/rpl/r/rpl_temporary.result +++ b/mysql-test/suite/rpl/r/rpl_temporary.result @@ -42,12 +42,12 @@ connect con3,localhost,zedjzlcsjhd,,; connection con3; SET @save_select_limit=@@session.sql_select_limit; SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100; -ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation +ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation SELECT @@session.sql_select_limit = @save_select_limit; @@session.sql_select_limit = @save_select_limit 1 SET @@session.sql_select_limit=10, @@session.sql_log_bin=0; -ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation +ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation SELECT @@session.sql_select_limit = @save_select_limit; @@session.sql_select_limit = @save_select_limit 1 diff --git a/mysql-test/suite/rpl/r/rpl_timestamp.result b/mysql-test/suite/rpl/r/rpl_timestamp.result index 9fc93062..929d3d95 100644 --- a/mysql-test/suite/rpl/r/rpl_timestamp.result +++ b/mysql-test/suite/rpl/r/rpl_timestamp.result @@ -2,6 +2,8 @@ include/master-slave.inc [connection master] set timestamp=1656940000; set explicit_defaults_for_timestamp=!@@explicit_defaults_for_timestamp; +Warnings: +Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release connection master; create table t1 (f1 timestamp, f2 timestamp); show create table t1; diff --git a/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result b/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result index 1babddf9..08a0a6a4 100644 --- a/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result +++ b/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result @@ -90,7 +90,7 @@ connection master; INSERT INTO t1 VALUES (6); include/save_master_gtid.inc connection slave; -CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, MASTER_SSL=1; include/start_slave.inc include/sync_with_master_gtid.inc SELECT * FROM t1 ORDER BY a; diff --git a/mysql-test/suite/rpl/r/rpl_xa.result b/mysql-test/suite/rpl/r/rpl_xa.result index 061c7b36..91e2a1f3 100644 --- a/mysql-test/suite/rpl/r/rpl_xa.result +++ b/mysql-test/suite/rpl/r/rpl_xa.result @@ -225,7 +225,7 @@ drop table t1, t2, t3, tm; create table t1 (a int primary key, b int unique) engine=innodb; insert t1 values (1,1),(3,3),(5,5); connection slave; -set session tx_isolation='repeatable-read'; +set session transaction_isolation='repeatable-read'; start transaction; select * from t1; a b diff --git a/mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result b/mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result index 35625cc7..66300e4d 100644 --- a/mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result +++ b/mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result @@ -234,7 +234,7 @@ drop table t1, t2, t3, tm; create table t1 (a int primary key, b int unique) engine=innodb; insert t1 values (1,1),(3,3),(5,5); connection slave; -set session tx_isolation='repeatable-read'; +set session transaction_isolation='repeatable-read'; start transaction; select * from t1; a b diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result index 35cb3fcd..c38d1343 100644 --- a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result +++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result @@ -3,6 +3,6 @@ include/master-slave.inc connection slave; connection slave; include/wait_for_slave_to_stop.inc -start slave; +include/start_slave.inc connection master; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/rpl_1slave_base.cnf b/mysql-test/suite/rpl/rpl_1slave_base.cnf index a7a7f5c6..c1e9e828 100644 --- a/mysql-test/suite/rpl/rpl_1slave_base.cnf +++ b/mysql-test/suite/rpl/rpl_1slave_base.cnf @@ -1,6 +1,5 @@ # Use default setting for mysqld processes -!include include/default_mysqld.cnf -!include include/default_client.cnf +!include include/default_my.cnf [mysqld.1] diff --git a/mysql-test/suite/rpl/t/grant_replication_slave.test b/mysql-test/suite/rpl/t/grant_replication_slave.test index c5aca0a6..d50e8a13 100644 --- a/mysql-test/suite/rpl/t/grant_replication_slave.test +++ b/mysql-test/suite/rpl/t/grant_replication_slave.test @@ -33,7 +33,7 @@ drop database mysqltest1; sync_slave_with_master; stop slave; change master to master_user='root'; -start slave; +source include/start_slave.inc; source include/rpl_end.inc; drop user rpl@localhost; diff --git a/mysql-test/suite/rpl/t/max_binlog_total_size-master.opt b/mysql-test/suite/rpl/t/max_binlog_total_size-master.opt new file mode 100644 index 00000000..9ba64a44 --- /dev/null +++ b/mysql-test/suite/rpl/t/max_binlog_total_size-master.opt @@ -0,0 +1,5 @@ +--log-bin=binary +--max-binlog-total-size=1500 +--max-binlog-size=4096 +--binlog-format=row +--slave_connections_needed_for_purge=1 diff --git a/mysql-test/suite/rpl/t/max_binlog_total_size.test b/mysql-test/suite/rpl/t/max_binlog_total_size.test new file mode 100644 index 00000000..2892d137 --- /dev/null +++ b/mysql-test/suite/rpl/t/max_binlog_total_size.test @@ -0,0 +1,58 @@ +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + + +--echo # +--echo # MDEV-31404 Implement binlog_space_limit +--echo # + +--echo # Test that master is not deleting binary logs before slave has a +--echo # chance to digest them + +select @@global.max_binlog_total_size; +select @@global.max_binlog_size; + +--connection slave +STOP SLAVE IO_THREAD; +--source include/wait_for_slave_io_to_stop.inc +--connection master + +# Kill the dump thread +let $id=`SELECT id from information_schema.processlist where command='Binlog Dump'`; + +if ($id) +{ + replace_result $id DUMP_THREAD; + eval kill $id; + let $wait_condition= SELECT count(*)=0 from information_schema.processlist where command='Killed'; + source include/wait_condition.inc; +} + +CREATE TABLE `t1` ( + `v1` int(11) DEFAULT NULL, + `v2` varchar(8000) DEFAULT NULL, + KEY `v1` (`v1`) +); + +FLUSH LOGS; +FLUSH LOGS; +FLUSH LOGS; +--source include/show_binary_logs.inc + +INSERT INTO t1 VALUES (0,repeat("a",3000)); +--source include/show_binary_logs.inc + +--connection slave +START SLAVE IO_THREAD; +--connection master + +--sync_slave_with_master +--connection master + +# Slave is now connected. Next query should remove old binary logs. + +DROP TABLE t1; +--source include/show_binary_logs.inc + +# End of 11.4 tests +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_000010.test b/mysql-test/suite/rpl/t/rpl_000010.test index 9ff2d6c5..27b29017 100644 --- a/mysql-test/suite/rpl/t/rpl_000010.test +++ b/mysql-test/suite/rpl/t/rpl_000010.test @@ -17,6 +17,7 @@ select n from t1; connection master; drop table t1; sync_slave_with_master; +source include/wait_for_slave_to_start.inc; # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_alter_extra_persistent.test b/mysql-test/suite/rpl/t/rpl_alter_extra_persistent.test index 4e604787..e61d0502 100644 --- a/mysql-test/suite/rpl/t/rpl_alter_extra_persistent.test +++ b/mysql-test/suite/rpl/t/rpl_alter_extra_persistent.test @@ -20,11 +20,19 @@ insert into t1 values(6); --sync_slave_with_master select * from t1 order by a; +alter table t1 add column z3 int default(a+2); +--connection master +insert into t1 values(7); +insert into t1 values(8); + +--sync_slave_with_master +select * from t1 order by a; +--connection master +delete from t1 where a > 6; --echo #UPDATE query ---connection master update t1 set a = a+10; select * from t1 order by a; @@ -95,12 +103,177 @@ start slave; --source include/wait_for_slave_sql_to_start.inc ---connection master +--connection master --sync_slave_with_master select * from t1 order by a; --connection master select * from t1 order by a; drop table t1; +--sync_slave_with_master +--connection master + +set binlog_row_image=minimal; + +create table t1(a int primary key auto_increment, b int unique); +insert into t1 values(1, 1); +insert into t1 values(2, 2); +insert into t1 values(3, 3); +insert into t1 values(4, 4); +insert into t1 values(5, 5); + +--sync_slave_with_master +alter table t1 add column d1 int default (b), + add column z1 int as (b+1) virtual, + add column z2 int as (b+2) persistent; +--connection master + +insert into t1 values(6, 6); +update t1 set a = 11 where a = 1; +update t1 set b = 12 where b = 2; + +delete from t1 where a = 3; +delete from t1 where b = 5; + +update t1 set b = 16 where a = 6; + +--sync_slave_with_master +select * from t1; + +--echo # Cleanup +--connection master +drop table t1; +--sync_slave_with_master +--connection master + + +set binlog_row_image=minimal; + +--echo # +--echo # MDEV-29069 ER_KEY_NOT_FOUND upon online autoinc addition and +--echo # concurrent DELETE +--echo # + +create or replace table t (a int); +insert into t values (10),(20),(30); + +--sync_slave_with_master +alter table t add pk int auto_increment primary key; + +--connection master +delete from t where a = 20; +update t set a = a + 1 where a = 10; +--sync_slave_with_master +select * from t; +--connection master + +--echo # +--echo # Add clumsy DEFAULT +--echo # +create or replace table t (a int); +insert into t values (10),(20),(30); + +--sync_slave_with_master +alter table t add b int default(RAND() * 20), add key(b), + algorithm=copy, lock=none; +--connection master +delete from t where a = 20; +update t set a = a + 1 where a = 10; +--sync_slave_with_master +select a from t; +--connection master + +--echo # CURRENT_TIMESTAMP +create or replace table t (a int); +insert into t values (10),(20),(30); + +--sync_slave_with_master +alter table t add b timestamp default CURRENT_TIMESTAMP, add key(b); +--connection master +delete from t where a = 20; +update t set a = a + 1 where a = 10; +--sync_slave_with_master +select a from t; +--connection master + +--echo # CURRENT_TIMESTAMP, mixed key +create or replace table t (a int); +insert into t values (10),(20),(30); + +--sync_slave_with_master +alter table t add b timestamp default CURRENT_TIMESTAMP, add key(a, b); +--connection master +delete from t where a = 20; +update t set a = a + 1 where a = 10; + +--sync_slave_with_master +select a from t; +--connection master + +--echo # Mixed primary key +create or replace table t (a int); +insert into t values (10),(20),(30); + +--sync_slave_with_master +alter table t add b int default (1), add primary key(b, a); +--connection master +delete from t where a = 20; +update t set a = a + 1 where a = 10; + +--sync_slave_with_master +select a from t; +--connection master + +--echo # +--echo # Normal row, could be used as a key +--echo # +create or replace table t (a int); +insert into t values (10),(20),(30); + +--sync_slave_with_master +alter table t add b int as (a * 10) unique; +--connection master +delete from t where a = 20; +update t set a = a + 1 where a = 10; + +--sync_slave_with_master +select * from t; +--connection master + +--echo # +--echo # Add key for old row +--echo # +create or replace table t (a int); +insert into t values (10),(20),(30); + +--sync_slave_with_master +alter table t add unique(a); +--connection master +delete from t where a = 20; +update t set a = a + 1 where a = 10; + +--sync_slave_with_master +select * from t; + +--echo # Cleanup +--connection master +--sync_slave_with_master +--connection master +drop table t; + +--echo # +--echo # MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types +--echo # +create table t(geo geometrycollection default st_geomfromtext('point(1 1)')); +insert into t () values (),(),(); +--sync_slave_with_master +alter table t add vcol9 point as (geo), add key(vcol9); +--connection master + +delete from t; +--sync_slave_with_master +--connection master + +drop table t; --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_alter_instant.test b/mysql-test/suite/rpl/t/rpl_alter_innodb.test index 260f7e92..260f7e92 100644 --- a/mysql-test/suite/rpl/t/rpl_alter_instant.test +++ b/mysql-test/suite/rpl/t/rpl_alter_innodb.test diff --git a/mysql-test/suite/rpl/t/rpl_alter_online_debug.test b/mysql-test/suite/rpl/t/rpl_alter_online_debug.test new file mode 100644 index 00000000..b257ce29 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_alter_online_debug.test @@ -0,0 +1,128 @@ +source include/have_debug_sync.inc; +source include/have_innodb.inc; +source include/master-slave.inc; + +--connection master +call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); + +--connection slave +call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); + +# +# Single-phase alter +# + +--echo # MDEV-31804 Assertion `thd->m_transaction_psi == __null' fails upon +--echo # replicating online ALTER +--connection master +create table t (a char(8)) engine=myisam; +insert into t values ('foo'),('bar'); + +set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter'; +set @old_slave_exec_mode= @@global.slave_exec_mode; +set @@global.slave_exec_mode= idempotent; +send alter table t force; + +--connection master1 +set debug_sync= 'now wait_for go_dml'; +insert into t (a) values ('qux'); +set debug_sync= 'now signal go_alter'; + +--connection master +--reap +--sync_slave_with_master + +# Cleanup +--connection master +drop table t; +set global slave_exec_mode= @old_slave_exec_mode; +set debug_sync= reset; + + +--echo # +--echo # End of 11.2 tests (Single-phase alter) +--echo # + + +# +# Two-phase alter +# +--connection slave +source include/stop_slave.inc; +--let $slave_parallel_threads=`select @@global.slave_parallel_threads` +--let $slave_parallel_mode= `select @@global.slave_parallel_mode` +--let $binlog_row_image= `select @@global.binlog_row_image` +set global slave_parallel_threads=3; +set global slave_parallel_mode= optimistic; +set global binlog_row_image=MINIMAL; +--connection master + + +--echo # +--echo # MDEV-31755 Replica's DML event deadlocks wit online alter table +--echo # +--echo # Three threads for SA,U,CA + +create table t (id int, a int, primary key (id)) engine=innodb; +insert into t values (1,10), (2,20); + +set @@session.binlog_alter_two_phase=1; +set debug_sync= 'alter_table_online_downgraded signal ready wait_for go'; +send alter table t add c text default('qqq') after id, algorithm=copy, lock=none; + +--connection master1 +set debug_sync= 'now wait_for ready'; + +update t set a = 1; + +set debug_sync= 'now signal go'; + +--connection master +--reap +--source include/save_master_gtid.inc + +--connection slave +source include/start_slave.inc; +--source include/sync_with_master_gtid.inc +select * from t; + +# Cleanup +--connection master +drop table t; + +--echo # MDEV-31838 Assertion fails on replica upon parallel +--echo # replication with two-phase alter and MINIMAL row image +create table t (id int, a int, primary key(id)) engine=aria; +insert into t values (1,0); + +set @@session.binlog_alter_two_phase=1; +set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter'; +send alter table t force, algorithm=copy, lock=none; + +--connection master1 +set binlog_row_image=MINIMAL; +set debug_sync= 'now wait_for go_dml'; +--disable_warnings +update ignore t set a = 1; +--enable_warnings +set debug_sync= 'now signal go_alter'; + +# Cleanup +--connection master +--reap +drop table t; +--sync_slave_with_master +--connection master + +--echo # +--echo # End of 11.2 tests (Two-phase alter) +--echo # + +--connection slave +source include/stop_slave.inc; +--eval set global binlog_row_image=$binlog_row_image +--eval set global slave_parallel_threads=$slave_parallel_threads +--eval set global slave_parallel_mode= $slave_parallel_mode +source include/start_slave.inc; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_bug26395.test b/mysql-test/suite/rpl/t/rpl_bug26395.test index 0c1b2a7a..5054b106 100644 --- a/mysql-test/suite/rpl/t/rpl_bug26395.test +++ b/mysql-test/suite/rpl/t/rpl_bug26395.test @@ -30,7 +30,7 @@ # BUG#26395: if crash during autocommit update to transactional table on master, slave fails source include/have_innodb.inc; -# have_debug is needed since we use the @@debug variable on master +# have_debug is needed since we use the @@debug_dbug variable on master source include/have_debug.inc; source include/master-slave.inc; @@ -43,7 +43,7 @@ CREATE TABLE tinnodb (a INT) ENGINE = INNODB; SHOW CREATE TABLE tinnodb; # do_not_write_xid stops the master from writing an XID event. -set @old_debug= @@debug; +set @old_debug= @@debug_dbug; set @@debug_dbug= 'd,do_not_write_xid'; diff --git a/mysql-test/suite/rpl/t/rpl_checksum_cache.test b/mysql-test/suite/rpl/t/rpl_checksum_cache.test index e04f618b..173af8c1 100644 --- a/mysql-test/suite/rpl/t/rpl_checksum_cache.test +++ b/mysql-test/suite/rpl/t/rpl_checksum_cache.test @@ -243,6 +243,102 @@ let $diff_tables=master:test.t3, slave:test.t3; source include/diff_tables.inc; +--echo *** Test switching checksum algorithm while ongoing transactions have pre-computed checksum in their binlog cache *** + +--connection master +CREATE TABLE t4 (a INT, b INT, c VARCHAR(1024), PRIMARY KEY (a,b)) ENGINE=InnoDB; + +# Create a couple transactions that will precompute checksums but commit +# without them. + +BEGIN; +INSERT INTO t4 VALUES (1, 1, "small, pre-computed checksums"); + +--connection server_1 +BEGIN; +INSERT INTO t4 VALUES (2, 1, "big, pre-computed checksums"); +--let $i= 20 +--disable_query_log +while ($i) { + eval INSERT INTO t4 VALUES (2, 22-$i, REPEAT("x", FLOOR(RAND()*100) + 831)); + dec $i; +} +--enable_query_log + +# Disable checksums dynamically, so MYSQL_BIN_LOG::write_cache() will have +# to drop the pre-computed checksums. +set @@global.binlog_checksum = NONE; + +--connection master +INSERT INTO t4 VALUES (1, 2, "done"); +COMMIT; +--connection server_1 +INSERT INTO t4 VALUES (2, 22, "done"); +COMMIT; + +# Create a couple transactions that will not precompute checksums but commit +# with them. + +--connection master +BEGIN; +INSERT INTO t4 VALUES (3, 1, "small, no pre-computed checksums"); + +--connection server_1 +BEGIN; +INSERT INTO t4 VALUES (4, 1, "big, no pre-computed checksums"); +--let $i= 20 +--disable_query_log +while ($i) { + eval INSERT INTO t4 VALUES (4, 22-$i, REPEAT("x", FLOOR(RAND()*100) + 853)); + dec $i; +} +--enable_query_log + +# Ebable checksums dynamically, so MYSQL_BIN_LOG::write_cache() will have +# to recompute the checksums. +set @@global.binlog_checksum = CRC32; + +--connection master +INSERT INTO t4 VALUES (3, 2, "done"); +COMMIT; +--connection server_1 +INSERT INTO t4 VALUES (4, 22, "done"); +COMMIT; + +sync_slave_with_master; + + +--echo *** Test the --binlog-legacy-event-pos option. +--connection master +FLUSH BINARY LOGS; +--source include/wait_for_binlog_checkpoint.inc + +--let $query_file= query_get_value(SHOW MASTER STATUS, File, 1) +--let $query_pos= query_get_value(SHOW MASTER STATUS, Position, 1) +BEGIN; +INSERT INTO t4 VALUES (5, 1, "Zero end_log_pos"); +COMMIT; +--let $end_log_pos= query_get_value(SHOW BINLOG EVENTS IN "$query_file" FROM $query_pos LIMIT 3, End_log_pos, 2) +if ($end_log_pos!=0) { + eval SHOW BINLOG EVENTS IN "$query_file"; + --die Wrong End_log_pos=$end_log_pos, expected zero. +} + +set @@global.binlog_legacy_event_pos= 1; +--let $query_pos= query_get_value(SHOW MASTER STATUS, Position, 1) +BEGIN; +INSERT INTO t4 VALUES (6, 1, "Non-zero end_log_pos"); +COMMIT; +--let $end_log_pos= query_get_value(SHOW BINLOG EVENTS IN "$query_file" FROM $query_pos LIMIT 3, End_log_pos, 2) +if ($end_log_pos==0) { + eval SHOW BINLOG EVENTS IN "$query_file"; + --die Wrong End_log_pos=$end_log_pos, expected non-zero. +} +set @@global.binlog_legacy_event_pos= 0; + +sync_slave_with_master; + + connection master; begin; @@ -251,7 +347,7 @@ delete from t2; delete from t3; commit; -drop table t1, t2, t3; +drop table t1, t2, t3, t4; set @@global.binlog_cache_size = @save_binlog_cache_size; set @@global.binlog_checksum = @save_binlog_checksum; set @@global.master_verify_checksum = @save_master_verify_checksum; diff --git a/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test b/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test index e533c54b..75d04d65 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test @@ -55,7 +55,7 @@ INSERT INTO t1(a) VALUES (1); set @@global.gtid_strict_mode = true; set @@global.rpl_semi_sync_slave_enabled = 1; -evalp CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=SLAVE_POS; +evalp CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS; --source include/start_slave.inc --echo ... is done. diff --git a/mysql-test/suite/rpl/t/rpl_connection.test b/mysql-test/suite/rpl/t/rpl_connection.test index 24ada7c8..5ad076de 100644 --- a/mysql-test/suite/rpl/t/rpl_connection.test +++ b/mysql-test/suite/rpl/t/rpl_connection.test @@ -19,6 +19,6 @@ START SLAVE; --source include/stop_slave_sql.inc CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= ''; -START SLAVE; +--source include/start_slave.inc --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_corruption.test b/mysql-test/suite/rpl/t/rpl_corruption.test index cd2a1cc7..16270fa4 100644 --- a/mysql-test/suite/rpl/t/rpl_corruption.test +++ b/mysql-test/suite/rpl/t/rpl_corruption.test @@ -14,10 +14,10 @@ ############################################################ # -# The tests intensively utilize @@global.debug. Note, +# The tests intensively utilize @@global.debug_dbug. Note, # Bug#11765758 - 58754, -# @@global.debug is read by the slave threads through dbug-interface. -# Hence, before a client thread set @@global.debug we have to ensure that: +# @@global.debug_dbug is read by the slave threads through dbug-interface. +# Hence, before a client thread set @@global.debug_dbug we have to ensure that: # (a) the slave threads are stopped, or (b) the slave threads are in # sync and waiting. diff --git a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt deleted file mode 100644 index 815a8f81..00000000 --- a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt +++ /dev/null @@ -1 +0,0 @@ ---replicate-same-server-id --relay-log=slave-relay-bin diff --git a/mysql-test/suite/rpl/t/rpl_cross_version.test b/mysql-test/suite/rpl/t/rpl_cross_version.test deleted file mode 100644 index 94c9f043..00000000 --- a/mysql-test/suite/rpl/t/rpl_cross_version.test +++ /dev/null @@ -1,48 +0,0 @@ -# ==== Purpose ==== -# -# Verify cross-version replication from an old master to the up-to-date slave -# -# ==== Implementation ==== -# -# Feed to the slave server a binlog recorded on an old version master -# via setting up slave-to-slave replication. The latter is done by means of -# the opt file and include/setup_fake_relay_log.inc. -# The master's binlog is treated as a relay log that the SQL thread executes. -# - ---source include/master-slave.inc - -# -# Bug#31240 load data infile replication between (4.0 or 4.1) and 5.1 fails -# - ---echo ==== Initialize ==== ---connection slave - ---disable_query_log -# The binlog contains the function RAND which is unsafe. -CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); ---enable_query_log - ---source include/stop_slave.inc -RESET SLAVE; - -# the relay log contains create t1, t3 tables and load data infile ---let $fake_relay_log = $MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001 ---source include/setup_fake_relay_log.inc - ---echo ==== Test ==== -start slave sql_thread; ---let $slave_param = Exec_Master_Log_Pos -# end_log_pos of the last event of the relay log ---let $slave_param_value = 149436 ---source include/wait_for_slave_param.inc ---echo ==== a prove that the fake has been processed successfully ==== -SELECT COUNT(*) - 17920 as zero FROM t3; - ---echo ==== Clean up ==== ---source include/stop_slave_sql.inc ---source include/cleanup_fake_relay_log.inc -drop table t1, t3; ---let $rpl_only_running_threads= 1 ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_ctype_collate_implicit.test b/mysql-test/suite/rpl/t/rpl_ctype_collate_implicit.test new file mode 100644 index 00000000..ba4e3fed --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_ctype_collate_implicit.test @@ -0,0 +1,60 @@ +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +--echo # +--echo # MDEV-30164 System variable for default collations +--echo # + +--connection master +SET @@character_set_collations='utf8mb3=uca1400_ai_ci,' + 'utf8mb4=uca1400_ai_ci,' + 'ucs2=uca1400_ai_ci,' + 'utf16=uca1400_ai_ci,' + 'utf32=uca1400_ai_ci'; + +--connection master +CREATE TABLE t1 AS SELECT CHAR(0x61 USING utf8mb4); +SHOW CREATE TABLE t1; +--sync_slave_with_master +SHOW CREATE TABLE t1; +--connection master +DROP TABLE t1; +--sync_slave_with_master + + +--connection master +CREATE TABLE t1 AS SELECT CONVERT('a' USING utf8mb4); +SHOW CREATE TABLE t1; +--sync_slave_with_master +SHOW CREATE TABLE t1; +--connection master +DROP TABLE t1; +--sync_slave_with_master + + +--connection master +CREATE TABLE t1 ( + c0 TEXT CHARACTER SET utf8mb3, + c1 TEXT CHARACTER SET utf8mb4, + c2 TEXT CHARACTER SET utf16, + c3 TEXT CHARACTER SET utf32, + c4 TEXT CHARACTER SET ucs2 +); +SHOW CREATE TABLE t1; +--sync_slave_with_master +SHOW CREATE TABLE t1; +--connection master +DROP TABLE t1; +--sync_slave_with_master + + +--connection master +CREATE DATABASE db1 CHARACTER SET utf8mb4; +--sync_slave_with_master +SHOW CREATE DATABASE db1; +--connection master +DROP DATABASE db1; +--sync_slave_with_master + + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test b/mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test new file mode 100644 index 00000000..7e2daa9a --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test @@ -0,0 +1,44 @@ +--source include/have_binlog_format_row.inc +--source include/have_innodb.inc +--source include/master-slave.inc + +set binlog_row_image=minimal; + +connection slave; +stop slave; +set global binlog_row_image=minimal; +--source include/reset_slave.inc + +create table t1 ( + a int key, b blob, c char(5), + d char(10) as (concat(trim(c), '-U')) unique, + e char(10) as (concat('S', b)) stored) engine=innodb; + +connection master; +create table t1 (a int primary key, b blob, c char(5)) engine=innodb; +reset master; + +connection slave; +start slave; + +connection master; +set timestamp=unix_timestamp('2010-10-10 10:10:10'); +insert t1 values (1,'.','Kyle'),(2,'?','JOE'),(3,'!','QA'), (4, '$', '4TH'); +update t1 set c='UPD' where a=3; +update t1 set b='#' where a=2; +delete from t1 where a=4; +--sorted_result +select * from t1; +--sorted_result +sync_slave_with_master; +--sorted_result +select * from t1; +select d from t1; # no --sorted_result here, this must be KEYREAD, so must be sorted +select * from t1 where d='JOE-U'; + +connection master; +drop table t1; +sync_slave_with_master; +set global binlog_row_image=full; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_geometry.test b/mysql-test/suite/rpl/t/rpl_geometry.test index 415732a0..664979eb 100644 --- a/mysql-test/suite/rpl/t/rpl_geometry.test +++ b/mysql-test/suite/rpl/t/rpl_geometry.test @@ -23,4 +23,17 @@ sync_slave_with_master; connection master; drop table t1, t2; + +--echo # +--echo # MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types +--echo # +create table t(geo geometrycollection default st_geomfromtext('point(1 1)'), + vc point as (geo)); +insert into t () values (),(),(); +delete from t; + +sync_slave_with_master; +connection master; +drop table t; + --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test b/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test index f0f38a31..8d8f22bb 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test @@ -24,6 +24,7 @@ CHANGE MASTER TO MASTER_USE_GTID=slave_pos; --echo # --echo # Initialize test data --connection master +--source include/wait_for_binlog_checkpoint.inc create table t1 (a int); SET @@session.server_id= 3; create table t2 (a int); diff --git a/mysql-test/suite/rpl/t/rpl_gtid_index.test b/mysql-test/suite/rpl/t/rpl_gtid_index.test new file mode 100644 index 00000000..6001cc6e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_gtid_index.test @@ -0,0 +1,89 @@ +--source include/have_sequence.inc +--source include/have_innodb.inc +--source include/master-slave.inc +--source include/have_binlog_format_mixed.inc + +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO master_use_gtid= slave_pos; +--source include/start_slave.inc + +--connection master +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (0, 0); + + +--echo *** Test looking up a lot of different event positions and GTIDs. + +# A function for comparing GTID positions. +# Handles that the domain_id order is different in the two strings. +# Works by repeatedly removing one GTID from each string. If the strings have +# the same length and nothing is left at the end, then they are identical. +delimiter //; +CREATE FUNCTION gtid_eq(a VARCHAR(255), b VARCHAR(255)) RETURNS BOOLEAN DETERMINISTIC +BEGIN + DECLARE g VARCHAR(255); + IF a IS NULL OR b IS NULL OR LENGTH(a) != LENGTH(b) THEN + RETURN FALSE; + END IF; + SET a= CONCAT(a, ','); + SET b= CONCAT(',', b, ','); + WHILE LENGTH(a) > 0 DO + SET g= REGEXP_SUBSTR(a, '^[^,]+,'); + SET a= SUBSTRING(a, LENGTH(g)+1); + SET b= REPLACE(b, CONCAT(',', g), ','); + END WHILE; + RETURN b = ','; +END // +delimiter ;// + +SET @old_page_size= @@GLOBAL.binlog_gtid_index_page_size; +SET @old_span_min= @@GLOBAL.binlog_gtid_index_span_min; + +--echo *** A fair amount of work with default GTID index settings. +--let $NUM_POS= 200 +--let $NUM_DOMAIN= 5 +--let $NUM_SERVER= 5 +--let $NUM_SLAVE_CONNECTS= 50 +--let $RND_SEED= 42 +--source suite/rpl/include/rpl_gtid_index.inc + +--echo *** A lot of GTIDs with small btree pages to stress the Btree code. +--let $NUM_POS= 1000 +--let $NUM_DOMAIN= 10 +--let $RND_SEED= 150 +SET GLOBAL binlog_gtid_index_page_size= 64; +SET GLOBAL binlog_gtid_index_span_min= 1; +--source suite/rpl/include/rpl_gtid_index.inc + +--echo *** Small page size with sparse index. +--let $NUM_POS= 200 +--let $RND_SEED= 666 +SET GLOBAL binlog_gtid_index_page_size= 64; +SET GLOBAL binlog_gtid_index_span_min= 2048; +--source suite/rpl/include/rpl_gtid_index.inc + +--echo *** Medium page size. +--let $NUM_POS= 200 +--let $RND_SEED= 1024 +SET GLOBAL binlog_gtid_index_page_size= 512; +SET GLOBAL binlog_gtid_index_span_min= 512; +--source suite/rpl/include/rpl_gtid_index.inc + +--echo *** Large page size. +--let $NUM_POS= 200 +--let $RND_SEED= 12345 +SET GLOBAL binlog_gtid_index_page_size= 16384; +SET GLOBAL binlog_gtid_index_span_min= 1; +--source suite/rpl/include/rpl_gtid_index.inc + + +# Cleanup. +--connection master +SET GLOBAL binlog_gtid_index_page_size= @old_page_size; +SET GLOBAL binlog_gtid_index_span_min= @old_span_min; + +DROP TABLE t1; +DROP FUNCTION gtid_eq; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test b/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test index 064c70b1..5e2470ed 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test @@ -221,7 +221,8 @@ SELECT * FROM t4 ORDER BY a,b; --connection server_1 --replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2, - master_user = "root", master_use_gtid = slave_pos, master_demote_to_slave=1; + master_user = "root", master_ssl_verify_server_cert=0, + master_use_gtid = slave_pos, master_demote_to_slave=1; --source include/start_slave.inc --sync_with_master SELECT * FROM t1 ORDER BY a; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test index f52e51c2..396ea5de 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test @@ -24,7 +24,8 @@ reset slave all; connection server_1; --replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2, - master_user='root', MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1; + master_user='root', master_ssl_verify_server_cert=0, + MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1; source include/start_slave.inc; source include/wait_for_slave_to_start.inc; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4485.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4485.test index 6c37ceaf..7ee811ba 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4485.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4485.test @@ -13,7 +13,7 @@ create table t2 (i int); set default_master_connection = 'm2'; --replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 -eval change master to master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos; +eval change master to master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos; --source include/start_slave.inc --connection server_2 diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test index 7f4d851f..79b3b7d4 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test @@ -59,7 +59,7 @@ SET GLOBAL gtid_slave_pos= '0-2-10'; --connection server_1 --replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2, - master_user= 'root', master_use_gtid=CURRENT_POS; + master_user= 'root', master_ssl_verify_server_cert=0, master_use_gtid=CURRENT_POS; START SLAVE; --connection server_2 diff --git a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test index e140f335..48627a6d 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test @@ -24,8 +24,8 @@ SELECT * FROM t1 ORDER BY a; --connection server_1 --replace_result $SLAVE_MYPORT SLAVE_PORT -eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT, - master_user = 'root'; +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT, master_ssl_verify_server_cert=0, + master_user = 'root', master_ssl_verify_server_cert=0; START SLAVE; --source include/wait_for_slave_to_start.inc @@ -49,7 +49,7 @@ INSERT INTO t1 VALUES (6, 1); --connection server_2 --replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT; +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT, master_ssl_verify_server_cert=0; START SLAVE; --source include/sync_with_master_gtid.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_until_before_after_gtids.test b/mysql-test/suite/rpl/t/rpl_gtid_until_before_after_gtids.test new file mode 100644 index 00000000..cf245ca0 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_gtid_until_before_after_gtids.test @@ -0,0 +1,45 @@ +# +# This test validates the behavior of SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS +# of a slave's START SLAVE UNTIL command. Notably, it tests the following +# scenarios: +# 1. Single domain id in binary log with a single domain id in the UNTIL +# condition +# 2. Multiple domain ids in binary log with a single domain id in the UNTIL +# condition +# 3. Multiple domain ids in binary log with multiple domain ids in the UNTIL +# condition +# 4. A gap in the binary log with the UNTIL condition GTID pointed to the +# missing transaction +# 5. Syntax errors using the new options +# +# +# References: +# MDEV-27247: Add keywords "exclusive" and "inclusive" for START SLAVE UNTIL +# + +--source include/have_innodb.inc +--source include/have_log_bin.inc +--source include/master-slave.inc + +--let $ssu_before_gtids=1 +--source include/rpl_gtid_until_before_after_gtids.test + +--let $ssu_before_gtids=0 +--source include/rpl_gtid_until_before_after_gtids.test + +--echo # +--echo # Error Case 2: Providing both SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS +--echo # should result in a syntax error +--connection slave +--error ER_PARSE_ERROR +START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-1" SQL_BEFORE_GTIDS="0-1-1"; + +--echo # +--echo # Cleanup +--source include/save_master_gtid.inc + +--connection slave +--source include/sync_with_master_gtid.inc + +--source include/rpl_end.inc +--echo # End of rpl_gtid_until_before_gtids.test diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat.test b/mysql-test/suite/rpl/t/rpl_heartbeat.test index 8a852fd3..a34cf761 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat.test @@ -106,7 +106,7 @@ connection slave; set @@global.slave_net_timeout= 10; --replace_result $MASTER_MYPORT MASTER_PORT # no error this time but rather a warning -eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_heartbeat_period= 0.5; +eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_ssl_verify_server_cert=0, master_heartbeat_period= 0.5; --query_vertical show status like 'Slave_heartbeat_period'; start slave; diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test index 2c41fdee..156294ee 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test @@ -49,7 +49,7 @@ let $status_var_comparsion= >; --echo *** Clean up *** --source include/stop_slave.inc CHANGE MASTER TO - MASTER_SSL=0, + MASTER_SSL=1, MASTER_SSL_CA='', MASTER_SSL_CERT='', MASTER_SSL_KEY=''; diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features.test b/mysql-test/suite/rpl/t/rpl_invoked_features.test index cd2b770c..0467a243 100644 --- a/mysql-test/suite/rpl/t/rpl_invoked_features.test +++ b/mysql-test/suite/rpl/t/rpl_invoked_features.test @@ -8,9 +8,8 @@ --source include/have_innodb.inc --source include/master-slave.inc -disable_query_log; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -enable_query_log; +call mtr.add_suppression("Event Scheduler: .* Duplicate entry '10' for key 'a'"); # --disable_warnings/--enable_warnings added before/after query # if one uses UUID() function because we need to avoid warnings @@ -22,60 +21,35 @@ enable_query_log; # Transactional engine --let $engine_type2= innodb - -# -# Clean up -# - -USE test; ---disable_warnings -DROP VIEW IF EXISTS v1,v11; -DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13; -DROP PROCEDURE IF EXISTS p1; -DROP PROCEDURE IF EXISTS p11; -DROP FUNCTION IF EXISTS f1; -DROP FUNCTION IF EXISTS f2; -DROP EVENT IF EXISTS e1; -DROP EVENT IF EXISTS e11; ---enable_warnings - - # # Prepare objects (tables etc) # -# Create tables +--echo # Create tables ---echo eval CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=$engine_type; INSERT INTO t1 VALUES (1,1,'1'); ---disable_warnings +--disable_warnings ONCE INSERT INTO t1 VALUES (2,2,UUID()); ---enable_warnings eval CREATE TABLE t2 (a INT UNIQUE, b INT, c VARCHAR(64)) ENGINE=$engine_type; INSERT INTO t2 VALUES (1,1,'1'); ---disable_warnings +--disable_warnings ONCE INSERT INTO t2 VALUES (2,2,UUID()); ---enable_warnings eval CREATE TABLE t11 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=$engine_type2; INSERT INTO t11 VALUES (1,1,'1'); ---disable_warnings +--disable_warnings ONCE INSERT INTO t11 VALUES (2,2,UUID()); ---enable_warnings eval CREATE TABLE t12 (a INT UNIQUE, b INT, c VARCHAR(64)) ENGINE=$engine_type2; INSERT INTO t12 VALUES (1,1,'1'); ---disable_warnings +--disable_warnings ONCE INSERT INTO t12 VALUES (2,2,UUID()); ---enable_warnings -# Create invoked features ---echo -# Create view for tables t1,t11 +--echo # Create invoked features + CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v11 AS SELECT * FROM t11; -# Create triggers for t1,t11 DELIMITER |; CREATE TRIGGER t1_tr1 BEFORE INSERT ON t1 FOR EACH ROW @@ -102,11 +76,7 @@ BEGIN UPDATE t13 SET c = ''; END| -# Create events which will run every 10 sec -# It cannot be much shorter as we have to ensure that a new -# event is not scheduled before the DISABLE has been -# executed. -CREATE EVENT e1 ON SCHEDULE EVERY 10 SECOND DISABLE DO +CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DISABLE DO BEGIN ALTER EVENT e1 DISABLE; CALL p1(10, ''); @@ -118,7 +88,6 @@ BEGIN CALL p11(10, ''); END| -# Create functions and procedures used for events CREATE FUNCTION f1 (x INT) RETURNS VARCHAR(64) BEGIN IF x > 5 THEN @@ -149,46 +118,39 @@ DELIMITER ;| # Start test case # -# Do some actions for non-transactional tables ---echo +--echo # Do some actions for non-transactional tables CREATE TABLE t3 SELECT * FROM v1; INSERT INTO t1 VALUES (3,3,''); UPDATE t1 SET c='2' WHERE a = 1; ---disable_warnings +--disable_warnings ONCE INSERT INTO t1 VALUES(4,4,f1(4)); ---enable_warnings INSERT INTO t1 VALUES (100,100,''); ---disable_warnings CALL p1(5, UUID()); ---enable_warnings INSERT INTO t1 VALUES (101,101,''); ---disable_warnings +--disable_warnings ONCE INSERT INTO t1 VALUES(6,6,f1(6)); ---enable_warnings INSERT INTO t1 VALUES (102,102,''); ---disable_warnings +--disable_warnings ONCE INSERT INTO t1 VALUES(7,7,f2(7)); ---enable_warnings INSERT INTO t1 VALUES (103,103,''); -# Do some actions for transactional tables ---echo ---disable_warnings +--echo # Do some actions for transactional tables CREATE TABLE t13 SELECT * FROM v11; INSERT INTO t11 VALUES (3,3,''); UPDATE t11 SET c='2' WHERE a = 1; +--disable_warnings ONCE INSERT INTO t11 VALUES(4,4,f1(4)); INSERT INTO t11 VALUES (100,100,''); CALL p11(5, UUID()); INSERT INTO t11 VALUES (101,101,''); +--disable_warnings ONCE INSERT INTO t11 VALUES(6,6,f1(6)); INSERT INTO t11 VALUES (102,102,''); +--disable_warnings ONCE INSERT INTO t11 VALUES(7,7,f2(7)); INSERT INTO t11 VALUES (103,103,''); ---enable_warnings -# Scheduler is on ---echo +--echo # Scheduler is on # Temporally events fire sequentally due Bug#29020. SET GLOBAL EVENT_SCHEDULER = on; # Wait while events will executed @@ -200,8 +162,7 @@ let $wait_condition= SELECT COUNT(*) = 1 FROM t11 WHERE t11.a = 10; --source include/wait_condition.inc SET GLOBAL EVENT_SCHEDULER = off; -# Check original objects ---echo +--echo # Check original objects --sorted_result SHOW TABLES LIKE 't%'; --sorted_result @@ -232,8 +193,7 @@ SELECT a,b FROM v11 ORDER BY a; --sync_slave_with_master slave -# Check replicated objects ---echo +--echo # Check replicated objects --sorted_result SHOW TABLES LIKE 't%'; --sorted_result @@ -245,8 +205,7 @@ SELECT routine_type, routine_name FROM information_schema.routines WHERE routine --sorted_result SELECT event_name, status FROM information_schema.events WHERE event_schema='test'; -# Check replicated data ---echo +--echo # Check replicated data SELECT COUNT(*) FROM t1; SELECT a,b FROM t1 ORDER BY a; SELECT COUNT(*) FROM t2; @@ -262,10 +221,8 @@ SELECT COUNT(*) FROM t13; SELECT a,b FROM t13 ORDER BY a; SELECT a,b FROM v11 ORDER BY a; -# Remove UUID() before comparing and sort tables - --connection master ---echo +--echo # Remove UUID() before comparing and sort tables UPDATE t1 SET c=''; UPDATE t2 SET c=''; UPDATE t3 SET c=''; @@ -280,25 +237,19 @@ ALTER TABLE t13 ORDER BY a; --sync_slave_with_master slave -# Compare a data from master and slave ---echo +--echo # Compare a data from master and slave --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql --diff_files $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql - # # Clean up # -# Remove dumps ---echo --remove_file $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql --remove_file $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql -# Remove tables,views,procedures,functions --connection master ---echo DROP VIEW IF EXISTS v1,v11; DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13; DROP PROCEDURE IF EXISTS p1; diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix.cnf b/mysql-test/suite/rpl/t/rpl_ip_mix.cnf index 00e2637d..195bc57c 100644 --- a/mysql-test/suite/rpl/t/rpl_ip_mix.cnf +++ b/mysql-test/suite/rpl/t/rpl_ip_mix.cnf @@ -1,6 +1,5 @@ # Use default setting for mysqld processes -!include include/default_mysqld.cnf -!include include/default_client.cnf +!include include/default_my.cnf [mysqld.1] diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2.cnf b/mysql-test/suite/rpl/t/rpl_ip_mix2.cnf index 306df437..5a247cbe 100644 --- a/mysql-test/suite/rpl/t/rpl_ip_mix2.cnf +++ b/mysql-test/suite/rpl/t/rpl_ip_mix2.cnf @@ -1,6 +1,5 @@ # Use default setting for mysqld processes -!include include/default_mysqld.cnf -!include include/default_client.cnf +!include include/default_my.cnf [mysqld.1] diff --git a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf index b646a408..ce31d05f 100644 --- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf +++ b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf @@ -1,6 +1,5 @@ # Use default setting for mysqld processes -!include include/default_mysqld.cnf -!include include/default_client.cnf +!include include/default_my.cnf [mysqld.1] diff --git a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test index d17b32c3..2988cac9 100644 --- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test +++ b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test @@ -60,4 +60,4 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host # clean up -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0; diff --git a/mysql-test/suite/rpl/t/rpl_ipv6.cnf b/mysql-test/suite/rpl/t/rpl_ipv6.cnf index 6bf97a94..52b2a80a 100644 --- a/mysql-test/suite/rpl/t/rpl_ipv6.cnf +++ b/mysql-test/suite/rpl/t/rpl_ipv6.cnf @@ -1,6 +1,5 @@ # Use default setting for mysqld processes -!include include/default_mysqld.cnf -!include include/default_client.cnf +!include include/default_my.cnf [mysqld.1] diff --git a/mysql-test/suite/rpl/t/rpl_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv6.test index f3795832..c68255a1 100644 --- a/mysql-test/suite/rpl/t/rpl_ipv6.test +++ b/mysql-test/suite/rpl/t/rpl_ipv6.test @@ -46,4 +46,4 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1); --echo Master-Host: $master_host # clean up -CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root'; +CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0; diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt b/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt index d4ba386a..5cbc1f9d 100644 --- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt +++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt @@ -1 +1 @@ ---loose-debug=d,pretend_version_50034_in_binlog +--loose-debug-dbug=d,pretend_version_50034_in_binlog diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt index 9c846c79..39a1271c 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt @@ -1 +1 @@ ---loose-debug=+d,LOAD_DATA_INFILE_has_fatal_error +--loose-debug-dbug=+d,LOAD_DATA_INFILE_has_fatal_error diff --git a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test index 7e313b37..c3a7055d 100644 --- a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test +++ b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test @@ -28,7 +28,6 @@ CHANGE MASTER TO MASTER_USE_GTID=NO; --let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKE '%Master has sent all binlog to slave%' and command='Binlog Dump' --source include/wait_condition.inc - --connection slave --source include/stop_slave.inc --echo # Test slave with no capability gets dummy event, which is ignored. diff --git a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test index 437d8412..e815502d 100644 --- a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test +++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test @@ -34,7 +34,7 @@ select master_pos_wait('foo', 98); --source include/stop_slave.inc reset slave all; --replace_result $MASTER_MYPORT MASTER_MYPORT -eval change master 'my_slave' to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root'; +eval change master 'my_slave' to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0; set default_master_connection = 'my_slave'; --source include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_mdev33798.test b/mysql-test/suite/rpl/t/rpl_mdev33798.test index 1448ed91..76d2de26 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev33798.test +++ b/mysql-test/suite/rpl/t/rpl_mdev33798.test @@ -101,7 +101,7 @@ SELECT a, ( --connection server_2 --source include/stop_slave.inc --replace_result $SERVER_MYPORT_3 MYPORT_3 -eval CHANGE MASTER 'm2' to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos; +eval CHANGE MASTER 'm2' to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos, master_ssl_verify_server_cert=0; --connection server_1 diff --git a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test index f44c883e..dab2e3f6 100644 --- a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test +++ b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test @@ -55,7 +55,7 @@ connection master; --exec $MYSQL_UPGRADE --skip-verbose --write-binlog --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1 let $datadir= `select @@datadir`; -remove_file $datadir/mysql_upgrade_info; +remove_file $datadir/mariadb_upgrade_info; connection master; let $after_file= query_get_value(SHOW MASTER STATUS, File, 1); diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test index 09da8c2d..2cf18cd2 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test @@ -272,7 +272,7 @@ eval SELECT IF($retry1=$retry2, "Ok, no retry", SET @old_format= @@GLOBAL.binlog_format; # Use MIXED format; we cannot binlog ROW events on slave in STATEMENT format. SET GLOBAL binlog_format= MIXED; -SET @old_isolation= @@GLOBAL.tx_isolation; +SET @old_isolation= @@GLOBAL.transaction_isolation; SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED; # Reset the worker threads to make the new settings take effect. SET GLOBAL slave_parallel_threads=0; @@ -317,7 +317,7 @@ SELECT * FROM t2 ORDER BY a; --source include/stop_slave.inc SET GLOBAL binlog_format= @old_format; -SET GLOBAL tx_isolation= @old_isolation; +SET GLOBAL transaction_isolation= @old_isolation; --source include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test index ee0de499..b8df2ffa 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test @@ -14,7 +14,7 @@ INSERT INTO t2 VALUES (1,0), (2,0); --connection server_2 --sync_with_master -SET @old_isolation= @@GLOBAL.tx_isolation; +SET @old_isolation= @@GLOBAL.transaction_isolation; SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; --source include/stop_slave.inc SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED; @@ -62,7 +62,7 @@ SELECT * FROM t2 ORDER BY a; --connection server_2 --source include/stop_slave.inc -SET GLOBAL tx_isolation= @old_isolation; +SET GLOBAL transaction_isolation= @old_isolation; SET GLOBAL slave_parallel_mode=@old_parallel_mode; SET GLOBAL slave_parallel_threads=@old_parallel_threads; --source include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test index 5ef28a62..72559fc4 100644 --- a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test +++ b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test @@ -52,7 +52,7 @@ set @save_slave_parallel_workers= @@global.slave_parallel_workers; # to avoid warnings set @save_slave_transaction_retries= @@global.slave_transaction_retries; RESET SLAVE ALL; -evalp CHANGE MASTER 'slave1' TO MASTER_USER='root',MASTER_PORT=$MASTER_MYPORT, MASTER_HOST='127.0.0.1', MASTER_USE_GTID=slave_pos; +evalp CHANGE MASTER 'slave1' TO MASTER_USER='root',MASTER_PORT=$MASTER_MYPORT, MASTER_HOST='127.0.0.1', MASTER_USE_GTID=slave_pos, MASTER_SSL_VERIFY_SERVER_CERT=0; SET default_master_connection='slave1'; SET @@global.slave_parallel_workers=1; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; diff --git a/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test b/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test index 7b2bf8d5..e2b974c1 100644 --- a/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test +++ b/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test @@ -161,7 +161,6 @@ grant replication slave on *.* to replssl@localhost require ssl; # Setup slave to use SSL for connection to master --source include/stop_slave.inc replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR; -replace_column 2 ####; eval change master to master_user= 'replssl', master_password= '', @@ -232,7 +231,7 @@ CHANGE MASTER TO master_ssl_cert= '', master_ssl_key= '', master_ssl_verify_server_cert=0, - master_ssl=0, + master_ssl=1, master_use_gtid=no; --source include/start_slave.inc @@ -244,7 +243,6 @@ CHANGE MASTER TO --echo # 1) Test for MASTER_USE_GTID=NO --echo --source include/stop_slave.inc -replace_column 2 ####; change master to master_user = 'root', master_use_gtid = NO; @@ -258,7 +256,6 @@ source include/assert.inc; --echo --echo # 2) Test for Auto_position= CURRENT_POS. --echo -replace_column 2 ####; change master to master_user = 'root', master_use_gtid= CURRENT_POS; @@ -272,7 +269,6 @@ source include/assert.inc; --echo --echo # 3) Test for Auto_position= SLAVE_POS --echo -replace_column 2 ####; change master to master_user = 'root', master_use_gtid= SLAVE_POS; diff --git a/mysql-test/suite/rpl/t/rpl_rewrite_db_sys_vars.test b/mysql-test/suite/rpl/t/rpl_rewrite_db_sys_vars.test index fab78a92..1b2d2be1 100644 --- a/mysql-test/suite/rpl/t/rpl_rewrite_db_sys_vars.test +++ b/mysql-test/suite/rpl/t/rpl_rewrite_db_sys_vars.test @@ -121,7 +121,7 @@ connection slave; --let $rpl_server_number= 2 --source include/rpl_restart_server.inc --replace_result $MASTER_MYPORT MASTER_MYPORT -eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root'; +eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0; # New value connection slave; diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test index 4dd58931..98016667 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -50,7 +50,7 @@ start slave; eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; reset slave; --replace_result $MASTER_MYPORT MASTER_PORT -eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; +eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_ssl_verify_server_cert=0; connection master; reset master; connection slave; diff --git a/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt b/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt index 3073fa4f..b3f3d539 100644 --- a/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt +++ b/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt @@ -1,2 +1,2 @@ ---loose-debug=d,"old_row_based_repl_4_byte_map_id_master" +--loose-debug-dbug=d,"old_row_based_repl_4_byte_map_id_master" --log-bin-use-v1-row-events=1 diff --git a/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test b/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test index 5b2d99f3..97bbc84f 100644 --- a/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test +++ b/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test @@ -7,7 +7,7 @@ call mtr.add_suppression("Slave IO thread did not receive an expected Rows-log end-of-statement"); call mtr.add_suppression("Relay log write failure: could not queue event from master"); -SET @save_debug= @@global.debug; +SET @save_debug= @@global.debug_dbug; SET GLOBAL debug_dbug="+d,simulate_stmt_end_rows_event_loss"; --source include/stop_slave.inc --replace_result $MASTER_MYPORT MASTER_PORT diff --git a/mysql-test/suite/rpl/t/rpl_row_img.cnf b/mysql-test/suite/rpl/t/rpl_row_img.cnf index ed9a4292..62b5c99c 100644 --- a/mysql-test/suite/rpl/t/rpl_row_img.cnf +++ b/mysql-test/suite/rpl/t/rpl_row_img.cnf @@ -1,4 +1,4 @@ -!include include/default_mysqld.cnf +!include include/default_my.cnf [mysqld.1] log-slave-updates diff --git a/mysql-test/suite/rpl/t/rpl_row_img_blobs.test b/mysql-test/suite/rpl/t/rpl_row_img_blobs.test index 21f224f5..a4f26fda 100644 --- a/mysql-test/suite/rpl/t/rpl_row_img_blobs.test +++ b/mysql-test/suite/rpl/t/rpl_row_img_blobs.test @@ -47,6 +47,14 @@ -- let $row_img_test_script= include/rpl_row_img_blobs.test -- source include/rpl_row_img_general_loop.inc +## FULL_NODUP + +-- let $row_img_set=server_1:FULL_NODUP:N,server_2:FULL_NODUP:Y,server_3:FULL_NODUP:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= include/rpl_row_img_blobs.test +-- source include/rpl_row_img_general_loop.inc + ## FULL -- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.cnf b/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.cnf new file mode 100644 index 00000000..d758d29f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.cnf @@ -0,0 +1 @@ +!include suite/rpl/t/rpl_row_img.cnf diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.test b/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.test new file mode 100644 index 00000000..f4a53a38 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.test @@ -0,0 +1,67 @@ +#Want to skip this test from daily Valgrind execution +--source include/no_valgrind_without_big.inc +# +# This file contains tests for FULL_NODUP row image mode +# + +--let $rpl_topology= 1->2->3 +--source include/rpl_init.inc +-- source include/have_binlog_format_row.inc + +-- connection server_1 +-- source include/have_innodb.inc +-- connection server_2 +-- source include/have_innodb.inc +-- connection server_3 +-- source include/have_innodb.inc +-- connection server_1 + +# Tests for different storage engines on each server, +# but same index structure on tables. The tests are conducted +# using FULL_NODUP binlog-row-image on all servers. +# + +-- let $row_img_set=server_1:FULL_NODUP:N,server_2:FULL_NODUP:Y,server_3:FULL_NODUP:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= include/rpl_row_img.test +-- source include/rpl_row_img_general_loop.inc + +################################################################################ +# MDEV-33049 Assertion `marked_for_write_or_computed()' failed in bool +# Field_new_decimal::store_value(const my_decimal*, int*) +# +# In FULL_NODUP mode, the before image has all fields and the after image has +# only updated fields. Crash happened when slave was unpacking a row event +# if the new decimal field is null in the before image. +################################################################################ +CREATE TABLE t1(c1 INT NOT NULL PRIMARY KEY, c2 varchar(10) DEFAULT NULL, + c3 decimal(12,4) DEFAULT NULL); +INSERT INTO t1(c1) VALUES (1); +--source include/save_master_pos.inc +--let $datadir= `SELECT @@datadir` + +# It will generate a row event that c3 is only in before image and it is null. +UPDATE t1 SET c2 = 'c2'; + +# the UPDATE will crash the slave without this fix. +--source include/rpl_sync.inc + +FLUSH BINARY LOGS; +UPDATE t1 SET c2 = "c2_new"; + +--echo # Use 'BINLOG' statement to apply the first update row event +--echo # BINLOG statement is same to slave applier, it should work well. +--exec $MYSQL_BINLOG --start-position=$_master_pos $datadir$_master_file > $MYSQLTEST_VARDIR/tmp/binlog.sql +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/binlog.sql + +--echo # After 'BINLOG' statement c2's value should be "c2" +SELECT * FROM t1; + +--remove_file $MYSQLTEST_VARDIR/tmp/binlog.sql +DROP TABLE t1; + +-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +-- source include/rpl_row_img_set.inc + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.cnf b/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.cnf new file mode 100644 index 00000000..d758d29f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.cnf @@ -0,0 +1 @@ +!include suite/rpl/t/rpl_row_img.cnf diff --git a/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.test b/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.test new file mode 100644 index 00000000..12ec91bf --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.test @@ -0,0 +1,34 @@ +#Want to skip this test from daily Valgrind execution +--source include/no_valgrind_without_big.inc +# +# This file contains tests for FULL_NODUP row image mode +# + +--let $rpl_topology= 1->2->3 +--source include/rpl_init.inc +-- source include/have_binlog_format_row.inc + +-- connection server_1 +-- source include/have_innodb.inc +-- connection server_2 +-- source include/have_innodb.inc +-- connection server_3 +-- source include/have_innodb.inc +-- connection server_1 + +# Tests for different storage engines on each server, +# but same index structure on tables. The tests are conducted +# using FULL_NODUP binlog-row-image on all servers. +# + +-- let $row_img_set=server_1:FULL_NODUP:N,server_2:FULL_NODUP:Y,server_3:FULL_NODUP:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= include/rpl_row_img.test +-- source include/rpl_row_img_general_loop.inc + +-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +-- source include/rpl_row_img_set.inc + + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf index 7104b4e4..7d48e441 100644 --- a/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf @@ -1,4 +1,4 @@ -!include include/default_mysqld.cnf +!include include/default_my.cnf [mysqld.1] log-slave-updates diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.cnf new file mode 100644 index 00000000..7d48e441 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.cnf @@ -0,0 +1,21 @@ +!include include/default_my.cnf + +[mysqld.1] +log-slave-updates +innodb +gtid_domain_id=0 + +[mysqld.2] +log-slave-updates +innodb +gtid_domain_id=1 + +[mysqld.3] +log-slave-updates +innodb +gtid_domain_id=2 + +[ENV] +SERVER_MYPORT_1= @mysqld.1.port +SERVER_MYPORT_2= @mysqld.2.port +SERVER_MYPORT_3= @mysqld.3.port diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.test b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.test new file mode 100644 index 00000000..cc3c7df0 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.test @@ -0,0 +1,51 @@ +# +# Purpose: +# The rpl_row_img_sequence group of tests verify that sequence MDL updates, +# i.e. NEXTVAL and SETVAL, respect the binlog_row_image variable value when +# written into the binary log. In particular, it ensures that only changed +# columns are written with MINIMAL image mode, and all columns are written +# otherwise. This test focuses on validating the behavior of +# binlog_row_img=FULL_NODUP. +# +# Methodology +# After issuing a sequence update, ensure that both 1) it was replicated +# correctly, and 2) it was binlogged respective to the binlog_row_image value. +# The sequence table does not use caching to ensure each update is immediately +# binlogged. Each command is binlogged into its own unique log file, and the +# entirety of the file is analyzed for correctness of its sequence event. +# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns +# which belong to the event, and the columns are analyzed to ensure the correct +# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple +# chained replicas, varying engines between InnoDB and MyISAM. +# +# References: +# MDEV-28487: sequences not respect value of binlog_row_image with select +# nextval(seq_gen) +# + +--let $rpl_topology= 1->2->3 +--source include/rpl_init.inc +--source include/have_binlog_format_row.inc + +--connection server_1 +--source include/have_innodb.inc +--connection server_2 +--source include/have_innodb.inc +--connection server_3 +--source include/have_innodb.inc +--connection server_1 + +--echo # +--echo # binlog_row_image=FULL_NODUP should write all columns to the binary log +--echo # +--let $row_img_set=server_1:FULL_NODUP:N,server_2:FULL_NODUP:Y,server_3:FULL_NODUP:Y +--source include/rpl_row_img_set.inc +--let $expected_columns=(1,2,3,4,5,6,7,8) +--let row_img_test_script= include/rpl_row_img_sequence.inc +--source include/rpl_row_img_general_loop.inc + +--let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +--source include/rpl_row_img_set.inc + +--source include/rpl_end.inc +--echo # End of tests diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf index 7104b4e4..7d48e441 100644 --- a/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf @@ -1,4 +1,4 @@ -!include include/default_mysqld.cnf +!include include/default_my.cnf [mysqld.1] log-slave-updates diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf index 7104b4e4..7d48e441 100644 --- a/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf @@ -1,4 +1,4 @@ -!include include/default_mysqld.cnf +!include include/default_my.cnf [mysqld.1] log-slave-updates diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.cnf b/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.cnf index e8e03e71..1f7fa7b4 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.cnf +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.cnf @@ -2,9 +2,6 @@ [mysqld.1] log-warnings=9 -rpl_semi_sync_master_enabled=1 -rpl_semi_sync_master_wait_point=AFTER_COMMIT [mysqld.2] log-warnings=9 -rpl_semi_sync_slave_enabled=1 diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.test b/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.test index 65b6e8b4..0567d8a5 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.test @@ -26,15 +26,26 @@ --connection master call mtr.add_suppression("Got an error reading communication packets"); +call mtr.add_suppression("Could not read packet:.* vio_errno: 1158"); +call mtr.add_suppression("Could not write packet:.* vio_errno: 1160"); +set @save_semi_sync_master_enabled= @@global.rpl_semi_sync_master_enabled; +set @save_semi_sync_wp= @@global.rpl_semi_sync_master_wait_point; set @save_bgc_count= @@global.binlog_commit_wait_count; set @save_bgc_usec= @@global.binlog_commit_wait_usec; set @save_debug_dbug= @@global.debug_dbug; set @@global.binlog_commit_wait_count=3; set @@global.binlog_commit_wait_usec=10000000; set @@global.debug_dbug="+d,testing_cond_var_per_thd"; +set @@global.rpl_semi_sync_master_enabled= 1; +set @@global.rpl_semi_sync_master_wait_point= AFTER_COMMIT; --echo # Ensure semi-sync is on --connection slave +set @save_semi_sync_slave_enabled= @@global.rpl_semi_sync_master_enabled; +--source include/stop_slave.inc +set @@global.rpl_semi_sync_slave_enabled=1; +--source include/start_slave.inc + let $status_var= rpl_semi_sync_slave_status; let $status_var_value= ON; source include/wait_for_status_var.inc; @@ -66,12 +77,25 @@ source include/wait_for_status_var.inc; --let $assert_only_after=CURRENT_TEST --source include/assert_grep.inc +--sync_slave_with_master + + --echo # --echo # Cleanup --connection master set @@global.binlog_commit_wait_count=@save_bgc_count; set @@global.binlog_commit_wait_usec=@save_bgc_usec; set @@global.debug_dbug=@save_debug_dbug; +set @@global.rpl_semi_sync_master_enabled= @save_semi_sync_master_enabled; +set @@global.rpl_semi_sync_master_wait_point= @save_semi_sync_wp; + +--connection slave +--source include/stop_slave.inc +set @@global.rpl_semi_sync_slave_enabled= @save_semi_sync_slave_enabled; +--source include/start_slave.inc + +--connection master drop table t1, t2, t3; +--sync_slave_with_master --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_crash.inc b/mysql-test/suite/rpl/t/rpl_semi_sync_crash.inc index bb705d39..1bb5ff9f 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_crash.inc +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_crash.inc @@ -118,7 +118,7 @@ if (`select $server_to_crash = 2`) { --let $master_port=$SERVER_MYPORT_1 } -evalp CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_use_gtid=SLAVE_POS; +evalp CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS; set global rpl_semi_sync_slave_enabled = 1; set @@global.gtid_slave_pos=@@global.gtid_binlog_pos; --source include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test b/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test index 84462ed6..30aeea48 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test @@ -40,7 +40,7 @@ create table t1 (i int); --connection slave set global rpl_semi_sync_slave_enabled = ON; CALL mtr.add_suppression("Semi-sync slave net_flush*"); -SET @save_debug= @@global.debug; +SET @save_debug= @@global.debug_dbug; SET GLOBAL debug_dbug="+d,semislave_failed_net_flush"; --source include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test index c5c1daa4..ba9c5f04 100644 --- a/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test +++ b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test @@ -284,7 +284,7 @@ INSERT INTO t1 VALUES (2); show status like 'Rpl_semi_sync_master_clients'; --echo # Test failure of select error . -SET GLOBAL debug = 'd,rpl_semisync_simulate_select_error'; +SET GLOBAL debug_dbug = 'd,rpl_semisync_simulate_select_error'; # It can still receive ACK from semi-sync slave INSERT INTO t1 VALUES(3); sync_slave_with_master; @@ -292,7 +292,7 @@ sync_slave_with_master; connection con1; --echo # Test failure of pthread_create SET GLOBAL rpl_semi_sync_master_enabled = 0; -SET GLOBAL debug = 'd,rpl_semisync_simulate_create_thread_failure'; +SET GLOBAL debug_dbug = 'd,rpl_semisync_simulate_create_thread_failure'; SET GLOBAL rpl_semi_sync_master_enabled= ON; --let $wait_condition= SELECT @@global.rpl_semi_sync_master_enabled = 0 @@ -300,7 +300,7 @@ SET GLOBAL rpl_semi_sync_master_enabled= ON; # Todo: implement the thread join failure simulation --echo # Test failure of pthread_join -#SET GLOBAL DEBUG = 'd,rpl_semisync_simulate_thread_join_failure'; +#SET GLOBAL DEBUG_DBUG = 'd,rpl_semisync_simulate_thread_join_failure'; #SET GLOBAL rpl_semi_sync_master_enabled= ON; # #--let $wait_condition= SELECT @@global.rpl_semi_sync_master_enabled = 0 @@ -310,7 +310,7 @@ SET GLOBAL rpl_semi_sync_master_enabled= OFF; --echo # --echo # Failure on registering semisync slave --echo # -SET GLOBAL debug= 'd,rpl_semisync_simulate_add_slave_failure'; +SET GLOBAL debug_dbug= 'd,rpl_semisync_simulate_add_slave_failure'; SET GLOBAL rpl_semi_sync_master_enabled= ON; connection slave; @@ -324,7 +324,7 @@ connection con1; # Todo: implement the add_slave_failure simulation. Meanwhile # the status will be 1. # show status like 'Rpl_semi_sync_master_clients'; -SET GLOBAL debug=''; +SET GLOBAL debug_dbug=''; --let $status_var= Rpl_semi_sync_master_clients --let $status_var_value= 1 @@ -423,6 +423,5 @@ SET GLOBAL rpl_semi_sync_master_enabled = 0; DROP TABLE t1; connection slave; SET GLOBAL rpl_semi_sync_slave_enabled = 0; -stop slave;start slave; --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test b/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test index d30da61b..e121e7ba 100644 --- a/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test +++ b/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test @@ -22,7 +22,9 @@ eval SET STATEMENT default_master_connection = 'm1' FOR RESET SLAVE ALL; --replace_result $MASTER_MYPORT MASTER_MYPORT -eval CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root'; +eval CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', + MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', + MASTER_SSL_VERIFY_SERVER_CERT=0; SET STATEMENT default_master_connection = 'm1' FOR START SLAVE; set default_master_connection = 'm1'; diff --git a/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test index 84c5c215..afac2984 100644 --- a/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test +++ b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test @@ -15,7 +15,7 @@ connect (slave2,127.0.0.1,root,,test,$SLAVE_MYPORT2,); connection slave2; RESET SLAVE; --replace_result $MASTER_MYPORT MASTER_PORT ---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root' +--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root', master_ssl_verify_server_cert=0 START SLAVE IO_THREAD; source include/wait_for_slave_io_to_start.inc; diff --git a/mysql-test/suite/rpl/t/rpl_skip_incident-master.opt b/mysql-test/suite/rpl/t/rpl_skip_incident-master.opt index 912801de..4e746bf1 100644 --- a/mysql-test/suite/rpl/t/rpl_skip_incident-master.opt +++ b/mysql-test/suite/rpl/t/rpl_skip_incident-master.opt @@ -1 +1 @@ ---loose-debug=+d,incident_database_resync_on_replace +--loose-debug-dbug=+d,incident_database_resync_on_replace diff --git a/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test b/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test index 6f73de98..1179d7bf 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test +++ b/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test @@ -23,7 +23,7 @@ set default_master_connection = ''; set default_master_connection = 'm2'; --replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 -eval change master to master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos; +eval change master to master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos; --source include/start_slave.inc select @@global.slave_parallel_workers as two; diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test index 0420a6c8..ad9a191d 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_ssl.test @@ -106,7 +106,7 @@ sync_slave_with_master; --source include/stop_slave.inc CHANGE MASTER TO master_user = 'root', - master_ssl = 0, + master_ssl = 1, master_ssl_ca = '', master_ssl_cert = '', master_ssl_key = ''; diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test index 04f6cfff..0caaae25 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl1.test +++ b/mysql-test/suite/rpl/t/rpl_ssl1.test @@ -16,7 +16,7 @@ sync_slave_with_master; #trying to use this user without ssl stop slave; --source include/wait_for_slave_to_stop.inc -change master to master_user='replssl',master_password=''; +change master to master_user='replssl',master_password='',master_ssl=0; start slave; #showing that replication don't work @@ -34,7 +34,11 @@ select * from t1; --source include/stop_slave_sql.inc --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval change master to master_ssl=1 , master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem'; +eval change master to + master_ssl=1, + master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', + master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', + master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem'; start slave; --source include/wait_for_slave_to_start.inc @@ -85,28 +89,53 @@ create table t1 (t int); insert into t1 values (1); sync_slave_with_master; - -echo on slave; -#checking that replication is ok select * from t1; #checking show slave status source include/show_slave_status.inc; --source include/check_slave_is_running.inc -# ==== Clean up ==== +# MDEV-31855 validate with master_password +connection master; +create user replssl@127.0.0.1 identified by "sslrepl"; +grant replication slave on *.* to replssl@127.0.0.1 require ssl; +connection slave; +stop slave; +--source include/wait_for_slave_to_stop.inc +eval change master to + master_host="127.0.0.1", + master_user='replssl', + master_password="sslrepl", + master_ssl=1, + master_ssl_verify_server_cert=1, + master_ssl_ca ='', + master_ssl_cert='', + master_ssl_key=''; +start slave; +--source include/wait_for_slave_to_start.inc + +show tables; connection master; drop table t1; sync_slave_with_master; +show tables; + +# ==== Clean up ==== --source include/stop_slave.inc CHANGE MASTER TO master_host="127.0.0.1", + master_user='root', + master_password='', master_ssl_ca ='', master_ssl_cert='', master_ssl_key='', master_ssl_verify_server_cert=0, - master_ssl=0; + master_ssl=1; +connection master; +drop user replssl@127.0.0.1; +connection slave; +drop user replssl@127.0.0.1; --let $rpl_only_running_threads= 1 --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_7.test b/mysql-test/suite/rpl/t/rpl_start_alter_7.test index 21c21c85..0e72b43e 100644 --- a/mysql-test/suite/rpl/t/rpl_start_alter_7.test +++ b/mysql-test/suite/rpl/t/rpl_start_alter_7.test @@ -36,9 +36,9 @@ set global gtid_strict_mode=1; --disable_warnings --disable_query_log --replace_result $SERVER_MYPORT_1 MYPORT_1 -eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos; +eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos; --replace_result $SERVER_MYPORT_2 MYPORT_2 -eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos; +eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos; --enable_query_log --enable_warnings diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_8.test b/mysql-test/suite/rpl/t/rpl_start_alter_8.test index c8c5ac74..ac7abca2 100644 --- a/mysql-test/suite/rpl/t/rpl_start_alter_8.test +++ b/mysql-test/suite/rpl/t/rpl_start_alter_8.test @@ -35,9 +35,9 @@ set global gtid_strict_mode=1; --disable_warnings --disable_query_log --replace_result $SERVER_MYPORT_1 MYPORT_1 -eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos; +eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos; --replace_result $SERVER_MYPORT_2 MYPORT_2 -eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos; +eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos; --enable_query_log --enable_warnings diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test index 9d9675c6..1cbc5b67 100644 --- a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test +++ b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test @@ -71,9 +71,9 @@ SET GLOBAL gtid_strict_mode=1; --disable_warnings --disable_query_log --replace_result $SERVER_MYPORT_1 MYPORT_1 -eval CHANGE MASTER 'm1' TO MASTER_PORT=$SERVER_MYPORT_1, MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_USE_GTID=slave_pos; +eval CHANGE MASTER 'm1' TO MASTER_PORT=$SERVER_MYPORT_1, MASTER_HOST='127.0.0.1', MASTER_USER='root', master_ssl_verify_server_cert=0, MASTER_USE_GTID=slave_pos; --replace_result $SERVER_MYPORT_2 MYPORT_2 -eval CHANGE MASTER 'm2' TO MASTER_PORT=$SERVER_MYPORT_2, MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_USE_GTID=slave_pos; +eval CHANGE MASTER 'm2' TO MASTER_PORT=$SERVER_MYPORT_2, MASTER_HOST='127.0.0.1', MASTER_USER='root', master_ssl_verify_server_cert=0, MASTER_USE_GTID=slave_pos; --enable_query_log --enable_warnings diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test b/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test index aac3af6f..959af0ef 100644 --- a/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test +++ b/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test @@ -15,7 +15,7 @@ CHANGE MASTER TO MASTER_USE_GTID=NO; --source include/start_slave.inc --connection slave -SET @old_debug_slave= @@global.debug; +SET @old_debug_slave= @@global.debug_dbug; stop slave; --let $gtid_strict_mode= `select @@gtid_strict_mode` --let $slave_parallel_threads= `select @@slave_parallel_threads` @@ -28,7 +28,7 @@ start slave; --connection master call mtr.add_suppression("ALTER query started at .+ could not be completed"); -SET @old_debug_master= @@global.debug; +SET @old_debug_master= @@global.debug_dbug; --let $binlog_alter_two_phase= `select @@binlog_alter_two_phase` set binlog_alter_two_phase=true; create table t3( a int primary key, b int) engine=innodb; diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test b/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test index 5dcb0bf8..43586fdd 100644 --- a/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test +++ b/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test @@ -6,11 +6,11 @@ # --source include/have_log_bin.inc --source include/have_innodb.inc ---source include/master-slave.inc --source include/have_debug.inc +--source include/master-slave.inc --connection slave -SET @old_debug_slave= @@global.debug; +SET @old_debug_slave= @@global.debug_dbug; --source include/stop_slave.inc --let $gtid_strict_mode= `select @@gtid_strict_mode` --let $slave_parallel_threads= `select @@slave_parallel_threads` @@ -25,7 +25,7 @@ set global debug_dbug="+d,rpl_slave_stop_CA_before_binlog"; # # SLAVE Shutdown --connection master -SET @old_debug_master= @@global.debug; +SET @old_debug_master= @@global.debug_dbug; set global debug_dbug="+d,start_alter_delay_master"; --let $binlog_alter_two_phase= `select @@binlog_alter_two_phase` set global binlog_alter_two_phase=true; @@ -116,10 +116,10 @@ SET GLOBAL debug_dbug= @old_debug_master; set DEBUG_SYNC= 'RESET'; --sync_slave_with_master -stop slave; +--source include/stop_slave.inc --eval set global slave_parallel_threads = $slave_parallel_threads; --eval set global slave_parallel_mode = $slave_parallel_mode; --eval set global gtid_strict_mode = $gtid_strict_mode; set DEBUG_SYNC= 'RESET'; -start slave; +--source include/start_slave.inc --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test b/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test index fb0e3cf4..dc904166 100644 --- a/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test +++ b/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test @@ -155,7 +155,7 @@ INSERT INTO t1 VALUES (6); --connection slave # Fix the port after we replaced master.info. --replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 -eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, MASTER_SSL=1; --source include/start_slave.inc --source include/sync_with_master_gtid.inc SELECT * FROM t1 ORDER BY a; diff --git a/mysql-test/suite/rpl/t/rpl_xa.inc b/mysql-test/suite/rpl/t/rpl_xa.inc index d22d2d2e..30e7a4bb 100644 --- a/mysql-test/suite/rpl/t/rpl_xa.inc +++ b/mysql-test/suite/rpl/t/rpl_xa.inc @@ -363,7 +363,7 @@ sync_slave_with_master; # set a strong isolation level to keep the read view below. # alternatively a long-running select can do that too even in read-committed -set session tx_isolation='repeatable-read'; +set session transaction_isolation='repeatable-read'; start transaction; # opens a read view to disable purge on the slave select * from t1; diff --git a/mysql-test/suite/rpl/t/rpl_xa_empty_transaction.cnf b/mysql-test/suite/rpl/t/rpl_xa_empty_transaction.cnf index 92acd0c7..261852a4 100644 --- a/mysql-test/suite/rpl/t/rpl_xa_empty_transaction.cnf +++ b/mysql-test/suite/rpl/t/rpl_xa_empty_transaction.cnf @@ -1,4 +1,4 @@ -!include include/default_mysqld.cnf +!include include/default_my.cnf [mysqld.1] log-slave-updates diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test index 815b2537..a350d093 100644 --- a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test +++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test @@ -22,7 +22,7 @@ call mtr.add_suppression("Could not read packet:.* errno: 11"); # aborted by the master due to conflicting server_id from multiple connections. --let $rpl_allow_error= 1 --source include/wait_for_slave_to_stop.inc -start slave; +--source include/start_slave.inc --connection master --source include/rpl_end.inc |