1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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.
This commit is contained in:
Marko Mäkelä
2017-05-10 15:13:11 +03:00
parent fee8d39ecb
commit 00821c3825
3 changed files with 12 additions and 12 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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. */