| 1 |
# |
| 2 |
# Bug#11760927: 53375: RBR + NO PK => HIGH LOAD ON SLAVE (TABLE SCAN/CPU) => SLAVE FAILURE |
| 3 |
# |
| 4 |
--source include/have_binlog_format_row.inc |
| 5 |
--source include/have_debug.inc |
| 6 |
--source include/master-slave.inc |
| 7 |
|
| 8 |
# SETUP |
| 9 |
# - setup log_warnings and debug |
| 10 |
--connection slave |
| 11 |
--source include/stop_slave.inc |
| 12 |
SET @saved_dbug = @@GLOBAL.debug_dbug; |
| 13 |
--let $log_warnings_save= `SELECT @@GLOBAL.log_warnings` |
| 14 |
|
| 15 |
SET GLOBAL log_warnings = 2; |
| 16 |
|
| 17 |
let $log_error_= `SELECT @@GLOBAL.log_error`; |
| 18 |
if(!$log_error_) |
| 19 |
{ |
| 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; |
| 23 |
} |
| 24 |
|
| 25 |
# Assign env variable LOG_ERROR |
| 26 |
let LOG_ERROR=$log_error_; |
| 27 |
|
| 28 |
# force printing the notes to the error log |
| 29 |
SET GLOBAL debug_dbug="d,inject_long_find_row_note"; |
| 30 |
--source include/start_slave.inc |
| 31 |
|
| 32 |
# test |
| 33 |
--connection master |
| 34 |
CREATE TABLE t1 (c1 INT); |
| 35 |
--sync_slave_with_master |
| 36 |
--connection master |
| 37 |
|
| 38 |
INSERT INTO t1 VALUES (1), (2); |
| 39 |
UPDATE t1 SET c1= 1000 WHERE c1=2; |
| 40 |
DELETE FROM t1; |
| 41 |
DROP TABLE t1; |
| 42 |
--sync_slave_with_master |
| 43 |
|
| 44 |
--echo # Check if any note related to long DELETE_ROWS and UPDATE_ROWS appears in the error log |
| 45 |
--let SEARCH_FILE=$log_error_ |
| 46 |
--let SEARCH_PATTERN=The slave is applying a ROW event on behalf of an UPDATE statement on table t1 and is currently taking a considerable amount |
| 47 |
--source include/search_pattern_in_file.inc |
| 48 |
--let SEARCH_PATTERN=The slave is applying a ROW event on behalf of a DELETE statement on table t1 and is currently taking a considerable amount |
| 49 |
--source include/search_pattern_in_file.inc |
| 50 |
|
| 51 |
# cleanup |
| 52 |
--source include/stop_slave.inc |
| 53 |
SET @@GLOBAL.debug_dbug = @saved_dbug; |
| 54 |
--disable_query_log |
| 55 |
--eval SET GLOBAL log_warnings = $log_warnings_save |
| 56 |
--enable_query_log |
| 57 |
--source include/start_slave.inc |
| 58 |
|
| 59 |
--source include/rpl_end.inc |