| 1 |
--echo # WL #15387: Innodb: Log progress information while resurrecting transaction during recovery. |
| 2 |
--echo # Check whether the different resurrection logs are printed when a server crashes with an uncommitted transaction. |
| 3 |
|
| 4 |
# This test takes long time, so only run it with the --big-test mtr-flag. |
| 5 |
--source include/big_test.inc |
| 6 |
--source include/have_debug.inc |
| 7 |
|
| 8 |
CREATE TABLE IF NOT EXISTS t1 (col1 VARCHAR(60), col2 VARCHAR(60), col3 VARCHAR(60)); |
| 9 |
|
| 10 |
DELIMITER $$; |
| 11 |
CREATE PROCEDURE bulk_ins() |
| 12 |
BEGIN |
| 13 |
DECLARE x INT; |
| 14 |
SET x = 1; |
| 15 |
lab: LOOP |
| 16 |
IF x > 50000 THEN |
| 17 |
LEAVE lab; |
| 18 |
END IF; |
| 19 |
INSERT INTO t1 VALUES (REPEAT('a', 60), REPEAT('b',60), REPEAT('c',60)); |
| 20 |
SET x = x + 1; |
| 21 |
END LOOP; |
| 22 |
END$$ |
| 23 |
|
| 24 |
CREATE PROCEDURE bulk_upd(n INTEGER) |
| 25 |
BEGIN |
| 26 |
DECLARE x INT; |
| 27 |
SET x = 1; |
| 28 |
lab: LOOP |
| 29 |
UPDATE t1 SET col1=REPEAT('b',60), col2=repeat('c',60), col3=repeat('a',60); |
| 30 |
UPDATE t1 SET col1=REPEAT('a',60), col2=repeat('b',60), col3=repeat('c',60); |
| 31 |
IF x > n THEN |
| 32 |
LEAVE lab; |
| 33 |
END IF; |
| 34 |
SET x = x + 1; |
| 35 |
END LOOP; |
| 36 |
END$$ |
| 37 |
DELIMITER ;$$ |
| 38 |
|
| 39 |
BEGIN; |
| 40 |
CALL bulk_ins(); |
| 41 |
CALL bulk_upd(10); |
| 42 |
|
| 43 |
let $restart_parameters = restart: --log-error-verbosity=3 --debug=+d,resurrect_logs; |
| 44 |
--source include/kill_and_restart_mysqld.inc |
| 45 |
|
| 46 |
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err |
| 47 |
--let SEARCH_PATTERN = Transaction ID:.* found for resurrecting inserts |
| 48 |
--source include/search_pattern.inc |
| 49 |
--let SEARCH_PATTERN= Records read:.* - Pages read:.* |
| 50 |
--source include/search_pattern.inc |
| 51 |
--let SEARCH_PATTERN= Transaction ID:.* found for resurrecting updates |
| 52 |
--source include/search_pattern.inc |
| 53 |
--let SEARCH_PATTERN= Identified table ID:.* to acquire lock |
| 54 |
--source include/search_pattern.inc |
| 55 |
--let SEARCH_PATTERN= Resurrected .* transaction.* doing inserts. |
| 56 |
--source include/search_pattern.inc |
| 57 |
--let SEARCH_PATTERN= Resurrected .* transaction.* doing updates. |
| 58 |
--source include/search_pattern.inc |
| 59 |
--let SEARCH_PATTERN= Acquired lock on table ID:.*, name:.* |
| 60 |
--source include/search_pattern.inc |
| 61 |
--let SEARCH_PATTERN= Total records resurrected:.* - Total pages read:.* - Total tables acquired:.* |
| 62 |
--source include/search_pattern.inc |
| 63 |
|
| 64 |
DROP TABLE t1; |