diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result index 72c5250934b..da5ff361eeb 100644 --- a/mysql-test/suite/innodb/r/temporary_table.result +++ b/mysql-test/suite/innodb/r/temporary_table.result @@ -130,7 +130,6 @@ ERROR HY000: The table 't1' is full drop procedure populate_t1; # test read-only mode # files in MYSQL_DATA_DIR -ibtmp1 select * from t1; ERROR 42S02: Table 'test.t1' doesn't exist show tables; 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. */