diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-10 15:13:11 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-10 20:23:01 +0300 |
commit | 00821c38255a319a276f1cc76d95c14b6c5a6673 (patch) | |
tree | 7ab87d59b3cea91496124734d8c0f4185318b33e /storage/innobase | |
parent | fee8d39ecb1dd69b46895ba3feb2bcf17a0b17f2 (diff) | |
download | mariadb-git-00821c38255a319a276f1cc76d95c14b6c5a6673.tar.gz |
MDEV-12776 Do not create the InnoDB temporary tablespace in innodb_read_only mode
The InnoDB temporary tablespace is only usable if innodb_read_only=OFF.
It is useless to create the tablespace in read-only mode, because
CREATE TEMPORARY TABLE is disallowed if innodb_read_only, and nothing
can we written to the temporary tablespace if no temporary tables
can be created.
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/srv/srv0start.cc | 20 | ||||
-rw-r--r-- | storage/innobase/trx/trx0sys.cc | 3 |
2 files changed, 12 insertions, 11 deletions
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 6be9c34ac5a..e451fcb04b0 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -2475,14 +2475,6 @@ files_checked: ut_ad(err == DB_SUCCESS); ut_a(sum_of_new_sizes != ULINT_UNDEFINED); - /* Open temp-tablespace and keep it open until shutdown. */ - - err = srv_open_tmp_tablespace(create_new_db); - - if (err != DB_SUCCESS) { - return(srv_init_abort(err)); - } - /* Create the doublewrite buffer to a new tablespace */ if (!srv_read_only_mode && srv_force_recovery < SRV_FORCE_NO_TRX_UNDO && !buf_dblwr_create()) { @@ -2557,6 +2549,18 @@ files_checked: return(srv_init_abort(err)); } + if (!srv_read_only_mode) { + /* Initialize the innodb_temporary tablespace and keep + it open until shutdown. */ + err = srv_open_tmp_tablespace(create_new_db); + + if (err != DB_SUCCESS) { + return(srv_init_abort(err)); + } + + trx_temp_rseg_create(); + } + srv_is_being_started = false; ut_a(trx_purge_state() == PURGE_STATE_INIT); diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index 47f30138ceb..d511aae48ec 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -887,9 +887,6 @@ trx_sys_create_rsegs() return(true); } - /* Create temporary rollback segments. */ - trx_temp_rseg_create(); - /* This is executed in single-threaded mode therefore it is not necessary to use the same mtr in trx_rseg_create(). n_used cannot change while the function is executing. */ |