Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mysql-test/suite/rpl/r/rpl_skip_error.result
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ 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
INSERT INTO t2 VALUES(1, 1);
INSERT INTO t2 VALUES(2, 1);
INSERT INTO t2 VALUES(3, 1);
Expand All @@ -104,6 +107,9 @@ DELETE FROM t2 WHERE id = 5;
SET SQL_LOG_BIN=1;
UPDATE t2 SET id= id + 3, data = 2;

show global status like 'slave_skipped_errors';
Variable_name Value
Slave_skipped_errors 5
**** We cannot execute a select as there are differences in the
**** behavior between STMT and RBR.
==== Clean Up ====
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/rpl/t/rpl_skip_error.test
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ 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';

connection master;

Expand All @@ -157,6 +158,7 @@ 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';

--echo **** We cannot execute a select as there are differences in the
--echo **** behavior between STMT and RBR.
Expand Down
8 changes: 6 additions & 2 deletions sql/log_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,12 @@ inline int ignored_error_code(int err_code)
break;
}
#endif
return ((err_code == ER_SLAVE_IGNORED_TABLE) ||
(use_slave_mask && bitmap_is_set(&slave_error_mask, err_code)));
if (use_slave_mask && bitmap_is_set(&slave_error_mask, err_code))
{
statistic_increment(slave_skipped_errors, LOCK_status);
return true;
}
return err_code == ER_SLAVE_IGNORED_TABLE;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions sql/mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0;
ulong max_connections, max_connect_errors;
ulong extra_max_connections;
ulong slave_retried_transactions;
ulonglong slave_skipped_errors;
ulong feature_files_opened_with_delayed_keys;
ulonglong denied_connections;
my_decimal decimal_zero;
Expand Down Expand Up @@ -7921,6 +7922,7 @@ SHOW_VAR status_vars[]= {
{"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats, SHOW_SIMPLE_FUNC},
{"Slave_retried_transactions",(char*)&slave_retried_transactions, SHOW_LONG},
{"Slave_running", (char*) &show_slave_running, SHOW_SIMPLE_FUNC},
{"Slave_skipped_errors", (char*) &slave_skipped_errors, SHOW_LONGLONG},
#endif
{"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONG},
{"Slow_queries", (char*) offsetof(STATUS_VAR, long_query_count), SHOW_LONG_STATUS},
Expand Down
1 change: 1 addition & 0 deletions sql/slave.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ extern my_bool opt_log_slave_updates;
extern char *opt_slave_skip_errors;
extern my_bool opt_replicate_annotate_row_events;
extern ulonglong relay_log_space_limit;
extern ulonglong slave_skipped_errors;

/*
3 possible values for Master_info::slave_running and
Expand Down