summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-03-17 13:33:31 +0200
committerSergei Golubchik <serg@mariadb.org>2019-03-17 13:06:12 +0100
commita89ee3cd154a67df2231f034fd8339f9225dbe64 (patch)
tree23afed531a4e65ddfc1398ea34b124def4f8a1a0 /storage
parent51e48b9f8981986257a1cfbdf75e4fc29a5959c1 (diff)
downloadmariadb-git-a89ee3cd154a67df2231f034fd8339f9225dbe64.tar.gz
MDEV-18952 CHECK TABLE should use READ UNCOMMITED if innodb_force_recovery>=5
MDEV-15418 changed InnoDB to use the READ UNCOMMITTED isolation level when the transaction recovery is disabled by setting innodb_force_recovery to 5 or 6. Alas, CHECK TABLE would still internally use REPEATABLE READ. If the server was started without purge running into completion (and resetting all DB_TRX_ID thanks to MDEV-12288), this would cause errors about any DB_TRX_ID that had not been reset to 0.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index a27e1df5dfa..f33527b156d 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -14512,8 +14512,11 @@ ha_innobase::check(
/* We must run the index record counts at an isolation level
>= READ COMMITTED, because a dirty read can see a wrong number
of records in some index; to play safe, we use always
- REPEATABLE READ here */
- m_prebuilt->trx->isolation_level = TRX_ISO_REPEATABLE_READ;
+ REPEATABLE READ here (except when undo logs are unavailable) */
+ m_prebuilt->trx->isolation_level = srv_force_recovery
+ >= SRV_FORCE_NO_UNDO_LOG_SCAN
+ ? TRX_ISO_READ_UNCOMMITTED
+ : TRX_ISO_REPEATABLE_READ;
ut_ad(!m_prebuilt->table->corrupted);