MDEV-15719 ALTER TABLE…ALGORITHM=INPLACE is unnecessarily refused due to innodb_force_recovery

ha_innobase::check_if_supported_inplace_alter(): Only check for
high_level_read_only. Do not unnecessarily refuse
ALTER TABLE...ALGORITHM=INPLACE if innodb_force_recovery was
specified as 1, 2, or 3.

innobase_start_or_create_for_mysql(): Block all writes from SQL
if the system tablespace was initialized with 'newraw'.
This commit is contained in:
Marko Mäkelä 2018-03-29 12:55:24 +03:00
commit 4d9969c216
2 changed files with 4 additions and 6 deletions

View file

@ -580,11 +580,8 @@ ha_innobase::check_if_supported_inplace_alter(
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
if (high_level_read_only
|| srv_sys_space.created_new_raw()
|| srv_force_recovery) {
ha_alter_info->unsupported_reason = (srv_force_recovery)?
"Operation not allowed when innodb_forced_recovery > 0." :
if (high_level_read_only) {
ha_alter_info->unsupported_reason =
innobase_get_err_msg(ER_READ_ONLY_MODE);
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);

View file

@ -1504,7 +1504,8 @@ innobase_start_or_create_for_mysql()
}
high_level_read_only = srv_read_only_mode
|| srv_force_recovery > SRV_FORCE_NO_TRX_UNDO;
|| srv_force_recovery > SRV_FORCE_NO_TRX_UNDO
|| srv_sys_space.created_new_raw();
/* Reset the start state. */
srv_start_state = SRV_START_STATE_NONE;