diff options
-rw-r--r-- | mysql-test/suite/galera/r/galera_binlog_checksum.result | 16 | ||||
-rw-r--r-- | mysql-test/suite/galera/t/galera_binlog_checksum.test | 21 | ||||
-rw-r--r-- | sql/wsrep_mysqld.cc | 6 |
3 files changed, 42 insertions, 1 deletions
diff --git a/mysql-test/suite/galera/r/galera_binlog_checksum.result b/mysql-test/suite/galera/r/galera_binlog_checksum.result index b0ea2293119..7303aa61122 100644 --- a/mysql-test/suite/galera/r/galera_binlog_checksum.result +++ b/mysql-test/suite/galera/r/galera_binlog_checksum.result @@ -11,3 +11,19 @@ SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; COUNT(*) = 1 1 DROP TABLE t1; +# +# MDEV-11149: wsrep_replicate_mysaim: DML fails when binlog checksum +# enabled +# +connection node_1; +SET @@global.wsrep_replicate_myisam=1; +CREATE TABLE t1 (i INT) ENGINE=MYISAM; +INSERT INTO t1 VALUES(1); +connection node_2; +SELECT * FROM t1; +i +1 +connection node_1; +DROP TABLE t1; +SET @@global.wsrep_replicate_myisam=0; +# End of tests. diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum.test b/mysql-test/suite/galera/t/galera_binlog_checksum.test index 48669305242..09d7a02f312 100644 --- a/mysql-test/suite/galera/t/galera_binlog_checksum.test +++ b/mysql-test/suite/galera/t/galera_binlog_checksum.test @@ -20,3 +20,24 @@ UPDATE t1 SET f1 = 2 WHERE f1 = 1; SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; DROP TABLE t1; + +--echo # +--echo # MDEV-11149: wsrep_replicate_mysaim: DML fails when binlog checksum +--echo # enabled +--echo # + +--connection node_1 +let $wsrep_replicate_myisam_saved= `SELECT @@wsrep_replicate_myisam`; +SET @@global.wsrep_replicate_myisam=1; + +CREATE TABLE t1 (i INT) ENGINE=MYISAM; +INSERT INTO t1 VALUES(1); + +--connection node_2 +SELECT * FROM t1; + +--connection node_1 +DROP TABLE t1; +eval SET @@global.wsrep_replicate_myisam=$wsrep_replicate_myisam_saved; + +--echo # End of tests. diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 01fb6d5e2c5..8c58ceddcd1 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1248,9 +1248,11 @@ int wsrep_to_buf_helper( 65536, MYF(MY_WME))) return 1; int ret(0); + enum enum_binlog_checksum_alg current_binlog_check_alg= + (enum_binlog_checksum_alg) binlog_checksum_options; Format_description_log_event *tmp_fd= new Format_description_log_event(4); - tmp_fd->checksum_alg= (enum_binlog_checksum_alg)binlog_checksum_options; + tmp_fd->checksum_alg= current_binlog_check_alg; writer.write(tmp_fd); delete tmp_fd; @@ -1269,11 +1271,13 @@ int wsrep_to_buf_helper( Query_log_event ev(thd, thd->wsrep_TOI_pre_query, thd->wsrep_TOI_pre_query_len, FALSE, FALSE, FALSE, 0); + ev.checksum_alg= current_binlog_check_alg; if (writer.write(&ev)) ret= 1; } /* continue to append the actual query */ Query_log_event ev(thd, query, query_len, FALSE, FALSE, FALSE, 0); + ev.checksum_alg= current_binlog_check_alg; if (!ret && writer.write(&ev)) ret= 1; if (!ret && wsrep_write_cache_buf(&tmp_io_cache, buf, buf_len)) ret= 1; close_cached_file(&tmp_io_cache); |