Commit 1f8efee5 authored by Kristian Nielsen's avatar Kristian Nielsen

Merge MDEV-7198: status variable for Slave_skipped_errors

parents ef4d8db5 9362dd43
......@@ -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);
......@@ -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 ====
......
......@@ -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;
......@@ -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.
......
......@@ -428,8 +428,12 @@ inline int idempotent_error_code(int err_code)
inline int ignored_error_code(int err_code)
{
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 1;
}
return err_code == ER_SLAVE_IGNORED_TABLE;
}
/*
......
......@@ -519,6 +519,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;
......@@ -8266,6 +8267,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},
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment