summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/read_only_recover_committed.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb/t/read_only_recover_committed.test')
-rw-r--r--mysql-test/suite/innodb/t/read_only_recover_committed.test25
1 files changed, 22 insertions, 3 deletions
diff --git a/mysql-test/suite/innodb/t/read_only_recover_committed.test b/mysql-test/suite/innodb/t/read_only_recover_committed.test
index 5fd11f01356..9ad09bb9b3a 100644
--- a/mysql-test/suite/innodb/t/read_only_recover_committed.test
+++ b/mysql-test/suite/innodb/t/read_only_recover_committed.test
@@ -4,6 +4,13 @@
# need to restart server
--source include/not_embedded.inc
+--disable_query_log
+# Ignore messages from the innodb_force_recovery=5 startup.
+call mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to find tablespace for table `test`\\.`t` in the cache");
+call mtr.add_suppression("\\[Warning\\] InnoDB: Allocated tablespace ID.* for test/t, old maximum was 0");
+FLUSH TABLES;
+--enable_query_log
+
--connect(con1, localhost, root)
CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t VALUES(1);
@@ -11,7 +18,7 @@ BEGIN;
# Generate insert_undo log.
INSERT INTO t VALUES(2);
# Generate update_undo log.
-DELETE FROM t WHERE a=2;
+UPDATE t SET a=20 WHERE a=2;
--connect(con2, localhost, root)
--echo # Normal MariaDB shutdown would roll back the above transaction.
--echo # We want the transaction to remain open, so we will kill the server
@@ -34,7 +41,7 @@ send COMMIT;
connection default;
SET DEBUG_SYNC='now WAIT_FOR committed';
---echo # Ensure that the above incomplete transactions become durable.
+--echo # Ensure that the above transactions become durable.
SET GLOBAL innodb_flush_log_at_trx_commit=1;
BEGIN;
INSERT INTO t VALUES(-10000);
@@ -55,10 +62,22 @@ UPDATE t SET a=3 WHERE a=1;
SET GLOBAL innodb_status_output= @@GLOBAL.innodb_status_output;
--echo # Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED.
--echo # In earlier versions, this would return the last committed version
---echo # (empty table)!
+--echo # (only a=3; no record for a=20)!
SELECT * FROM t;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
+--let $restart_parameters= --innodb-force-recovery=5
+--source include/restart_mysqld.inc
+--echo #
+--echo # MDEV-15418 innodb_force_recovery=5 displays bogus warnings
+--echo # about too new transaction identifier
+--echo #
+--echo # With the fix, innodb_force_recovery=5 implies READ UNCOMMITTED.
+SELECT * FROM t;
+SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SELECT * FROM t;
+SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SELECT * FROM t;
--let $restart_parameters=
--source include/restart_mysqld.inc
SELECT * FROM t;