Commit 00821c38 authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent fee8d39e
......@@ -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;
......
......@@ -2475,14 +2475,6 @@ innobase_start_or_create_for_mysql(void)
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 @@ innobase_start_or_create_for_mysql(void)
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);
......
......@@ -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. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment