[Commits] 21829bd743f: MDEV-17106: Test failure on galera.galera_binlog_stmt_autoinc
revision-id: 21829bd743f487280dba918857259b9971a8afbf (mariadb-10.1.35-45-g21829bd743f) parent(s): bdaace9b3073ff72d1cbcc510ae5541d043a5072 author: Jan Lindström committer: Jan Lindström timestamp: 2018-09-11 08:19:16 +0300 message: MDEV-17106: Test failure on galera.galera_binlog_stmt_autoinc Add missing test case with proper wait conditions for expected node contents. --- mysql-test/suite/galera/disabled.def | 3 +- .../galera/r/galera_binlog_stmt_autoinc.result | 147 +++++++++++++ .../suite/galera/t/galera_binlog_stmt_autoinc.test | 230 +++++++++++++++++++++ 3 files changed, 378 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 40b4065c3db..bd9070683d4 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -31,6 +31,5 @@ MW-416 : MDEV-13549 Galera test failures galera_wan : MDEV-13549 Galera test failures MW-388 : MDEV-13549 Galera test failures galera_sst_mysqldump_with_key : MDEV-16890 Galera test failure -galera.galera_binlog_stmt_autoinc : MDEV-17106 Test failure on galera.galera_binlog_stmt_autoinc galera.galera_kill_ddl : MDEV-17108 Test failure on galera.galera_kill_ddl -galera.galera_var_node_address : MDEV-17151 Galera test failure on galera.galera_var_node_address + diff --git a/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result b/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result new file mode 100644 index 00000000000..8e8b79b168f --- /dev/null +++ b/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result @@ -0,0 +1,147 @@ +SET GLOBAL wsrep_forced_binlog_format='STATEMENT'; +SET GLOBAL wsrep_forced_binlog_format='STATEMENT'; +CREATE TABLE t1 ( +i int(11) NOT NULL AUTO_INCREMENT, +c char(32) DEFAULT 'dummy_text', +PRIMARY KEY (i) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +insert into t1(i) values(null); +select * from t1; +i c +3 dummy_text +insert into t1(i) values(null), (null), (null); +select * from t1; +i c +3 dummy_text +5 dummy_text +7 dummy_text +9 dummy_text +select * from t1; +i c +3 dummy_text +5 dummy_text +7 dummy_text +9 dummy_text +SET GLOBAL wsrep_forced_binlog_format='none'; +SET GLOBAL wsrep_forced_binlog_format='none'; +drop table t1; +SET SESSION binlog_format='STATEMENT'; +show variables like 'binlog_format'; +Variable_name Value +binlog_format STATEMENT +SET GLOBAL wsrep_auto_increment_control='OFF'; +SET SESSION auto_increment_increment = 3; +SET SESSION auto_increment_offset = 1; +CREATE TABLE t1 ( +i int(11) NOT NULL AUTO_INCREMENT, +c char(32) DEFAULT 'dummy_text', +PRIMARY KEY (i) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +insert into t1(i) values(null); +select * from t1; +i c +4 dummy_text +insert into t1(i) values(null), (null), (null); +select * from t1; +i c +4 dummy_text +7 dummy_text +10 dummy_text +13 dummy_text +select * from t1; +i c +4 dummy_text +7 dummy_text +10 dummy_text +13 dummy_text +SET GLOBAL wsrep_auto_increment_control='ON'; +SET SESSION binlog_format='ROW'; +show variables like 'binlog_format'; +Variable_name Value +binlog_format ROW +show variables like '%auto_increment%'; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 1 +wsrep_auto_increment_control ON +SET GLOBAL wsrep_auto_increment_control='OFF'; +show variables like '%auto_increment%'; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 1 +wsrep_auto_increment_control OFF +SET GLOBAL wsrep_auto_increment_control='ON'; +drop table t1; +SET GLOBAL wsrep_forced_binlog_format='ROW'; +SET GLOBAL wsrep_forced_binlog_format='ROW'; +CREATE TABLE t1 ( +i int(11) NOT NULL AUTO_INCREMENT, +c char(32) DEFAULT 'dummy_text', +PRIMARY KEY (i) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +insert into t1(i) values(null); +select * from t1; +i c +3 dummy_text +insert into t1(i) values(null), (null), (null); +select * from t1; +i c +3 dummy_text +5 dummy_text +7 dummy_text +9 dummy_text +select * from t1; +i c +3 dummy_text +5 dummy_text +7 dummy_text +9 dummy_text +SET GLOBAL wsrep_forced_binlog_format='none'; +SET GLOBAL wsrep_forced_binlog_format='none'; +drop table t1; +SET SESSION binlog_format='ROW'; +show variables like 'binlog_format'; +Variable_name Value +binlog_format ROW +SET GLOBAL wsrep_auto_increment_control='OFF'; +SET SESSION auto_increment_increment = 3; +SET SESSION auto_increment_offset = 1; +CREATE TABLE t1 ( +i int(11) NOT NULL AUTO_INCREMENT, +c char(32) DEFAULT 'dummy_text', +PRIMARY KEY (i) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +insert into t1(i) values(null); +select * from t1; +i c +4 dummy_text +insert into t1(i) values(null), (null), (null); +select * from t1; +i c +4 dummy_text +7 dummy_text +10 dummy_text +13 dummy_text +select * from t1; +i c +4 dummy_text +7 dummy_text +10 dummy_text +13 dummy_text +SET GLOBAL wsrep_auto_increment_control='ON'; +show variables like 'binlog_format'; +Variable_name Value +binlog_format ROW +show variables like '%auto_increment%'; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 1 +wsrep_auto_increment_control ON +SET GLOBAL wsrep_auto_increment_control='OFF'; +show variables like '%auto_increment%'; +Variable_name Value +auto_increment_increment 2 +auto_increment_offset 1 +wsrep_auto_increment_control OFF +SET GLOBAL wsrep_auto_increment_control='ON'; +drop table t1; diff --git a/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test new file mode 100644 index 00000000000..d3889a89016 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.test @@ -0,0 +1,230 @@ +## +## Tests the auto-increment with binlog in STATEMENT mode. +## + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + +## +## Verify the correct operation of the auto-increment when the binlog +## format artificially set to the 'STATEMENT' (although this mode is +## not recommended in the current version): +## + +--connection node_2 +SET GLOBAL wsrep_forced_binlog_format='STATEMENT'; + +--connection node_1 +SET GLOBAL wsrep_forced_binlog_format='STATEMENT'; + +CREATE TABLE t1 ( + i int(11) NOT NULL AUTO_INCREMENT, + c char(32) DEFAULT 'dummy_text', + PRIMARY KEY (i) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +insert into t1(i) values(null); + +select * from t1; + +insert into t1(i) values(null), (null), (null); + +select * from t1; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 4 FROM t1; +--source include/wait_condition.inc +select * from t1; + +SET GLOBAL wsrep_forced_binlog_format='none'; + +--connection node_1 + +SET GLOBAL wsrep_forced_binlog_format='none'; + +drop table t1; + +## +## Check the operation when the automatic control over the auto-increment +## settings is switched off, that is, when we use the increment step and +## the offset specified by the user. In the current session, the binlog +## format is set to 'STATEMENT'. It is important that the values of the +## auto-increment options does not changed on other node - it allows us +## to check the correct transmission of the auto-increment options to +## other nodes: +## + +--disable_warnings +SET SESSION binlog_format='STATEMENT'; +--enable_warnings + +show variables like 'binlog_format'; + +SET GLOBAL wsrep_auto_increment_control='OFF'; + +SET SESSION auto_increment_increment = 3; +SET SESSION auto_increment_offset = 1; + +CREATE TABLE t1 ( + i int(11) NOT NULL AUTO_INCREMENT, + c char(32) DEFAULT 'dummy_text', + PRIMARY KEY (i) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +insert into t1(i) values(null); + +select * from t1; + +insert into t1(i) values(null), (null), (null); + +select * from t1; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 4 FROM t1; +--source include/wait_condition.inc + +select * from t1; + +--connection node_1 + +## +## Verify the return to automatic calculation of the step +## and offset of the auto-increment: +## + +SET GLOBAL wsrep_auto_increment_control='ON'; + +SET SESSION binlog_format='ROW'; + +show variables like 'binlog_format'; +show variables like '%auto_increment%'; + +## +## Verify the recovery of original user-defined values after +## stopping the automatic control over auto-increment: +## + +SET GLOBAL wsrep_auto_increment_control='OFF'; + +show variables like '%auto_increment%'; + +## +## Restore original options and drop test table: +## + +SET GLOBAL wsrep_auto_increment_control='ON'; + +drop table t1; + +## +## Verify the correct operation of the auto-increment when the binlog +## format set to the 'ROW': +## + +--connection node_2 +SET GLOBAL wsrep_forced_binlog_format='ROW'; + +--connection node_1 +SET GLOBAL wsrep_forced_binlog_format='ROW'; + +CREATE TABLE t1 ( + i int(11) NOT NULL AUTO_INCREMENT, + c char(32) DEFAULT 'dummy_text', + PRIMARY KEY (i) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +insert into t1(i) values(null); + +select * from t1; + +insert into t1(i) values(null), (null), (null); + +select * from t1; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 4 FROM t1; +--source include/wait_condition.inc + +select * from t1; + +SET GLOBAL wsrep_forced_binlog_format='none'; + +--connection node_1 + +SET GLOBAL wsrep_forced_binlog_format='none'; + +drop table t1; + +## +## Check the operation when the automatic control over the auto-increment +## settings is switched off, that is, when we use the increment step and +## the offset specified by the user. In the current session, the binlog +## format is set to 'ROW'. It is important that the values of the +## auto-increment options does not changed on other node - it allows us +## to check the correct transmission of the auto-increment options to +## other nodes: +## + +SET SESSION binlog_format='ROW'; + +show variables like 'binlog_format'; + +SET GLOBAL wsrep_auto_increment_control='OFF'; + +SET SESSION auto_increment_increment = 3; +SET SESSION auto_increment_offset = 1; + +CREATE TABLE t1 ( + i int(11) NOT NULL AUTO_INCREMENT, + c char(32) DEFAULT 'dummy_text', + PRIMARY KEY (i) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +insert into t1(i) values(null); + +select * from t1; + +insert into t1(i) values(null), (null), (null); + +select * from t1; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 4 FROM t1; +--source include/wait_condition.inc + +select * from t1; + +--connection node_1 + +## +## Verify the return to automatic calculation of the step +## and offset of the auto-increment: +## + +SET GLOBAL wsrep_auto_increment_control='ON'; + +show variables like 'binlog_format'; +show variables like '%auto_increment%'; + +## +## Verify the recovery of original user-defined values after +## stopping the automatic control over auto-increment: +## + +SET GLOBAL wsrep_auto_increment_control='OFF'; + +show variables like '%auto_increment%'; + +## +## Restore original options and drop test table: +## + +SET GLOBAL wsrep_auto_increment_control='ON'; + +drop table t1; + +--source include/auto_increment_offset_restore.inc
participants (1)
-
jan