diff options
author | Monty <monty@mariadb.org> | 2015-07-09 14:47:32 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-07-09 14:47:32 +0300 |
commit | 9bb8b74e99adced1ccb38ced24a96cf2d1040f39 (patch) | |
tree | c58f67cd054fa8829ca11d275f86db7691031eb2 /mysql-test | |
parent | a6c801438717b815288acb72513f5e42fe736b7b (diff) | |
parent | 77803703431d79f5dcc2b23b3f878dfdbaf01c2b (diff) | |
download | mariadb-git-9bb8b74e99adced1ccb38ced24a96cf2d1040f39.tar.gz |
Merge branch '10.1' of github.com:MariaDB/server into 10.1
Conflicts:
sql/item_subselect.cc
Fixed also typo in comment
Diffstat (limited to 'mysql-test')
68 files changed, 14054 insertions, 65 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_row_img.test b/mysql-test/extra/rpl_tests/rpl_row_img.test new file mode 100644 index 00000000000..b905b81c4c6 --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_row_img.test @@ -0,0 +1,241 @@ +# WL#5096 +# +# Description +# =========== +# +# This test case checks replication between hosts with same index +# structure but may differ on engines. +# +# Usage +# ===== +# +# Before including this file the following variables should be set: +# * $server_1_engine +# * $server_2_engine +# * $server_3_engine +# +# Example: +# +# -- let $server_1_engine= Falcon +# -- let $server_2_engine= MyISAM +# -- let $server_3_engine= InnoDB +# +# -- source extra/rpl_tests/rpl_row_img.test +# + +-- connection server_1 + +-- let $diff_table=test.t + +let $i= 12; +while($i) +{ + let $step= ""; + + -- connection server_1 + SET SQL_LOG_BIN=0; + + -- connection server_2 + SET SQL_LOG_BIN=0; + + -- connection server_3 + SET SQL_LOG_BIN=0; + + if ($i == 1) { + let $step= No keys; + --echo ******* TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $server_3_engine; + + } + if ($i == 2) + { + let $step= One key; + --echo ******* TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $server_3_engine; + + } + if ($i == 3) + { + let $step= One Composite key; + --echo ****** TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $server_3_engine; + } + if ($i == 4) + { + let $step= One Unique key; + --echo ****** TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $server_3_engine; + + } + if ($i == 5) + { + let $step= One Composite Unique key; + --echo ****** TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $server_3_engine; + + } + if ($i == 6) + { + let $step= One Primary key; + --echo ****** TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $server_3_engine; + } + if ($i == 7) + { + let $step= One Composite Primary Key; + --echo ****** TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $server_3_engine; + } + if ($i == 8) + { + let $step= One Composite key with holes; + --echo ****** TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $server_3_engine; + } + if ($i == 9) + { + let $step= One Composite Unique key with holes; + --echo ****** TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_3_engine; + } + if ($i == 10) + { + let $step= One Composite Primary Key with holes; + --echo ****** TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $server_3_engine; + } + if ($i == 11) + { + let $step= One Composite NOT NULL Unique key with holes; + --echo ****** TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_3_engine; + } + if ($i == 12) + { + let $step= One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave; + --echo ****** TEST: $step + -- connection server_1 + --eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= $server_3_engine; + } + + -- connection server_1 + SET SQL_LOG_BIN=1; + + -- 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' ); + + -- source 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'; + + -- source include/rpl_sync.inc + + -- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table + -- source include/diff_tables.inc + + + -- connection server_1 + + DELETE FROM t WHERE c1 = 7; + DELETE FROM t WHERE c1 = 8; + DELETE FROM t; + + -- source include/rpl_sync.inc + + -- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table + -- source include/diff_tables.inc + + -- connection server_1 + + DROP TABLE t; + + -- source include/rpl_sync.inc + + dec $i; +} diff --git a/mysql-test/extra/rpl_tests/rpl_row_img_blobs.test b/mysql-test/extra/rpl_tests/rpl_row_img_blobs.test new file mode 100644 index 00000000000..9d3a0a593e3 --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_row_img_blobs.test @@ -0,0 +1,179 @@ +# WL#5096 +# +# Description +# =========== +# +# This test case covers Requirements for replication using different +# combinations of indexes and blob fields. +# +# It acts as a complement for rpl_row_img_sanity tests as it checks +# that in a chained replication scenario, replication does not break. +# +# Usage +# ===== +# +# Before including this file the following variables should be set: +# * $server_1_engine +# * $server_2_engine +# * $server_3_engine +# +# Example: +# +# -- let $server_1_engine= Falcon +# -- let $server_2_engine= MyISAM +# -- let $server_3_engine= InnoDB +# +# -- source extra/rpl_tests/rpl_row_img_blobs.test +# + +-- connection server_1 + +-- let $diff_table=test.t +let $i= 7; +while($i) +{ + -- connection server_1 + SET SQL_LOG_BIN=0; + + -- connection server_2 + SET SQL_LOG_BIN=0; + + -- connection server_3 + SET SQL_LOG_BIN=0; + + # + # The comments below (on create table) must be read with the SQL + # instructions issued later in mind. Declaring a table obviously is + # not enough to assert anything. + # + # Also, the tests in this file make more sense when performed with + # binlog_row_image configured as NOBLOB. + # + + if ($i == 1) { + -- echo ### Asserts that declaring a blob as part of a primary key does not break replication + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= $server_3_engine; + } + if ($i == 2) + { + -- echo ### Asserts that declaring a blob as part of a unique (not null) key does not break replication + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= $server_3_engine; + } + if ($i == 3) + { + -- echo ### Asserts that declaring a blob in a key does not break replication + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= $server_3_engine; + + } + if ($i == 4) { + -- echo ### Asserts that updates without blobs in the BI (PK exists int the table) + -- echo ### will not break replication + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= $server_3_engine; + + } + if ($i == 5) + { + -- echo ### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) + -- echo ### will not break replication + -- connection server_1 + --eval CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= $server_3_engine; + + } + if ($i == 6) + { + -- echo ### Asserts that updates without blobs in the AI (they are not updated) + -- echo ### will not break replication (check even if there is a key in the table) + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= $server_3_engine; + + } + if ($i == 7) + { + -- echo ### Asserts that updates without blobs in the AI (they are not updated) + -- echo ### will not break replication (check when there is no key in the table) + -- connection server_1 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int) engine= $server_1_engine; + -- connection server_2 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int) engine= $server_2_engine; + -- connection server_3 + --eval CREATE TABLE t (c1 int, c2 blob, c3 int) engine= $server_3_engine; + } + + -- connection server_1 + SET SQL_LOG_BIN=1; + + -- connection server_2 + SET SQL_LOG_BIN=1; + + -- connection server_3 + SET SQL_LOG_BIN=1; + + -- connection server_1 + + -- let $blob1= "a" + -- let $blob2= "b" + -- let $blob3= "c" + + -- eval INSERT INTO t VALUES (1, $blob1, 10) + -- eval INSERT INTO t VALUES (2, $blob2, 20) + -- eval INSERT INTO t VALUES (3, $blob3, 30) + + -- source include/rpl_sync.inc + + -- connection server_1 + -- eval UPDATE t SET c1=10 WHERE c2=$blob1 + -- eval UPDATE t SET c1=20 WHERE c1=2 + -- eval UPDATE t SET c1=30 WHERE c3=30 + -- eval UPDATE t SET c3=40 WHERE c1=30 + + -- source include/rpl_sync.inc + + -- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table + -- source include/diff_tables.inc + + -- connection server_1 + -- eval DELETE FROM t WHERE c2=$blob1 + -- eval DELETE FROM t WHERE c1=20 + -- eval DELETE FROM t + + -- source include/rpl_sync.inc + + -- let $diff_tables= server_1:$diff_table, server_2:$diff_table, server_3:$diff_table + -- source include/diff_tables.inc + + -- connection server_1 + + DROP TABLE t; + + -- source include/rpl_sync.inc + + dec $i; +} diff --git a/mysql-test/include/ctype_utf8mb4.inc b/mysql-test/include/ctype_utf8mb4.inc index 1971cc0c9a1..152316e6158 100644 --- a/mysql-test/include/ctype_utf8mb4.inc +++ b/mysql-test/include/ctype_utf8mb4.inc @@ -1802,5 +1802,33 @@ DROP TABLE t1; --echo # --echo # ---echo # End of tests +--echo # ctype_utf8mb4.inc: Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" +--echo # +CREATE TABLE t1 ( + id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id) +); +INSERT INTO t1 (a) VALUES (0x61); +INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF); +INSERT INTO t1 (a) VALUES (0xE0A080),(0xEFBFBF); +INSERT INTO t1 (a) VALUES (0xF0908080),(0xF48FBFBF); +SELECT id,HEX(a) FROM t1 ORDER BY a,id; +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +SELECT COUNT(DISTINCT a) FROM t1; +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; +SELECT id,HEX(a) FROM t1 ORDER BY a; +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +SELECT COUNT(DISTINCT a) FROM t1; +DROP TABLE t1; + +--echo # +--echo # ctype_utf8mb4.inc: End of 10.1 tests +--echo # + +--echo # +--echo # End of ctype_utf8mb4.inc --echo # diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc index 7c9feea55c2..6807d6eb1bd 100644 --- a/mysql-test/include/icp_tests.inc +++ b/mysql-test/include/icp_tests.inc @@ -639,6 +639,16 @@ SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 WHERE t2.pk <> t1.d1 AND t2.pk = 4; +# MDEV-8189 field<>const and const<>field are not symmetric +# Do the same EXPLAIN and SELECT +# with "t1.d1 <> t2.pk" instead of "t2.pk <> t1.d1" + +EXPLAIN +SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 + WHERE t1.d1 <> t2.pk AND t2.pk = 4; +SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 + WHERE t1.d1 <> t2.pk AND t2.pk = 4; + DROP TABLE t1, t2; --echo # diff --git a/mysql-test/include/rpl_row_img_general_loop.inc b/mysql-test/include/rpl_row_img_general_loop.inc new file mode 100644 index 00000000000..3c7749e5135 --- /dev/null +++ b/mysql-test/include/rpl_row_img_general_loop.inc @@ -0,0 +1,42 @@ +# +# This is a helper script for rpl_row_img.test. It creates +# all combinations MyISAM / InnoDB in a three server replication +# chain. Each engine combination is tested against the current +# seetings for binlog_row_image (on each server). +# +# The test script that is executed on every combination is the +# only argument to this wrapper script. See below. +# +# This script takes one parameter: +# - $row_img_test_script +# the name of the test script to include in every combination +# +# Sample usage: +# -- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test +# -- source include/rpl_row_img_general_loop.test + + +-- let $engine_type_a= 2 +-- let $server_1_engine= MyISAM +while($engine_type_a) +{ + -- let $engine_type_b= 2 + -- let $server_2_engine= MyISAM + while($engine_type_b) + { + -- let $engine_type_c= 2 + -- let $server_3_engine= MyISAM + while($engine_type_c) + { + -- echo ### engines: $server_1_engine, $server_2_engine, $server_3_engine + -- source $row_img_test_script + + -- let $server_3_engine= InnoDB + -- dec $engine_type_c + } + -- let $server_2_engine= InnoDB + -- dec $engine_type_b + } + -- let $server_1_engine= InnoDB + -- dec $engine_type_a +} diff --git a/mysql-test/include/rpl_row_img_set.inc b/mysql-test/include/rpl_row_img_set.inc new file mode 100644 index 00000000000..d998c3f1d6c --- /dev/null +++ b/mysql-test/include/rpl_row_img_set.inc @@ -0,0 +1,55 @@ +# +# This is an auxiliar script that sets the binlog-row-image +# on a set of connections. These connections are passed as +# a parameter to this script. Its format is the following: +# +# <conid,value,Y_or_N>:[<conid,value,Y_or_N>:...] +# +# In detail: +# +# conid -- connection id (eg, master) +# value -- binlog_row_image value to set (eg, FULL) +# Y_or_N -- Issue stop and start slave (eg, Y) +# +# Sample usage: +# +# -- let $row_img_set=master:FULL:N,slave:MINIMAL:Y +# -- source include/rpl_row_img_set.inc +# +# Notes: +# +# 1. This script saves and restores the original connection that was +# in use at the time it was included. + +-- let $old_conn= $CURRENT_CONNECTION + +while (`SELECT HEX('$row_img_set') != HEX('')`) +{ + + -- let $tuple= `SELECT SUBSTRING_INDEX('$row_img_set', ',', 1)` + + -- let $conn= `SELECT SUBSTRING_INDEX('$tuple', ':', 1)` + -- let $rimg= `SELECT SUBSTRING_INDEX(LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + 2)), ':', 1)` + + -- let $is_slave_restart= `SELECT LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + LENGTH('$rimg')+ 3))` + + -- echo CON: '$conn', IMG: '$rimg', RESTART SLAVE: '$is_slave_restart' + + -- connection $conn + -- eval SET SESSION binlog_row_image= '$rimg' + -- eval SET GLOBAL binlog_row_image= '$rimg' + + if ($is_slave_restart == Y) + { + -- source include/stop_slave.inc + -- source include/start_slave.inc + } + + FLUSH TABLES; + SHOW VARIABLES LIKE 'binlog_row_image'; + + -- let $row_img_set= `SELECT LTRIM(SUBSTRING('$row_img_set', LENGTH('$tuple') + 2 ))` + +} + +-- connection $old_conn diff --git a/mysql-test/r/analyze_stmt_orderby.result b/mysql-test/r/analyze_stmt_orderby.result index 0f5c7c8437b..c4c4fbf4ce3 100644 --- a/mysql-test/r/analyze_stmt_orderby.result +++ b/mysql-test/r/analyze_stmt_orderby.result @@ -531,4 +531,49 @@ EXPLAIN } drop table t5,t6,t7; drop table t3; +# +# Tabular ANALYZE must get its data from execution tracker (and not from +# the query plan) +# +CREATE TABLE t2( +col1 int, +col2 int, +UNIQUE INDEX idx (col1, col2)) engine=myisam; +INSERT INTO t2(col1, col2) VALUES +(1,20),(2,19),(3,18),(4,17),(5,16),(6,15),(7,14),(8,13),(9,12),(10,11), +(11,10),(12,9),(13,8),(14,7),(15,6),(16,5),(17,4),(18,3),(19,2),(20,1); +flush status; +explain +select col1 f1, col2 f2, col1 f3 from t2 group by f1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range NULL idx 5 NULL 7 Using index for group-by +analyze +select col1 f1, col2 f2, col1 f3 from t2 group by f1; +id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra +1 SIMPLE t2 range NULL idx 5 NULL 7 20.00 100.00 100.00 Using index for group-by +analyze format=json +select col1 f1, col2 f2, col1 f3 from t2 group by f1; +ANALYZE +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t2", + "access_type": "range", + "key": "idx", + "key_length": "5", + "used_key_parts": ["col1"], + "r_loops": 1, + "rows": 7, + "r_rows": 20, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100, + "using_index_for_group_by": true + } + } +} +drop table t2; drop table t0,t1; diff --git a/mysql-test/r/ctype_eucjpms.result b/mysql-test/r/ctype_eucjpms.result index 131e7043e58..df1f79fc218 100644 --- a/mysql-test/r/ctype_eucjpms.result +++ b/mysql-test/r/ctype_eucjpms.result @@ -33841,3 +33841,45 @@ ERROR HY000: Invalid eucjpms character string: '8EA0' # # End of 10.0 tests # +# +# Start of 10.1 tests +# +# +# MDEV-8215 Asian MB3 charsets: compare broken bytes as "greater than any non-broken character" +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET eucjpms, KEY(a)); +INSERT INTO t1 VALUES ('a'),(0x7F); +INSERT INTO t1 VALUES (0x8EA1),(0x8EDF); +INSERT INTO t1 VALUES (0x8FA1A1),(0x8FFEFE); +INSERT INTO t1 VALUES (0xA1A1),(0xDEDE),(0xDFDF),(0xE0E0),(0xFEFE); +SELECT HEX(a) FROM t1 ORDER BY a; +HEX(a) +61 +7F +8EA1 +8EDF +8FA1A1 +8FFEFE +A1A1 +DEDE +DFDF +E0E0 +FEFE +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET eucjpms COLLATE eucjpms_bin; +SELECT HEX(a) FROM t1 ORDER BY a; +HEX(a) +61 +7F +8EA1 +8EDF +8FA1A1 +8FFEFE +A1A1 +DEDE +DFDF +E0E0 +FEFE +DROP TABLE t1; +# +# End of 10.1 tests +# diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index 4ad47cbc84a..b578e558c0a 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -26144,3 +26144,45 @@ ERROR HY000: Invalid ujis character string: '8EA0' # # End of 10.0 tests # +# +# Start of 10.1 tests +# +# +# MDEV-8215 Asian MB3 charsets: compare broken bytes as "greater than any non-broken character" +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ujis, KEY(a)); +INSERT INTO t1 VALUES ('a'),(0x7F); +INSERT INTO t1 VALUES (0x8EA1),(0x8EDF); +INSERT INTO t1 VALUES (0x8FA1A1),(0x8FFEFE); +INSERT INTO t1 VALUES (0xA1A1),(0xDEDE),(0xDFDF),(0xE0E0),(0xFEFE); +SELECT HEX(a) FROM t1 ORDER BY a; +HEX(a) +61 +7F +8EA1 +8EDF +8FA1A1 +8FFEFE +A1A1 +DEDE +DFDF +E0E0 +FEFE +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ujis COLLATE ujis_bin; +SELECT HEX(a) FROM t1 ORDER BY a; +HEX(a) +61 +7F +8EA1 +8EDF +8FA1A1 +8FFEFE +A1A1 +DEDE +DFDF +E0E0 +FEFE +DROP TABLE t1; +# +# End of 10.1 tests +# diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result index 2d91ce3dd6f..4d8f2d38a03 100644 --- a/mysql-test/r/ctype_utf16.result +++ b/mysql-test/r/ctype_utf16.result @@ -2127,3 +2127,64 @@ DEALLOCATE PREPARE stmt; # # End of 10.0 tests # +# +# Start of 10.1 tests +# +# +# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" +# +CREATE TABLE t1 ( +id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +a VARCHAR(10) CHARACTER SET utf16, KEY(a,id) +); +INSERT INTO t1 (a) VALUES (_utf8mb4 0x61); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xE0A080),(_utf8mb4 0xEFBFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xF0908080),(_utf8mb4 0xF48FBFBF); +SELECT id,HEX(a) FROM t1 ORDER BY a,id; +id HEX(a) +1 0061 +2 0080 +3 07FF +4 0800 +6 D800DC00 +7 DBFFDFFF +5 FFFF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +5 FFFF +7 DBFFDFFF +6 D800DC00 +4 0800 +3 07FF +2 0080 +1 0061 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +6 +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf16 COLLATE utf16_bin; +SELECT id,HEX(a) FROM t1 ORDER BY a; +id HEX(a) +1 0061 +2 0080 +3 07FF +4 0800 +5 FFFF +6 D800DC00 +7 DBFFDFFF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +7 DBFFDFFF +6 D800DC00 +5 FFFF +4 0800 +3 07FF +2 0080 +1 0061 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +7 +DROP TABLE t1; +# +# End of 10.1 tests +# diff --git a/mysql-test/r/ctype_utf16le.result b/mysql-test/r/ctype_utf16le.result index 8098b0d1666..c980743ce94 100644 --- a/mysql-test/r/ctype_utf16le.result +++ b/mysql-test/r/ctype_utf16le.result @@ -2319,3 +2319,64 @@ DFFFFFDFFFFF9CFFFF9DFFFF9EFFFF # # End of 5.6 tests # +# +# Start of 10.1 tests +# +# +# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" +# +CREATE TABLE t1 ( +id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +a VARCHAR(10) CHARACTER SET utf16le, KEY(a,id) +); +INSERT INTO t1 (a) VALUES (_utf8mb4 0x61); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xE0A080),(_utf8mb4 0xEFBFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xF0908080),(_utf8mb4 0xF48FBFBF); +SELECT id,HEX(a) FROM t1 ORDER BY a,id; +id HEX(a) +1 6100 +2 8000 +3 FF07 +4 0008 +6 00D800DC +7 FFDBFFDF +5 FFFF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +5 FFFF +7 FFDBFFDF +6 00D800DC +4 0008 +3 FF07 +2 8000 +1 6100 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +6 +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf16le COLLATE utf16le_bin; +SELECT id,HEX(a) FROM t1 ORDER BY a; +id HEX(a) +1 6100 +2 8000 +3 FF07 +4 0008 +5 FFFF +6 00D800DC +7 FFDBFFDF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +7 FFDBFFDF +6 00D800DC +5 FFFF +4 0008 +3 FF07 +2 8000 +1 6100 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +7 +DROP TABLE t1; +# +# End of 10.1 tests +# diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result index 0ec89a50c0f..df7b77b18a5 100644 --- a/mysql-test/r/ctype_utf32.result +++ b/mysql-test/r/ctype_utf32.result @@ -2206,3 +2206,21 @@ DEALLOCATE PREPARE stmt; # # End of 10.0 tests # +# +# Start of 10.1 tests +# +# +# MDEV-8419 utf32: compare broken bytes as "greater than any non-broken character" +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32, KEY(a)); +INSERT INTO t1 VALUES (0x10000),(0x10001),(0x10002); +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +1 +DROP TABLE t1; +SELECT _utf32 0x10001=_utf32 0x10002; +_utf32 0x10001=_utf32 0x10002 +1 +# +# End of 10.1 tests +# diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 4b519e213ef..7bd37ede962 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -5594,11 +5594,11 @@ a?z ab az aЀ +aր SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); PREPARE stmt FROM @query; EXECUTE stmt; ch -aր z # 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); @@ -5802,11 +5802,11 @@ a?z ab az aЀ +aր SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); PREPARE stmt FROM @query; EXECUTE stmt; ch -aր z # 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); @@ -6002,11 +6002,11 @@ a?z ab az aЀ +aր SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); PREPARE stmt FROM @query; EXECUTE stmt; ch -aր z # 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); diff --git a/mysql-test/r/ctype_utf8mb4_heap.result b/mysql-test/r/ctype_utf8mb4_heap.result index 52030d62047..f60bf124a9f 100644 --- a/mysql-test/r/ctype_utf8mb4_heap.result +++ b/mysql-test/r/ctype_utf8mb4_heap.result @@ -2495,5 +2495,66 @@ DROP TABLE t1; # End of 5.5 tests # # -# End of tests +# ctype_utf8mb4.inc: Start of 10.1 tests +# +# +# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" +# +CREATE TABLE t1 ( +id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id) +); +INSERT INTO t1 (a) VALUES (0x61); +INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF); +INSERT INTO t1 (a) VALUES (0xE0A080),(0xEFBFBF); +INSERT INTO t1 (a) VALUES (0xF0908080),(0xF48FBFBF); +SELECT id,HEX(a) FROM t1 ORDER BY a,id; +id HEX(a) +1 61 +2 C280 +3 DFBF +4 E0A080 +6 F0908080 +7 F48FBFBF +5 EFBFBF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +5 EFBFBF +7 F48FBFBF +6 F0908080 +4 E0A080 +3 DFBF +2 C280 +1 61 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +6 +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; +SELECT id,HEX(a) FROM t1 ORDER BY a; +id HEX(a) +1 61 +2 C280 +3 DFBF +4 E0A080 +5 EFBFBF +6 F0908080 +7 F48FBFBF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +7 F48FBFBF +6 F0908080 +5 EFBFBF +4 E0A080 +3 DFBF +2 C280 +1 61 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +7 +DROP TABLE t1; +# +# ctype_utf8mb4.inc: End of 10.1 tests +# +# +# End of ctype_utf8mb4.inc # diff --git a/mysql-test/r/ctype_utf8mb4_innodb.result b/mysql-test/r/ctype_utf8mb4_innodb.result index 243c000b6c4..f904ff6f99e 100644 --- a/mysql-test/r/ctype_utf8mb4_innodb.result +++ b/mysql-test/r/ctype_utf8mb4_innodb.result @@ -2642,5 +2642,66 @@ DROP TABLE t1; # End of 5.5 tests # # -# End of tests +# ctype_utf8mb4.inc: Start of 10.1 tests +# +# +# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" +# +CREATE TABLE t1 ( +id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id) +); +INSERT INTO t1 (a) VALUES (0x61); +INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF); +INSERT INTO t1 (a) VALUES (0xE0A080),(0xEFBFBF); +INSERT INTO t1 (a) VALUES (0xF0908080),(0xF48FBFBF); +SELECT id,HEX(a) FROM t1 ORDER BY a,id; +id HEX(a) +1 61 +2 C280 +3 DFBF +4 E0A080 +6 F0908080 +7 F48FBFBF +5 EFBFBF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +5 EFBFBF +7 F48FBFBF +6 F0908080 +4 E0A080 +3 DFBF +2 C280 +1 61 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +6 +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; +SELECT id,HEX(a) FROM t1 ORDER BY a; +id HEX(a) +1 61 +2 C280 +3 DFBF +4 E0A080 +5 EFBFBF +6 F0908080 +7 F48FBFBF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +7 F48FBFBF +6 F0908080 +5 EFBFBF +4 E0A080 +3 DFBF +2 C280 +1 61 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +7 +DROP TABLE t1; +# +# ctype_utf8mb4.inc: End of 10.1 tests +# +# +# End of ctype_utf8mb4.inc # diff --git a/mysql-test/r/ctype_utf8mb4_myisam.result b/mysql-test/r/ctype_utf8mb4_myisam.result index acdd6d36af7..e44421d1410 100644 --- a/mysql-test/r/ctype_utf8mb4_myisam.result +++ b/mysql-test/r/ctype_utf8mb4_myisam.result @@ -2642,5 +2642,66 @@ DROP TABLE t1; # End of 5.5 tests # # -# End of tests +# ctype_utf8mb4.inc: Start of 10.1 tests +# +# +# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" +# +CREATE TABLE t1 ( +id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id) +); +INSERT INTO t1 (a) VALUES (0x61); +INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF); +INSERT INTO t1 (a) VALUES (0xE0A080),(0xEFBFBF); +INSERT INTO t1 (a) VALUES (0xF0908080),(0xF48FBFBF); +SELECT id,HEX(a) FROM t1 ORDER BY a,id; +id HEX(a) +1 61 +2 C280 +3 DFBF +4 E0A080 +6 F0908080 +7 F48FBFBF +5 EFBFBF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +5 EFBFBF +7 F48FBFBF +6 F0908080 +4 E0A080 +3 DFBF +2 C280 +1 61 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +6 +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; +SELECT id,HEX(a) FROM t1 ORDER BY a; +id HEX(a) +1 61 +2 C280 +3 DFBF +4 E0A080 +5 EFBFBF +6 F0908080 +7 F48FBFBF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +7 F48FBFBF +6 F0908080 +5 EFBFBF +4 E0A080 +3 DFBF +2 C280 +1 61 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +7 +DROP TABLE t1; +# +# ctype_utf8mb4.inc: End of 10.1 tests +# +# +# End of ctype_utf8mb4.inc # diff --git a/mysql-test/r/explain_json.result b/mysql-test/r/explain_json.result index e08cd9780fd..f81a62ef23b 100644 --- a/mysql-test/r/explain_json.result +++ b/mysql-test/r/explain_json.result @@ -293,14 +293,17 @@ EXPLAIN }, "subqueries": [ { - "query_block": { - "select_id": 2, - "table": { - "table_name": "t1", - "access_type": "ALL", - "rows": 10, - "filtered": 100, - "attached_condition": "(t1.b = t0.a)" + "expression_cache": { + "state": "uninitialized", + "query_block": { + "select_id": 2, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 10, + "filtered": 100, + "attached_condition": "(t1.b = t0.a)" + } } } } @@ -323,14 +326,17 @@ EXPLAIN }, "subqueries": [ { - "query_block": { - "select_id": 2, - "table": { - "table_name": "t1", - "access_type": "ALL", - "rows": 10, - "filtered": 100, - "attached_condition": "(t1.b = t0.a)" + "expression_cache": { + "state": "uninitialized", + "query_block": { + "select_id": 2, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 10, + "filtered": 100, + "attached_condition": "(t1.b = t0.a)" + } } } } diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 847c959fc59..2a918adcb5f 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1633,9 +1633,7 @@ drop table if exists t1;drop table if exists t1; drop table if exists t1;drop table if exists t1; drop table if exists t1;drop table if exists t1; drop table if exists t1;drop table if exists t1; -drop table if exists t1;drop table if exists -Warnings: -Warning 1265 Data truncated for column 'VARIABLE_VALUE' at row 1 +drop table if exists t1;drop table if exists t1; select * from information_schema.global_variables where variable_name like 'init%' order by variable_name; VARIABLE_NAME VARIABLE_VALUE INIT_CONNECT drop table if exists t1;drop table if exists t1; @@ -1658,11 +1656,9 @@ drop table if exists t1;drop table if exists t1; drop table if exists t1;drop table if exists t1; drop table if exists t1;drop table if exists t1; drop table if exists t1;drop table if exists t1; -drop table if exists t1;drop table if exists +drop table if exists t1;drop table if exists t1; INIT_FILE INIT_SLAVE -Warnings: -Warning 1265 Data truncated for column 'VARIABLE_VALUE' at row # set global init_connect=""; create table t0 select * from information_schema.global_status where VARIABLE_NAME='COM_SELECT'; SELECT 1; diff --git a/mysql-test/r/innodb_icp.result b/mysql-test/r/innodb_icp.result index fb467494525..cff78e76664 100644 --- a/mysql-test/r/innodb_icp.result +++ b/mysql-test/r/innodb_icp.result @@ -600,6 +600,16 @@ SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 WHERE t2.pk <> t1.d1 AND t2.pk = 4; d1 pk i1 1 4 1 +EXPLAIN +SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 +WHERE t1.d1 <> t2.pk AND t2.pk = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL k1 9 NULL 3 Using index +1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using where +SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 +WHERE t1.d1 <> t2.pk AND t2.pk = 4; +d1 pk i1 +1 4 1 DROP TABLE t1, t2; # # BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89 diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result index c1dbef08c04..68ea89949b2 100644 --- a/mysql-test/r/join_cache.result +++ b/mysql-test/r/join_cache.result @@ -4321,6 +4321,23 @@ h n v p +EXPLAIN +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 +GROUP BY t2.v ORDER BY t1.pk,t2.v; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index idx1 idx2 7 NULL 20 Using index; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY,idx2 PRIMARY 4 test.t2.i 1 Using where +1 SIMPLE t1 ref idx2 idx2 3 test.t3.v 5 Using where +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 +GROUP BY t2.v ORDER BY t1.pk,t2.v; +v +b +h +n +v +p SET SESSION join_cache_level=6; EXPLAIN SELECT t2.v FROM t1, t2, t3 @@ -4339,6 +4356,23 @@ h n v p +EXPLAIN +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 +GROUP BY t2.v ORDER BY t1.pk,t2.v; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index idx1 idx2 7 NULL 20 Using index; Using temporary; Using filesort +1 SIMPLE t3 eq_ref PRIMARY,idx2 PRIMARY 4 test.t2.i 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t1 ref idx2 idx2 3 test.t3.v 5 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 +GROUP BY t2.v ORDER BY t1.pk,t2.v; +v +b +h +n +v +p SET SESSION join_cache_level=4; EXPLAIN SELECT t2.v FROM t1, t2, t3 @@ -4357,6 +4391,23 @@ h n v p +EXPLAIN +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 +GROUP BY t2.v ORDER BY t1.pk,t2.v; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index idx1 idx2 7 NULL 20 Using index; Using temporary; Using filesort +1 SIMPLE t3 hash_ALL PRIMARY,idx2 #hash#PRIMARY 4 test.t2.i 20 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t1 hash_ALL idx2 #hash#idx2 3 test.t3.v 44 Using where; Using join buffer (incremental, BNLH join) +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 +GROUP BY t2.v ORDER BY t1.pk,t2.v; +v +b +h +n +v +p DROP TABLE t1,t2,t3; SET SESSION join_cache_level=DEFAULT; # diff --git a/mysql-test/r/myisam_icp.result b/mysql-test/r/myisam_icp.result index 49cba60320d..2792d75abb2 100644 --- a/mysql-test/r/myisam_icp.result +++ b/mysql-test/r/myisam_icp.result @@ -604,6 +604,16 @@ SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 WHERE t2.pk <> t1.d1 AND t2.pk = 4; d1 pk i1 1 4 1 +EXPLAIN +SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 +WHERE t1.d1 <> t2.pk AND t2.pk = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL k1 9 NULL 3 Using index +1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using where +SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 +WHERE t1.d1 <> t2.pk AND t2.pk = 4; +d1 pk i1 +1 4 1 DROP TABLE t1, t2; # # BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89 diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 5dfa73b5647..fc22af6b9be 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -87,6 +87,17 @@ The following options may be given as the first argument: The maximum size of a row-based binary log event in bytes. Rows will be grouped into events smaller than this size if possible. The value has to be a multiple of 256. + --binlog-row-image=name + Controls whether rows should be logged in 'FULL', + 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all + columns in the before and after image are logged. + 'NOBLOB', means that mysqld avoids logging blob columns + whenever possible (eg, blob column was not changed or is + not part of primary key). 'MINIMAL', means that a PK + equivalent (PK columns or full row if there is no PK in + the table) is logged in the before image, and only + changed columns are logged in the after image. (Default: + FULL). --binlog-stmt-cache-size=# The size of the statement cache for updates to non-transactional engines for the binary log. If you @@ -1127,6 +1138,7 @@ binlog-direct-non-transactional-updates FALSE binlog-format STATEMENT binlog-optimize-thread-scheduling TRUE binlog-row-event-max-size 1024 +binlog-row-image FULL binlog-stmt-cache-size 32768 bulk-insert-buffer-size 8388608 changed-page-bitmaps ON diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 78a224b1439..1b984666462 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -2241,3 +2241,27 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where 0 drop table t1,t2; +# +# Start of 10.1 tests +# +# +# MDEV-8189 field<>const and const<>field are not symmetric +# +CREATE TABLE t1 (a INT, b INT, KEY(a)); +INSERT INTO t1 (a) VALUES (10),(10),(10),(10),(10),(10),(10),(10),(10),(10),(70); +EXPLAIN SELECT * FROM t1 WHERE a<>10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 3 Using index condition +EXPLAIN SELECT * FROM t1 WHERE 10<>a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 3 Using index condition +SELECT * FROM t1 WHERE a<>10; +a b +70 NULL +SELECT * FROM t1 WHERE 10<>a; +a b +70 NULL +DROP TABLE t1; +# +# End of 10.1 tests +# diff --git a/mysql-test/r/range_mrr_icp.result b/mysql-test/r/range_mrr_icp.result index 1b6e4cb9fe8..4ce433200bf 100644 --- a/mysql-test/r/range_mrr_icp.result +++ b/mysql-test/r/range_mrr_icp.result @@ -2243,4 +2243,28 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where 0 drop table t1,t2; +# +# Start of 10.1 tests +# +# +# MDEV-8189 field<>const and const<>field are not symmetric +# +CREATE TABLE t1 (a INT, b INT, KEY(a)); +INSERT INTO t1 (a) VALUES (10),(10),(10),(10),(10),(10),(10),(10),(10),(10),(70); +EXPLAIN SELECT * FROM t1 WHERE a<>10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 3 Using index condition; Rowid-ordered scan +EXPLAIN SELECT * FROM t1 WHERE 10<>a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 3 Using index condition; Rowid-ordered scan +SELECT * FROM t1 WHERE a<>10; +a b +70 NULL +SELECT * FROM t1 WHERE 10<>a; +a b +70 NULL +DROP TABLE t1; +# +# End of 10.1 tests +# set optimizer_switch=@mrr_icp_extra_tmp; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 60879086c62..1d2ab12dbb8 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -101,19 +101,19 @@ drop table t1; show variables like "wait_timeout%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 -def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 1024 5 N 1 0 8 +def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 5 N 1 0 8 Variable_name Value wait_timeout 28800 show variables like "WAIT_timeout%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 -def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 1024 5 N 1 0 8 +def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 5 N 1 0 8 Variable_name Value wait_timeout 28800 show variables like "this_doesn't_exists%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8 -def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 1024 0 N 1 0 8 +def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 2048 0 N 1 0 8 Variable_name Value show table status from test like "this_doesn't_exists%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr diff --git a/mysql-test/r/subselect_cache.result b/mysql-test/r/subselect_cache.result index e5a2fe12526..8ca6bf52e0e 100644 --- a/mysql-test/r/subselect_cache.result +++ b/mysql-test/r/subselect_cache.result @@ -39,6 +39,231 @@ Handler_read_prev 0 Handler_read_rnd 0 Handler_read_rnd_deleted 0 Handler_read_rnd_next 31 +analyze format=json +select a, (select d from t2 where b=c) from t1; +ANALYZE +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t1", + "access_type": "ALL", + "r_loops": 1, + "rows": 10, + "r_rows": 10, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100 + }, + "subqueries": [ + { + "expression_cache": { + "r_loops": 10, + "r_hit_ratio": 60, + "query_block": { + "select_id": 2, + "r_loops": 4, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t2", + "access_type": "ALL", + "r_loops": 4, + "rows": 4, + "r_rows": 4, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 18.75, + "attached_condition": "(t1.b = t2.c)" + } + } + } + } + ] + } +} +analyze format=json +select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1; +ANALYZE +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t1", + "access_type": "ALL", + "r_loops": 1, + "rows": 10, + "r_rows": 10, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100 + }, + "subqueries": [ + { + "expression_cache": { + "r_loops": 10, + "r_hit_ratio": 60, + "query_block": { + "union_result": { + "table_name": "<union3,4>", + "access_type": "ALL", + "r_loops": 4, + "r_rows": 1, + "query_specifications": [ + { + "query_block": { + "select_id": 3, + "r_loops": 4, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t2", + "access_type": "ALL", + "r_loops": 4, + "rows": 4, + "r_rows": 4, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 18.75, + "attached_condition": "(t1.b = t2.c)" + } + } + }, + { + "query_block": { + "select_id": 4, + "table": { + "message": "No tables used" + } + } + } + ] + } + } + } + }, + { + "expression_cache": { + "r_loops": 10, + "r_hit_ratio": 60, + "query_block": { + "select_id": 2, + "r_loops": 4, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t2", + "access_type": "ALL", + "r_loops": 4, + "rows": 4, + "r_rows": 4, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 18.75, + "attached_condition": "(t1.b = t2.c)" + } + } + } + } + ] + } +} +explain format=json +select a, (select d from t2 where b=c) from t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 10, + "filtered": 100 + }, + "subqueries": [ + { + "expression_cache": { + "state": "uninitialized", + "query_block": { + "select_id": 2, + "table": { + "table_name": "t2", + "access_type": "ALL", + "rows": 4, + "filtered": 100, + "attached_condition": "(t1.b = t2.c)" + } + } + } + } + ] + } +} +explain format=json +select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 10, + "filtered": 100 + }, + "subqueries": [ + { + "expression_cache": { + "state": "uninitialized", + "query_block": { + "union_result": { + "table_name": "<union3,4>", + "access_type": "ALL", + "query_specifications": [ + { + "query_block": { + "select_id": 3, + "table": { + "table_name": "t2", + "access_type": "ALL", + "rows": 4, + "filtered": 100, + "attached_condition": "(t1.b = t2.c)" + } + } + }, + { + "query_block": { + "select_id": 4, + "table": { + "message": "No tables used" + } + } + } + ] + } + } + } + }, + { + "expression_cache": { + "state": "uninitialized", + "query_block": { + "select_id": 2, + "table": { + "table_name": "t2", + "access_type": "ALL", + "rows": 4, + "filtered": 100, + "attached_condition": "(t1.b = t2.c)" + } + } + } + } + ] + } +} set optimizer_switch='subquery_cache=off'; flush status; select a, (select d from t2 where b=c) from t1; diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result index 9a5da710a4c..f55fbf07db8 100644 --- a/mysql-test/r/subselect_sj2.result +++ b/mysql-test/r/subselect_sj2.result @@ -1092,6 +1092,27 @@ AND ( alias5.b >= alias3.b OR alias5.c != alias3.c ) ); COUNT(*) 3724 +EXPLAIN +SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 +WHERE alias3.d IN ( +SELECT alias4.c FROM t2 AS alias4, t2 AS alias5 +WHERE alias5.b = alias4.b +AND ( alias5.b >= alias3.b OR alias3.c != alias5.c ) +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL 19 Using where +1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d 1 Using index +1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b 1 Using where; FirstMatch(alias3) +1 PRIMARY alias2 ALL NULL NULL NULL NULL 14 Using join buffer (flat, BNL join) +1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 Using join buffer (flat, BNL join) +SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 +WHERE alias3.d IN ( +SELECT alias4.c FROM t2 AS alias4, t2 AS alias5 +WHERE alias5.b = alias4.b +AND ( alias5.b >= alias3.b OR alias3.c != alias5.c ) +); +COUNT(*) +3724 set optimizer_prune_level=@tmp_951283; DROP TABLE t1,t2; # diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result index c10b550d11a..2b6af74e47e 100644 --- a/mysql-test/r/subselect_sj2_jcl6.result +++ b/mysql-test/r/subselect_sj2_jcl6.result @@ -1107,6 +1107,27 @@ AND ( alias5.b >= alias3.b OR alias5.c != alias3.c ) ); COUNT(*) 3724 +EXPLAIN +SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 +WHERE alias3.d IN ( +SELECT alias4.c FROM t2 AS alias4, t2 AS alias5 +WHERE alias5.b = alias4.b +AND ( alias5.b >= alias3.b OR alias3.c != alias5.c ) +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL 19 Using where +1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d 1 Using index +1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b 1 Using where; FirstMatch(alias3) +1 PRIMARY alias2 ALL NULL NULL NULL NULL 14 Using join buffer (flat, BNL join) +1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 Using join buffer (incremental, BNL join) +SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 +WHERE alias3.d IN ( +SELECT alias4.c FROM t2 AS alias4, t2 AS alias5 +WHERE alias5.b = alias4.b +AND ( alias5.b >= alias3.b OR alias3.c != alias5.c ) +); +COUNT(*) +3724 set optimizer_prune_level=@tmp_951283; DROP TABLE t1,t2; # diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index 4e75aee24a2..cfc7aa082f1 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -1094,6 +1094,27 @@ AND ( alias5.b >= alias3.b OR alias5.c != alias3.c ) ); COUNT(*) 3724 +EXPLAIN +SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 +WHERE alias3.d IN ( +SELECT alias4.c FROM t2 AS alias4, t2 AS alias5 +WHERE alias5.b = alias4.b +AND ( alias5.b >= alias3.b OR alias3.c != alias5.c ) +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL 19 Using where +1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d 1 Using index +1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b 1 Using where; FirstMatch(alias3) +1 PRIMARY alias2 ALL NULL NULL NULL NULL 14 Using join buffer (flat, BNL join) +1 PRIMARY alias1 ALL NULL NULL NULL NULL 14 Using join buffer (flat, BNL join) +SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 +WHERE alias3.d IN ( +SELECT alias4.c FROM t2 AS alias4, t2 AS alias5 +WHERE alias5.b = alias4.b +AND ( alias5.b >= alias3.b OR alias3.c != alias5.c ) +); +COUNT(*) +3724 set optimizer_prune_level=@tmp_951283; DROP TABLE t1,t2; # diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index d8c18711293..0c62007d2a0 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -893,5 +893,57 @@ DROP TABLE t1; # End of MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field # # +# MDEV-8336 The meaning of NO_ZERO_DATE is not clear for DATETIME +# +SET sql_mode='NO_ZERO_DATE'; +SELECT TIMESTAMP'0000-00-01 10:20:30'; +TIMESTAMP'0000-00-01 10:20:30' +0000-00-01 10:20:30 +SELECT TIMESTAMP'0000-00-00 10:20:30'; +TIMESTAMP'0000-00-00 10:20:30' +0000-00-00 10:20:30 +SELECT TIMESTAMP'0000-00-00 00:00:00.000001'; +TIMESTAMP'0000-00-00 00:00:00.000001' +0000-00-00 00:00:00.000001 +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES ('0000-00-00 10:20:30'); +SELECT a, LEAST(a,'2001-01-01 10:20:30') FROM t1; +a LEAST(a,'2001-01-01 10:20:30') +0000-00-00 10:20:30 0000-00-00 10:20:30.000000 +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME(6)); +INSERT INTO t1 VALUES ('0000-00-00 00:00:00.000001'); +SELECT a, LEAST(a,'2001-01-01 10:20:30') FROM t1; +a LEAST(a,'2001-01-01 10:20:30') +0000-00-00 00:00:00.000001 0000-00-00 00:00:00.000001 +DROP TABLE t1; +SELECT STR_TO_DATE('0000-00-00 10:20:30','%Y-%m-%d %h:%i:%s'); +STR_TO_DATE('0000-00-00 10:20:30','%Y-%m-%d %h:%i:%s') +0000-00-00 10:20:30 +SELECT STR_TO_DATE('0000-00-00 00:00:00.000001','%Y-%m-%d %H:%i:%s.%f'); +STR_TO_DATE('0000-00-00 00:00:00.000001','%Y-%m-%d %H:%i:%s.%f') +0000-00-00 00:00:00.000001 +SET old_mode=zero_date_time_cast; +SELECT CAST(TIME'10:20:30' AS DATETIME); +CAST(TIME'10:20:30' AS DATETIME) +0000-00-00 10:20:30 +SELECT CAST(TIME'00:00:00.000001' AS DATETIME(6)); +CAST(TIME'00:00:00.000001' AS DATETIME(6)) +0000-00-00 00:00:00.000001 +SELECT CAST(CAST('10:20:30' AS TIME) AS DATETIME); +CAST(CAST('10:20:30' AS TIME) AS DATETIME) +0000-00-00 10:20:30 +SELECT CAST(CAST('00:00:00.000001' AS TIME(6)) AS DATETIME(6)); +CAST(CAST('00:00:00.000001' AS TIME(6)) AS DATETIME(6)) +0000-00-00 00:00:00.000001 +SELECT CAST(CAST(TIMESTAMP'0000-00-00 10:20:30' AS TIME) AS DATETIME); +CAST(CAST(TIMESTAMP'0000-00-00 10:20:30' AS TIME) AS DATETIME) +0000-00-00 10:20:30 +SELECT CAST(CAST(TIMESTAMP'0000-00-00 00:00:00.000001' AS TIME(6)) AS DATETIME(6)); +CAST(CAST(TIMESTAMP'0000-00-00 00:00:00.000001' AS TIME(6)) AS DATETIME(6)) +0000-00-00 00:00:00.000001 +SET old_mode=DEFAULT; +SET sql_mode=DEFAULT; +# # End of 10.1 tests # diff --git a/mysql-test/suite/encryption/r/innodb-page_encryption.result b/mysql-test/suite/encryption/r/innodb-page_encryption.result index 85467c509f1..c4814983af4 100644 --- a/mysql-test/suite/encryption/r/innodb-page_encryption.result +++ b/mysql-test/suite/encryption/r/innodb-page_encryption.result @@ -1,12 +1,27 @@ SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; +show warnings; +Level Code Message create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1; +show warnings; +Level Code Message create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2; +show warnings; +Level Code Message create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3; ERROR HY000: Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 140 InnoDB: ENCRYPTION_KEY_ID 3 not available +Error 1005 Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33; +show warnings; +Level Code Message create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4; +show warnings; +Level Code Message set innodb_default_encryption_key_id = 5; create table innodb_defkey(c1 bigint not null, b char(200)) engine=innodb encrypted=yes; show create table innodb_defkey; diff --git a/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result b/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result index b1a4262df06..f7ffc77fd66 100644 --- a/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result +++ b/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result @@ -2,7 +2,11 @@ SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; set global innodb_compression_algorithm = 1; create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1; +show warnings; +Level Code Message create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1 page_compressed=1; +show warnings; +Level Code Message create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=2 page_compressed=1; show warnings; Level Code Message diff --git a/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result b/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result index e627f3c0c5f..92130da19e9 100644 --- a/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result +++ b/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result @@ -4,10 +4,20 @@ call mtr.add_suppression("InnoDB: Redo log crypto: Can't initialize to key versi SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; +show warnings; +Level Code Message create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1; +show warnings; +Level Code Message create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2; +show warnings; +Level Code Message create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33; +show warnings; +Level Code Message create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4; +show warnings; +Level Code Message show create table innodb_compact; Table Create Table innodb_compact CREATE TABLE `innodb_compact` ( diff --git a/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result index 54a7d50bf05..e3238990aaa 100644 --- a/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result +++ b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result @@ -262,5 +262,3 @@ drop table innodb_page_compressed6; drop table innodb_page_compressed7; drop table innodb_page_compressed8; drop table innodb_page_compressed9; -SET GLOBAL innodb_encryption_threads = 4; -SET GLOBAL innodb_encrypt_tables = on; diff --git a/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result b/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result index 1ed18ec205d..43fb7368654 100644 --- a/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result +++ b/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result @@ -2,10 +2,20 @@ SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; +show warnings; +Level Code Message create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=2; +show warnings; +Level Code Message create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=3; +show warnings; +Level Code Message create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=4; +show warnings; +Level Code Message create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=5; +show warnings; +Level Code Message insert into innodb_normal values (1,'test1'),(2,'foo'),(3,'bar'),(4,'mariadb'); insert into innodb_compact select * from innodb_normal; insert into innodb_compressed select * from innodb_normal; diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption.test b/mysql-test/suite/encryption/t/innodb-page_encryption.test index 375de4e9244..463df756933 100644 --- a/mysql-test/suite/encryption/t/innodb-page_encryption.test +++ b/mysql-test/suite/encryption/t/innodb-page_encryption.test @@ -10,12 +10,18 @@ SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; +show warnings; create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1; +show warnings; create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2; +show warnings; --error ER_CANT_CREATE_TABLE create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3; +show warnings; create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33; +show warnings; create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4; +show warnings; set innodb_default_encryption_key_id = 5; create table innodb_defkey(c1 bigint not null, b char(200)) engine=innodb encrypted=yes; diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption_compression.test b/mysql-test/suite/encryption/t/innodb-page_encryption_compression.test index b262e6033a9..1d59c39d637 100644 --- a/mysql-test/suite/encryption/t/innodb-page_encryption_compression.test +++ b/mysql-test/suite/encryption/t/innodb-page_encryption_compression.test @@ -15,7 +15,9 @@ SET GLOBAL innodb_file_per_table = ON; set global innodb_compression_algorithm = 1; create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1; +show warnings; create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1 page_compressed=1; +show warnings; create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=2 page_compressed=1; show warnings; diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.test b/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.test index aa201ca1a00..b6fe0d10b65 100644 --- a/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.test +++ b/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.test @@ -15,10 +15,15 @@ SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; +show warnings; create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1; +show warnings; create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2; +show warnings; create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33; +show warnings; create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4; +show warnings; show create table innodb_compact; show create table innodb_compressed; diff --git a/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test index 40ba6bceba9..c2c7bd96d3e 100644 --- a/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test +++ b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test @@ -8,6 +8,8 @@ let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; let $innodb_file_format_orig = `SELECT @@innodb_file_format`; let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; +let $innodb_encrypt_tables_orig = `SELECT @@innodb_encrypt_tables`; +let $innodb_encryption_threads_orig = `SELECT @@innodb_encryption_threads`; --enable_query_log SET GLOBAL innodb_file_format = `Barracuda`; @@ -161,7 +163,7 @@ drop table innodb_page_compressed9; EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; +EVAL SET GLOBAL innodb_encrypt_tables = $innodb_encrypt_tables_orig; +EVAL SET GLOBAL innodb_encryption_threads = $innodb_encryption_threads_orig; --enable_query_log -SET GLOBAL innodb_encryption_threads = 4; -SET GLOBAL innodb_encrypt_tables = on; diff --git a/mysql-test/suite/encryption/t/innodb_page_encryption_key_change.test b/mysql-test/suite/encryption/t/innodb_page_encryption_key_change.test index 87511c7b3a0..7cbf005ed32 100644 --- a/mysql-test/suite/encryption/t/innodb_page_encryption_key_change.test +++ b/mysql-test/suite/encryption/t/innodb_page_encryption_key_change.test @@ -16,10 +16,15 @@ SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; +show warnings; create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=2; +show warnings; create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=3; +show warnings; create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=4; +show warnings; create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=5; +show warnings; insert into innodb_normal values (1,'test1'),(2,'foo'),(3,'bar'),(4,'mariadb'); insert into innodb_compact select * from innodb_normal; diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index 866461720f0..17d3b841f8a 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -167,9 +167,9 @@ def information_schema GEOMETRY_COLUMNS MAX_PPR 12 0 NO tinyint NULL NULL 3 0 NU def information_schema GEOMETRY_COLUMNS SRID 13 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NO varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select +def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NO varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select +def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select def information_schema INDEX_STATISTICS INDEX_NAME 3 NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192) select def information_schema INDEX_STATISTICS ROWS_READ 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select def information_schema INDEX_STATISTICS TABLE_NAME 2 NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192) select @@ -321,9 +321,9 @@ def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NUL def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -def information_schema SESSION_STATUS VARIABLE_VALUE 2 NO varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select +def information_schema SESSION_STATUS VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NO varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select +def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select @@ -345,15 +345,15 @@ def information_schema STATISTICS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL def information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select +def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select -def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select +def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 11 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) select def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 10 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) select def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) select def information_schema SYSTEM_VARIABLES READ_ONLY 13 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) select -def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select +def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select @@ -694,9 +694,9 @@ NULL information_schema GEOMETRY_COLUMNS COORD_DIMENSION tinyint NULL NULL NULL NULL information_schema GEOMETRY_COLUMNS MAX_PPR tinyint NULL NULL NULL NULL tinyint(2) NULL information_schema GEOMETRY_COLUMNS SRID smallint NULL NULL NULL NULL smallint(5) 3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema INDEX_STATISTICS TABLE_SCHEMA varchar 192 576 utf8 utf8_general_ci varchar(192) 3.0000 information_schema INDEX_STATISTICS TABLE_NAME varchar 192 576 utf8 utf8_general_ci varchar(192) 3.0000 information_schema INDEX_STATISTICS INDEX_NAME varchar 192 576 utf8 utf8_general_ci varchar(192) @@ -848,9 +848,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet 3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3) 3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) NULL information_schema SPATIAL_REF_SYS SRID smallint NULL NULL NULL NULL smallint(5) 3.0000 information_schema SPATIAL_REF_SYS AUTH_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512) NULL information_schema SPATIAL_REF_SYS AUTH_SRID smallint NULL NULL NULL NULL smallint(5) @@ -872,10 +872,10 @@ NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3) 3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16) 3.0000 information_schema STATISTICS INDEX_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024) 3.0000 information_schema SYSTEM_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema SYSTEM_VARIABLES SESSION_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) -3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema SYSTEM_VARIABLES SESSION_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) +3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema SYSTEM_VARIABLES DEFAULT_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema SYSTEM_VARIABLES DEFAULT_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema SYSTEM_VARIABLES VARIABLE_SCOPE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema SYSTEM_VARIABLES VARIABLE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema SYSTEM_VARIABLES VARIABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048) diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index c314165367f..bd49492c353 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -167,9 +167,9 @@ def information_schema GEOMETRY_COLUMNS MAX_PPR 12 0 NO tinyint NULL NULL 3 0 NU def information_schema GEOMETRY_COLUMNS SRID 13 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NO varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) +def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NO varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) +def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) def information_schema INDEX_STATISTICS INDEX_NAME 3 NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192) def information_schema INDEX_STATISTICS ROWS_READ 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) def information_schema INDEX_STATISTICS TABLE_NAME 2 NO varchar 192 576 NULL NULL NULL utf8 utf8_general_ci varchar(192) @@ -321,9 +321,9 @@ def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NUL def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema SESSION_STATUS VARIABLE_VALUE 2 NO varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) +def information_schema SESSION_STATUS VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NO varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) +def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) @@ -345,15 +345,15 @@ def information_schema STATISTICS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL def information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 14 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) +def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext -def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) +def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 11 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 10 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8 utf8_general_ci varchar(21) def information_schema SYSTEM_VARIABLES READ_ONLY 13 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) -def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) +def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 NO varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) @@ -694,9 +694,9 @@ NULL information_schema GEOMETRY_COLUMNS COORD_DIMENSION tinyint NULL NULL NULL NULL information_schema GEOMETRY_COLUMNS MAX_PPR tinyint NULL NULL NULL NULL tinyint(2) NULL information_schema GEOMETRY_COLUMNS SRID smallint NULL NULL NULL NULL smallint(5) 3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema INDEX_STATISTICS TABLE_SCHEMA varchar 192 576 utf8 utf8_general_ci varchar(192) 3.0000 information_schema INDEX_STATISTICS TABLE_NAME varchar 192 576 utf8 utf8_general_ci varchar(192) 3.0000 information_schema INDEX_STATISTICS INDEX_NAME varchar 192 576 utf8 utf8_general_ci varchar(192) @@ -848,9 +848,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet 3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3) 3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) NULL information_schema SPATIAL_REF_SYS SRID smallint NULL NULL NULL NULL smallint(5) 3.0000 information_schema SPATIAL_REF_SYS AUTH_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512) NULL information_schema SPATIAL_REF_SYS AUTH_SRID smallint NULL NULL NULL NULL smallint(5) @@ -872,10 +872,10 @@ NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3) 3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16) 3.0000 information_schema STATISTICS INDEX_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024) 3.0000 information_schema SYSTEM_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema SYSTEM_VARIABLES SESSION_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) -3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema SYSTEM_VARIABLES SESSION_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) +3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema SYSTEM_VARIABLES DEFAULT_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) +3.0000 information_schema SYSTEM_VARIABLES DEFAULT_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) 3.0000 information_schema SYSTEM_VARIABLES VARIABLE_SCOPE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema SYSTEM_VARIABLES VARIABLE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema SYSTEM_VARIABLES VARIABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048) diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result index 85a21ada47d..7a8c0dd44dd 100644 --- a/mysql-test/suite/maria/icp.result +++ b/mysql-test/suite/maria/icp.result @@ -606,6 +606,16 @@ SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 WHERE t2.pk <> t1.d1 AND t2.pk = 4; d1 pk i1 1 4 1 +EXPLAIN +SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 +WHERE t1.d1 <> t2.pk AND t2.pk = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL k1 9 NULL 3 Using index +1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using where +SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1 +WHERE t1.d1 <> t2.pk AND t2.pk = 4; +d1 pk i1 +1 4 1 DROP TABLE t1, t2; # # BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89 diff --git a/mysql-test/suite/rpl/r/rpl_row_img_blobs.result b/mysql-test/suite/rpl/r/rpl_row_img_blobs.result new file mode 100644 index 00000000000..e69358a5d29 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_img_blobs.result @@ -0,0 +1,4733 @@ +include/rpl_init.inc [topology=1->2->3] +CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +### engines: MyISAM, MyISAM, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, MyISAM, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +### engines: MyISAM, MyISAM, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, MyISAM, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +### engines: MyISAM, MyISAM, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, MyISAM, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### 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) +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table) +### will not break replication +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that updates without blobs in the BI (PK exists int the table) +### will not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob in a key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a unique (not null) key does not break replication +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +### Asserts that declaring a blob as part of a primary key does not break replication +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, "a", 10); +INSERT INTO t VALUES (2, "b", 20); +INSERT INTO t VALUES (3, "c", 30); +include/rpl_sync.inc +UPDATE t SET c1=10 WHERE c2="a"; +UPDATE t SET c1=20 WHERE c1=2; +UPDATE t SET c1=30 WHERE c3=30; +UPDATE t SET c3=40 WHERE c1=30; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c2="a"; +DELETE FROM t WHERE c1=20; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_img_eng_min.result b/mysql-test/suite/rpl/r/rpl_row_img_eng_min.result new file mode 100644 index 00000000000..ba01221d3b6 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_img_eng_min.result @@ -0,0 +1,3516 @@ +include/rpl_init.inc [topology=1->2->3] +CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +### engines: MyISAM, MyISAM, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, MyISAM, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result b/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result new file mode 100644 index 00000000000..16152f28c27 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result @@ -0,0 +1,3516 @@ +include/rpl_init.inc [topology=1->2->3] +CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +### engines: MyISAM, MyISAM, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, MyISAM, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: MyISAM, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, MyISAM, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, MyISAM +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +### engines: InnoDB, InnoDB, InnoDB +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite NOT NULL Unique key with holes +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key with holes +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Primary Key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Primary key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Unique key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +****** TEST: One Composite key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: One key +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +SET SQL_LOG_BIN=0; +******* TEST: No keys +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=1; +INSERT INTO t VALUES (1, '1', '1', '1' ); +INSERT INTO t VALUES (4, '4', '4', '4' ); +INSERT INTO t VALUES (7, '7', '7', '7' ); +INSERT INTO t VALUES (9, '9', '9', NULL ); +INSERT INTO t VALUES (2, '1', '2', '2' ); +INSERT INTO t VALUES (3, '1', '3', '2' ); +include/rpl_sync.inc +UPDATE t SET c4 = '7'; +UPDATE t SET c4 = '5' WHERE c1 = 1; +UPDATE t SET c2 = '5' WHERE c1 = 1; +UPDATE t SET c1 = '5' WHERE c1 = 1; +UPDATE t SET c4 = '8' WHERE c2 = '4'; +UPDATE t SET c1 = '8' WHERE c2 = '4'; +UPDATE t SET c2 = '8' WHERE c2 = '4'; +UPDATE t SET c3 = '0' WHERE c4 = NULL; +UPDATE t SET c2 = '0' WHERE c4 = '0'; +UPDATE t SET c2 = '2' WHERE c4 = '2'; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DELETE FROM t WHERE c1 = 7; +DELETE FROM t WHERE c1 = 8; +DELETE FROM t; +include/rpl_sync.inc +include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t] +DROP TABLE t; +include/rpl_sync.inc +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_img.cnf b/mysql-test/suite/rpl/t/rpl_row_img.cnf new file mode 100644 index 00000000000..ed9a4292917 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img.cnf @@ -0,0 +1,21 @@ +!include include/default_mysqld.cnf + +[mysqld.1] +log-slave-updates +innodb +innodb_flush_log_at_trx_commit= 0 + +[mysqld.2] +log-slave-updates +innodb +innodb_flush_log_at_trx_commit= 0 + +[mysqld.3] +log-slave-updates +innodb +innodb_flush_log_at_trx_commit= 0 + +[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_blobs.cnf b/mysql-test/suite/rpl/t/rpl_row_img_blobs.cnf new file mode 100644 index 00000000000..d758d29f481 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_blobs.cnf @@ -0,0 +1 @@ +!include suite/rpl/t/rpl_row_img.cnf diff --git a/mysql-test/suite/rpl/t/rpl_row_img_blobs.test b/mysql-test/suite/rpl/t/rpl_row_img_blobs.test new file mode 100644 index 00000000000..467202391b0 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_blobs.test @@ -0,0 +1,59 @@ +#Want to skip this test from daily Valgrind execution +--source include/no_valgrind_without_big.inc + +# +# This file contains tests for WL#5096. +# + +--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 + +# +# WL#5096 Tests. +# + +# +# Tests combinations of binlog-row-image against mixes of MyISAM and InnoDB +# storage engines on all three servers. +# +# All the combinarions need not to be separated into their own files as +# the tests for indexes and engines mixes are, because noblobs test script +# does not take too long time, thence we do not risk triggering PB2 timeout +# on valgrind runs. +# + +## NOBLOB + +-- let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_blobs.test +-- source include/rpl_row_img_general_loop.inc + +## MINIMAL + +-- let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/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 +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/rpl_row_img_blobs.test +-- source include/rpl_row_img_general_loop.inc + + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_min.cnf b/mysql-test/suite/rpl/t/rpl_row_img_eng_min.cnf new file mode 100644 index 00000000000..d758d29f481 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_min.cnf @@ -0,0 +1 @@ +!include suite/rpl/t/rpl_row_img.cnf diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_min.test b/mysql-test/suite/rpl/t/rpl_row_img_eng_min.test new file mode 100644 index 00000000000..24b9655bd81 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_min.test @@ -0,0 +1,39 @@ +#Want to skip this test from daily Valgrind execution +--source include/no_valgrind_without_big.inc +# +# This file contains tests for WL#5096 and bug fixes. +# + +--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 + +# +# WL#5096 +# + +# +# Tests for different storage engines on each server, +# but same index structure on tables. The tests are conducted +# using MINIMAL binlog-row-image on all servers. +# + +-- let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/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_eng_noblob.cnf b/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.cnf new file mode 100644 index 00000000000..d758d29f481 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.cnf @@ -0,0 +1 @@ +!include suite/rpl/t/rpl_row_img.cnf diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test b/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test new file mode 100644 index 00000000000..5d5f95a6552 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test @@ -0,0 +1,39 @@ +#Want to skip this test from daily Valgrind execution +--source include/no_valgrind_without_big.inc +# +# This file contains tests for WL#5096 and bug fixes. +# + +--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 + +# +# WL#5096 +# + +# +# Tests for different storage engines on each server, +# but same index structure on tables. The tests are conducted +# using NOBLOB binlog-row-image on all servers. +# + +-- let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y +-- source include/rpl_row_img_set.inc + +-- let $row_img_test_script= extra/rpl_tests/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/sys_vars/r/binlog_row_image_basic.result b/mysql-test/suite/sys_vars/r/binlog_row_image_basic.result new file mode 100644 index 00000000000..8a1aae216bb --- /dev/null +++ b/mysql-test/suite/sys_vars/r/binlog_row_image_basic.result @@ -0,0 +1,100 @@ +SELECT @@GLOBAL.binlog_row_image; +@@GLOBAL.binlog_row_image +FULL +SELECT @@SESSION.binlog_row_image; +@@SESSION.binlog_row_image +FULL +FULL Expected +'#---------------------BS_STVARS_002_01----------------------#' +SET @start_value= @@global.binlog_row_image; +SELECT COUNT(@@GLOBAL.binlog_row_image); +COUNT(@@GLOBAL.binlog_row_image) +1 +1 Expected +SELECT COUNT(@@SESSION.binlog_row_image); +COUNT(@@SESSION.binlog_row_image) +1 +1 Expected +'#---------------------BS_STVARS_002_02----------------------#' +SET @@GLOBAL.binlog_row_image=0; +SELECT @@GLOBAL.binlog_row_image; +@@GLOBAL.binlog_row_image +MINIMAL +MINIMAL Expected +SET @@SESSION.binlog_row_image=0; +SELECT @@SESSION.binlog_row_image; +@@SESSION.binlog_row_image +MINIMAL +MINIMAL Expected +SET @@GLOBAL.binlog_row_image=1; +SELECT @@GLOBAL.binlog_row_image; +@@GLOBAL.binlog_row_image +NOBLOB +NOBLOB Expected +SET @@SESSION.binlog_row_image=1; +SELECT @@SESSION.binlog_row_image; +@@SESSION.binlog_row_image +NOBLOB +NOBLOB Expected +SET @@GLOBAL.binlog_row_image=2; +SELECT @@GLOBAL.binlog_row_image; +@@GLOBAL.binlog_row_image +FULL +FULL Expected +SET @@SESSION.binlog_row_image=2; +SELECT @@SESSION.binlog_row_image; +@@SESSION.binlog_row_image +FULL +FULL Expected +'#---------------------BS_STVARS_002_03----------------------#' +SELECT @@GLOBAL.binlog_row_image = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_row_image'; +@@GLOBAL.binlog_row_image = VARIABLE_VALUE +1 +1 Expected +SELECT COUNT(@@GLOBAL.binlog_row_image); +COUNT(@@GLOBAL.binlog_row_image) +1 +1 Expected +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_row_image'; +COUNT(VARIABLE_VALUE) +1 +1 Expected +'#---------------------BS_STVARS_002_04----------------------#' +SELECT @@SESSION.binlog_row_image = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='binlog_row_image'; +@@SESSION.binlog_row_image = VARIABLE_VALUE +1 +1 Expected +SELECT COUNT(@@SESSION.binlog_row_image); +COUNT(@@SESSION.binlog_row_image) +1 +1 Expected +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='binlog_row_image'; +COUNT(VARIABLE_VALUE) +1 +1 Expected +'#---------------------BS_STVARS_002_05----------------------#' +SELECT COUNT(@@binlog_row_image); +COUNT(@@binlog_row_image) +1 +1 Expected +SELECT COUNT(@@local.binlog_row_image); +COUNT(@@local.binlog_row_image) +1 +1 Expected +SELECT COUNT(@@SESSION.binlog_row_image); +COUNT(@@SESSION.binlog_row_image) +1 +1 Expected +SELECT COUNT(@@GLOBAL.binlog_row_image); +COUNT(@@GLOBAL.binlog_row_image) +1 +1 Expected +SET @@global.binlog_row_image= @start_value; diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index 641ba67ab7d..3c232d6b504 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -233,6 +233,20 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME BINLOG_ROW_IMAGE +SESSION_VALUE FULL +GLOBAL_VALUE FULL +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE FULL +VARIABLE_SCOPE SESSION +VARIABLE_TYPE ENUM +VARIABLE_COMMENT Controls whether rows should be logged in 'FULL', 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all columns in the before and after image are logged. 'NOBLOB', means that mysqld avoids logging blob columns whenever possible (eg, blob column was not changed or is not part of primary key). 'MINIMAL', means that a PK equivalent (PK columns or full row if there is no PK in the table) is logged in the before image, and only changed columns are logged in the after image. (Default: FULL). +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST MINIMAL,NOBLOB,FULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME BINLOG_STMT_CACHE_SIZE SESSION_VALUE NULL GLOBAL_VALUE 32768 diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index e4e6b5a9801..42ee3381ac7 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -233,6 +233,20 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME BINLOG_ROW_IMAGE +SESSION_VALUE FULL +GLOBAL_VALUE FULL +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE FULL +VARIABLE_SCOPE SESSION +VARIABLE_TYPE ENUM +VARIABLE_COMMENT Controls whether rows should be logged in 'FULL', 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all columns in the before and after image are logged. 'NOBLOB', means that mysqld avoids logging blob columns whenever possible (eg, blob column was not changed or is not part of primary key). 'MINIMAL', means that a PK equivalent (PK columns or full row if there is no PK in the table) is logged in the before image, and only changed columns are logged in the after image. (Default: FULL). +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST MINIMAL,NOBLOB,FULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME BINLOG_STMT_CACHE_SIZE SESSION_VALUE NULL GLOBAL_VALUE 32768 diff --git a/mysql-test/suite/sys_vars/t/binlog_row_image_basic.test b/mysql-test/suite/sys_vars/t/binlog_row_image_basic.test new file mode 100644 index 00000000000..6f5095b6a5d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/binlog_row_image_basic.test @@ -0,0 +1,129 @@ +################## mysql-test\t\binlog_row_image_basic.test ################### +# # +# Variable Name: binlog_row_image # +# Scope: Global & Session # +# Access Type: Static # +# Data Type: enumeration # +# # +# # +# Creation Date: 2010-05-20 # +# Author : Luis Soares # +# # +# # +# Description:Test Cases of Dynamic System Variable binlog_row_image # +# that checks the behavior of this variable in the following ways # +# * Value Check # +# * Scope Check # +# # +# Reference: # +# http://dev.mysql.com/doc/refman/5.X/en/server-system-variables.html # +# # +############################################################################### + + +SELECT @@GLOBAL.binlog_row_image; +SELECT @@SESSION.binlog_row_image; +--echo FULL Expected + +--echo '#---------------------BS_STVARS_002_01----------------------#' +#################################################################### +# Displaying default value # +#################################################################### +SET @start_value= @@global.binlog_row_image; + +SELECT COUNT(@@GLOBAL.binlog_row_image); +--echo 1 Expected + +SELECT COUNT(@@SESSION.binlog_row_image); +--echo 1 Expected + +--echo '#---------------------BS_STVARS_002_02----------------------#' +#################################################################### +# Check if Value can set # +#################################################################### +SET @@GLOBAL.binlog_row_image=0; +SELECT @@GLOBAL.binlog_row_image; +--echo MINIMAL Expected + +SET @@SESSION.binlog_row_image=0; +SELECT @@SESSION.binlog_row_image; +--echo MINIMAL Expected + +SET @@GLOBAL.binlog_row_image=1; +SELECT @@GLOBAL.binlog_row_image; +--echo NOBLOB Expected + +SET @@SESSION.binlog_row_image=1; +SELECT @@SESSION.binlog_row_image; +--echo NOBLOB Expected + +SET @@GLOBAL.binlog_row_image=2; +SELECT @@GLOBAL.binlog_row_image; +--echo FULL Expected + +SET @@SESSION.binlog_row_image=2; +SELECT @@SESSION.binlog_row_image; +--echo FULL Expected + +--echo '#---------------------BS_STVARS_002_03----------------------#' +################################################################# +# Check if the value in GLOBAL Table matches value in variable # +################################################################# + +--disable_warnings +SELECT @@GLOBAL.binlog_row_image = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_row_image'; +--enable_warnings +--echo 1 Expected + +SELECT COUNT(@@GLOBAL.binlog_row_image); +--echo 1 Expected + +--disable_warnings +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='binlog_row_image'; +--enable_warnings +--echo 1 Expected + + +--echo '#---------------------BS_STVARS_002_04----------------------#' +################################################################# +# Check if the value in SESSION Table matches value in variable # +################################################################# + +--disable_warnings +SELECT @@SESSION.binlog_row_image = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='binlog_row_image'; +--enable_warnings +--echo 1 Expected + +SELECT COUNT(@@SESSION.binlog_row_image); +--echo 1 Expected + +--disable_warnings +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='binlog_row_image'; +--enable_warnings +--echo 1 Expected + + +--echo '#---------------------BS_STVARS_002_05----------------------#' +################################################################################ +# Check if binlog_row_image can be accessed with and without @@ sign # +################################################################################ + +SELECT COUNT(@@binlog_row_image); +--echo 1 Expected +SELECT COUNT(@@local.binlog_row_image); +--echo 1 Expected +SELECT COUNT(@@SESSION.binlog_row_image); +--echo 1 Expected +SELECT COUNT(@@GLOBAL.binlog_row_image); +--echo 1 Expected + +SET @@global.binlog_row_image= @start_value; + diff --git a/mysql-test/t/analyze_stmt_orderby.test b/mysql-test/t/analyze_stmt_orderby.test index 4e280bebd37..a40f34805d1 100644 --- a/mysql-test/t/analyze_stmt_orderby.test +++ b/mysql-test/t/analyze_stmt_orderby.test @@ -147,6 +147,31 @@ select count(distinct t5.b) as sum from t5, t6 where t5.a=t6.a and t6.b > 0 and t5.a <= 5 group by t5.a order by sum limit 1; drop table t5,t6,t7; - drop table t3; + +--echo # +--echo # Tabular ANALYZE must get its data from execution tracker (and not from +--echo # the query plan) +--echo # + +CREATE TABLE t2( + col1 int, + col2 int, + UNIQUE INDEX idx (col1, col2)) engine=myisam; + +INSERT INTO t2(col1, col2) VALUES + (1,20),(2,19),(3,18),(4,17),(5,16),(6,15),(7,14),(8,13),(9,12),(10,11), + (11,10),(12,9),(13,8),(14,7),(15,6),(16,5),(17,4),(18,3),(19,2),(20,1); + +flush status; +explain +select col1 f1, col2 f2, col1 f3 from t2 group by f1; +analyze +select col1 f1, col2 f2, col1 f3 from t2 group by f1; +--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/ /"r_buffer_size": "[^"]+"/"r_buffer_size": "REPLACED"/ +analyze format=json +select col1 f1, col2 f2, col1 f3 from t2 group by f1; +drop table t2; + + drop table t0,t1; diff --git a/mysql-test/t/ctype_eucjpms.test b/mysql-test/t/ctype_eucjpms.test index 2dd806ed027..d533e38b2a2 100644 --- a/mysql-test/t/ctype_eucjpms.test +++ b/mysql-test/t/ctype_eucjpms.test @@ -541,3 +541,28 @@ SELECT _eucjpms 0x8EA0; --echo # --echo # End of 10.0 tests --echo # + +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-8215 Asian MB3 charsets: compare broken bytes as "greater than any non-broken character" +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET eucjpms, KEY(a)); +# [x00-x7F] # ASCII/JIS-Roman +# [x8E][xA1-xDF] # half-width katakana +# [x8F][xA1-xFE][xA1-xFE] # JIS X 0212-1990 +# [xA1-xFE][xA1-xFE] # JIS X 0208:1997 +INSERT INTO t1 VALUES ('a'),(0x7F); +INSERT INTO t1 VALUES (0x8EA1),(0x8EDF); +INSERT INTO t1 VALUES (0x8FA1A1),(0x8FFEFE); +INSERT INTO t1 VALUES (0xA1A1),(0xDEDE),(0xDFDF),(0xE0E0),(0xFEFE); +SELECT HEX(a) FROM t1 ORDER BY a; +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET eucjpms COLLATE eucjpms_bin; +SELECT HEX(a) FROM t1 ORDER BY a; +DROP TABLE t1; + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index 94fc7ffe4c0..6fc928c7e60 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -1369,3 +1369,28 @@ SELECT _ujis 0x8EA0; --echo # --echo # End of 10.0 tests --echo # + + +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-8215 Asian MB3 charsets: compare broken bytes as "greater than any non-broken character" +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ujis, KEY(a)); +# [x00-x7F] # ASCII/JIS-Roman +# [x8E][xA1-xDF] # half-width katakana +# [x8F][xA1-xFE][xA1-xFE] # JIS X 0212-1990 +# [xA1-xFE][xA1-xFE] # JIS X 0208:1997 +INSERT INTO t1 VALUES ('a'),(0x7F); +INSERT INTO t1 VALUES (0x8EA1),(0x8EDF); +INSERT INTO t1 VALUES (0x8FA1A1),(0x8FFEFE); +INSERT INTO t1 VALUES (0xA1A1),(0xDEDE),(0xDFDF),(0xE0E0),(0xFEFE); +SELECT HEX(a) FROM t1 ORDER BY a; +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ujis COLLATE ujis_bin; +SELECT HEX(a) FROM t1 ORDER BY a;DROP TABLE t1; + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/ctype_utf16.test b/mysql-test/t/ctype_utf16.test index e4305ed9879..8ea6ea67f1f 100644 --- a/mysql-test/t/ctype_utf16.test +++ b/mysql-test/t/ctype_utf16.test @@ -860,3 +860,31 @@ DEALLOCATE PREPARE stmt; --echo # --echo # End of 10.0 tests --echo # + +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" +--echo # +CREATE TABLE t1 ( + id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + a VARCHAR(10) CHARACTER SET utf16, KEY(a,id) +); +INSERT INTO t1 (a) VALUES (_utf8mb4 0x61); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xE0A080),(_utf8mb4 0xEFBFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xF0908080),(_utf8mb4 0xF48FBFBF); +SELECT id,HEX(a) FROM t1 ORDER BY a,id; +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +SELECT COUNT(DISTINCT a) FROM t1; +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf16 COLLATE utf16_bin; +SELECT id,HEX(a) FROM t1 ORDER BY a; +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +SELECT COUNT(DISTINCT a) FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/ctype_utf16le.test b/mysql-test/t/ctype_utf16le.test index a8326900847..f5998fec18c 100644 --- a/mysql-test/t/ctype_utf16le.test +++ b/mysql-test/t/ctype_utf16le.test @@ -744,3 +744,31 @@ SET NAMES utf8, collation_connection=utf16le_bin; --echo # --echo # End of 5.6 tests --echo # + +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" +--echo # +CREATE TABLE t1 ( + id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + a VARCHAR(10) CHARACTER SET utf16le, KEY(a,id) +); +INSERT INTO t1 (a) VALUES (_utf8mb4 0x61); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xE0A080),(_utf8mb4 0xEFBFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xF0908080),(_utf8mb4 0xF48FBFBF); +SELECT id,HEX(a) FROM t1 ORDER BY a,id; +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +SELECT COUNT(DISTINCT a) FROM t1; +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf16le COLLATE utf16le_bin; +SELECT id,HEX(a) FROM t1 ORDER BY a; +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +SELECT COUNT(DISTINCT a) FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/ctype_utf32.test b/mysql-test/t/ctype_utf32.test index e6583f990ca..a75ac72b67f 100644 --- a/mysql-test/t/ctype_utf32.test +++ b/mysql-test/t/ctype_utf32.test @@ -956,3 +956,20 @@ DEALLOCATE PREPARE stmt; --echo # End of 10.0 tests --echo # +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-8419 utf32: compare broken bytes as "greater than any non-broken character" +--echo # +# Make sure that all non-BMP characters are compared as equal +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32, KEY(a)); +INSERT INTO t1 VALUES (0x10000),(0x10001),(0x10002); +SELECT COUNT(DISTINCT a) FROM t1; +DROP TABLE t1; +SELECT _utf32 0x10001=_utf32 0x10002; + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/join_cache.test b/mysql-test/t/join_cache.test index 7d873c555f6..019d8edde2f 100644 --- a/mysql-test/t/join_cache.test +++ b/mysql-test/t/join_cache.test @@ -2505,6 +2505,18 @@ SELECT t2.v FROM t1, t2, t3 WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 GROUP BY t2.v ORDER BY t1.pk,t2.v; +# MDEV-8189 field<>const and const<>field are not symmetric +# Do the same EXPLAIN and SELECT +# for "t2.v <> t3.v" instead of "t3.v <> t2.v" + +EXPLAIN +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 + GROUP BY t2.v ORDER BY t1.pk,t2.v; +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 + GROUP BY t2.v ORDER BY t1.pk,t2.v; + SET SESSION join_cache_level=6; EXPLAIN SELECT t2.v FROM t1, t2, t3 @@ -2514,6 +2526,17 @@ SELECT t2.v FROM t1, t2, t3 WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 GROUP BY t2.v ORDER BY t1.pk,t2.v; +# MDEV-8189 field<>const and const<>field are not symmetric +# Do the same EXPLAIN and SELECT +# for "t2.v <> t3.v" instead of "t3.v <> t2.v" +EXPLAIN +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 + GROUP BY t2.v ORDER BY t1.pk,t2.v; +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 + GROUP BY t2.v ORDER BY t1.pk,t2.v; + SET SESSION join_cache_level=4; EXPLAIN SELECT t2.v FROM t1, t2, t3 @@ -2523,6 +2546,17 @@ SELECT t2.v FROM t1, t2, t3 WHERE t3.v <> t2.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 GROUP BY t2.v ORDER BY t1.pk,t2.v; +# MDEV-8189 field<>const and const<>field are not symmetric +# Do the same EXPLAIN and SELECT +# for "t2.v <> t3.v" instead of "t3.v <> t2.v" +EXPLAIN +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 + GROUP BY t2.v ORDER BY t1.pk,t2.v; +SELECT t2.v FROM t1, t2, t3 +WHERE t2.v <> t3.v AND t3.pk = t2.i AND t1.v = t3.v AND t1.pk*2<100 + GROUP BY t2.v ORDER BY t1.pk,t2.v; + DROP TABLE t1,t2,t3; SET SESSION join_cache_level=DEFAULT; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 6249d2b5e4f..d65e0bb2f73 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -1777,3 +1777,24 @@ explain extended select * from t2 where (b > 25 and b < 15) or c < 44; explain extended select * from t2 where (b > 25 and b < 15) or (a>55 and a<44); drop table t1,t2; + + +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-8189 field<>const and const<>field are not symmetric +--echo # +CREATE TABLE t1 (a INT, b INT, KEY(a)); +INSERT INTO t1 (a) VALUES (10),(10),(10),(10),(10),(10),(10),(10),(10),(10),(70); +EXPLAIN SELECT * FROM t1 WHERE a<>10; +EXPLAIN SELECT * FROM t1 WHERE 10<>a; +SELECT * FROM t1 WHERE a<>10; +SELECT * FROM t1 WHERE 10<>a; +DROP TABLE t1; + + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/subselect_cache.test b/mysql-test/t/subselect_cache.test index 1276e546030..21247541fb6 100644 --- a/mysql-test/t/subselect_cache.test +++ b/mysql-test/t/subselect_cache.test @@ -24,6 +24,16 @@ select a, (select d from t2 where b=c) from t1; show status like "subquery_cache%"; show status like '%Handler_read%'; +--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/ +analyze format=json +select a, (select d from t2 where b=c) from t1; +--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/ +analyze format=json +select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1; +explain format=json +select a, (select d from t2 where b=c) from t1; +explain format=json +select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1; set optimizer_switch='subquery_cache=off'; flush status; diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test index 0bf9c6d9d10..7ee52a0fa8a 100644 --- a/mysql-test/t/subselect_sj2.test +++ b/mysql-test/t/subselect_sj2.test @@ -1222,6 +1222,25 @@ WHERE alias3.d IN ( AND ( alias5.b >= alias3.b OR alias5.c != alias3.c ) ); +# MDEV-8189 field<>const and const<>field are not symmetric +# Do the same EXPLAIN SELECT and SELECT +# with "alias3.c != alias5.c" instead of "alias5.c != alias3.c" + +EXPLAIN +SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 +WHERE alias3.d IN ( + SELECT alias4.c FROM t2 AS alias4, t2 AS alias5 + WHERE alias5.b = alias4.b + AND ( alias5.b >= alias3.b OR alias3.c != alias5.c ) +); + +SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 +WHERE alias3.d IN ( + SELECT alias4.c FROM t2 AS alias4, t2 AS alias5 + WHERE alias5.b = alias4.b + AND ( alias5.b >= alias3.b OR alias3.c != alias5.c ) +); + set optimizer_prune_level=@tmp_951283; DROP TABLE t1,t2; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index f3e603e9da8..cd311182921 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -623,5 +623,32 @@ let defval='0000-00-00 00:00:00'; --source include/type_temporal_zero_default.inc --echo # +--echo # MDEV-8336 The meaning of NO_ZERO_DATE is not clear for DATETIME +--echo # +SET sql_mode='NO_ZERO_DATE'; +SELECT TIMESTAMP'0000-00-01 10:20:30'; +SELECT TIMESTAMP'0000-00-00 10:20:30'; +SELECT TIMESTAMP'0000-00-00 00:00:00.000001'; +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES ('0000-00-00 10:20:30'); +SELECT a, LEAST(a,'2001-01-01 10:20:30') FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a DATETIME(6)); +INSERT INTO t1 VALUES ('0000-00-00 00:00:00.000001'); +SELECT a, LEAST(a,'2001-01-01 10:20:30') FROM t1; +DROP TABLE t1; +SELECT STR_TO_DATE('0000-00-00 10:20:30','%Y-%m-%d %h:%i:%s'); +SELECT STR_TO_DATE('0000-00-00 00:00:00.000001','%Y-%m-%d %H:%i:%s.%f'); +SET old_mode=zero_date_time_cast; +SELECT CAST(TIME'10:20:30' AS DATETIME); +SELECT CAST(TIME'00:00:00.000001' AS DATETIME(6)); +SELECT CAST(CAST('10:20:30' AS TIME) AS DATETIME); +SELECT CAST(CAST('00:00:00.000001' AS TIME(6)) AS DATETIME(6)); +SELECT CAST(CAST(TIMESTAMP'0000-00-00 10:20:30' AS TIME) AS DATETIME); +SELECT CAST(CAST(TIMESTAMP'0000-00-00 00:00:00.000001' AS TIME(6)) AS DATETIME(6)); +SET old_mode=DEFAULT; +SET sql_mode=DEFAULT; + +--echo # --echo # End of 10.1 tests --echo # |