2
# Bug#11760927: 53375: RBR + NO PK => HIGH LOAD ON SLAVE (TABLE SCAN/CPU) => SLAVE FAILURE
4
--source include/master-slave.inc
5
--source include/have_binlog_format_row.inc
6
--source include/have_debug.inc
9
# - setup log_warnings and debug
11
--source include/stop_slave.inc
12
--let $debug_save= `SELECT @@GLOBAL.debug`
13
--let $log_warnings_save= `SELECT @@GLOBAL.log_warnings`
15
SET GLOBAL log_warnings = 2;
17
let $log_error_= `SELECT @@GLOBAL.log_error`;
20
# MySQL Server on windows is started with --console and thus
21
# does not know the location of its .err log, use default location
22
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
25
# Assign env variable LOG_ERROR
26
let LOG_ERROR=$log_error_;
28
# force printing the notes to the error log
29
SET GLOBAL debug="d,inject_long_find_row_note";
30
--source include/start_slave.inc
34
CREATE TABLE t1 (c1 INT);
35
--sync_slave_with_master
38
INSERT INTO t1 VALUES (1), (2);
39
UPDATE t1 SET c1= 1000 WHERE c1=2;
42
--sync_slave_with_master
44
--echo # Check if any note related to long DELETE_ROWS and UPDATE_ROWS appears in the error log
47
my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set";
48
open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
49
my $upd_count = () = grep(/The slave is applying a ROW event on behalf of an UPDATE statement on table t1 and is currently taking a considerable amount/g,<FILE>);
50
seek(FILE, 0, 0) or die "Can't seek to beginning of file: $!";
51
my $del_count = () = grep(/The slave is applying a ROW event on behalf of a DELETE statement on table t1 and is currently taking a considerable amount/g,<FILE>);
52
print "Occurrences: update=$upd_count, delete=$del_count\n";
57
--source include/stop_slave.inc
58
--eval SET GLOBAL debug = '$debug_save'
59
--eval SET GLOBAL log_warnings = $log_warnings_save
60
--source include/start_slave.inc
62
--source include/rpl_end.inc