Browse Source

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.
pull/277/merge
Marko Mäkelä 9 years ago
parent
commit
00821c3825
  1. 1
      mysql-test/suite/innodb/r/temporary_table.result
  2. 20
      storage/innobase/srv/srv0start.cc
  3. 3
      storage/innobase/trx/trx0sys.cc

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

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

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

Loading…
Cancel
Save