| 1 |
|
| 2 |
# This is the test case for bug#13628249. Make sure that InnoDB starts |
| 3 |
# up correctly and is able to shutdown with --innodb-force-recovery >= 3 |
| 4 |
# after a crash with active user tranactions. |
| 5 |
|
| 6 |
--disable_query_log |
| 7 |
call mtr.add_suppression(' Failed to find tablespace for table `mysql`\..* in the cache'); |
| 8 |
call mtr.add_suppression(' Failed to find tablespace for table `test`\.`t1` in the cache'); |
| 9 |
call mtr.add_suppression(' Allocated tablespace [0-9]+, old maximum was [0-9]+'); |
| 10 |
call mtr.add_suppression("Skip re-populating collations and character sets tables in InnoDB read-only mode."); |
| 11 |
call mtr.add_suppression("Skip updating information_schema metadata in InnoDB read-only mode."); |
| 12 |
call mtr.add_suppression("Skipped updating resource group metadata in InnoDB read only mode."); |
| 13 |
call mtr.add_suppression("Unable to use user mysql.session account when connecting the server for internal plugin requests"); |
| 14 |
--enable_query_log |
| 15 |
|
| 16 |
--echo # Restart the server in force recovery mode (2) |
| 17 |
let $restart_parameters = restart: --innodb-force-recovery=2; |
| 18 |
--source include/restart_mysqld.inc |
| 19 |
|
| 20 |
SELECT @@innodb_force_recovery; |
| 21 |
|
| 22 |
--echo # Restart server in normal mode |
| 23 |
let $restart_parameters = restart; |
| 24 |
--source include/restart_mysqld.inc |
| 25 |
|
| 26 |
SELECT @@innodb_force_recovery; |
| 27 |
|
| 28 |
# |
| 29 |
# Create test data. |
| 30 |
# |
| 31 |
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; |
| 32 |
BEGIN; |
| 33 |
INSERT INTO t1 VALUES(1), (2), (3), (4); |
| 34 |
|
| 35 |
# Ensure that the above data is flushed to the InnoDB redo log, |
| 36 |
# by committing transactions (which will force a log flush). |
| 37 |
connect (con1, localhost, root); |
| 38 |
CREATE TABLE t2(c2 INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0; |
| 39 |
DROP TABLE t2; |
| 40 |
disconnect con1; |
| 41 |
connection default; |
| 42 |
|
| 43 |
--echo # Restart the server in force recovery mode (3) |
| 44 |
let $restart_parameters = restart: --innodb-force-recovery=3; |
| 45 |
--source include/kill_and_restart_mysqld.inc |
| 46 |
|
| 47 |
SELECT @@innodb_force_recovery; |
| 48 |
|
| 49 |
SELECT COUNT(*) IN (0,4) yes FROM t1; |
| 50 |
|
| 51 |
--echo # Restart the server in force recovery mode (5) |
| 52 |
let $restart_parameters = restart: --innodb-force-recovery=5; |
| 53 |
--source include/restart_mysqld.inc |
| 54 |
|
| 55 |
SELECT @@innodb_force_recovery; |
| 56 |
|
| 57 |
SELECT COUNT(*) IN (0,4) yes FROM t1; |
| 58 |
|
| 59 |
# Restart the server in normal mode now, otherwise the DROP TABLE t1; |
| 60 |
# will cause an assertion failure because essentially it is in read-only |
| 61 |
# mode. For -innodb-force-recovery >= 3 a transaction is not assigned a |
| 62 |
# rollback segment. |
| 63 |
--echo # Restart server in normal mode |
| 64 |
let $restart_parameters = restart; |
| 65 |
--source include/restart_mysqld.inc |
| 66 |
|
| 67 |
SELECT @@innodb_force_recovery; |
| 68 |
|
| 69 |
SELECT COUNT(*) IN (0,4) yes FROM t1; |
| 70 |
|
| 71 |
DROP TABLE t1; |