commit 7020558b86680237562b1479b5a1ba8dcffd3c92 Author: sachin <sachin.setiya@mariadb.com> Date: Thu May 17 14:40:55 2018 +0530 Fix rpl_skip_error test. We cant reset Slave_skipped_errors(even with FLUSH STATUS), So instead of absolute slave_skipped_errors we look for delta of slave_skipped_errors diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result index 7d351339925..0172336a99c 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_error.result +++ b/mysql-test/suite/rpl/r/rpl_skip_error.result @@ -1,5 +1,7 @@ include/master-slave.inc [connection master] +connection slave; +connection master; ==== Test Without sql_mode=strict_trans_tables ==== create table t1 (n int not null primary key); connection slave; @@ -105,9 +107,7 @@ t2 CREATE TABLE `t2` ( `data` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -show global status like 'slave_skipped_errors'; -Variable_name Value -Slave_skipped_errors 4 +# Slave_skipped_errros = 4 connection master; INSERT INTO t2 VALUES(1, 1); INSERT INTO t2 VALUES(2, 1); @@ -119,9 +119,7 @@ SET SQL_LOG_BIN=1; UPDATE t2 SET id= id + 3, data = 2; connection slave; -show global status like 'slave_skipped_errors'; -Variable_name Value -Slave_skipped_errors 5 +# Slave_skipped_errros = 5 **** We cannot execute a select as there are differences in the **** behavior between STMT and RBR. ==== Clean Up ==== diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test index fa8eeb73fba..d3ef834e8ec 100644 --- a/mysql-test/suite/rpl/t/rpl_skip_error.test +++ b/mysql-test/suite/rpl/t/rpl_skip_error.test @@ -26,6 +26,10 @@ source include/have_innodb.inc; source include/master-slave.inc; +--connection slave +let $initial_skipped_error= query_get_value(show global status like "Slave_skipped_errors", Value, 1); + +connection master; --echo ==== Test Without sql_mode=strict_trans_tables ==== create table t1 (n int not null primary key); @@ -133,8 +137,9 @@ connection slave; CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam; SHOW CREATE TABLE t2; -show global status like 'slave_skipped_errors'; - +let $current_skipped_error= query_get_value(show global status like "Slave_skipped_errors", Value, 1); +--let $delta_skipped_error= `select $current_skipped_error - $initial_skipped_error from dual` +--echo # Slave_skipped_errros = $delta_skipped_error connection master; INSERT INTO t2 VALUES(1, 1); @@ -151,7 +156,10 @@ sync_slave_with_master; let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); echo $error; -show global status like 'slave_skipped_errors'; + +let $current_skipped_error= query_get_value(show global status like "Slave_skipped_errors", Value, 1); +--let $delta_skipped_error= `select $current_skipped_error - $initial_skipped_error from dual` +--echo # Slave_skipped_errros = $delta_skipped_error --echo **** We cannot execute a select as there are differences in the --echo **** behavior between STMT and RBR. -- Regards Sachin Setiya Software Engineer at MariaDB