Skip to content

Commit 4d9969c

Browse files
committed
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'.
1 parent 0d2fffb commit 4d9969c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

storage/innobase/handler/handler0alter.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -580,11 +580,8 @@ ha_innobase::check_if_supported_inplace_alter(
580580
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
581581
}
582582

583-
if (high_level_read_only
584-
|| srv_sys_space.created_new_raw()
585-
|| srv_force_recovery) {
586-
ha_alter_info->unsupported_reason = (srv_force_recovery)?
587-
"Operation not allowed when innodb_forced_recovery > 0." :
583+
if (high_level_read_only) {
584+
ha_alter_info->unsupported_reason =
588585
innobase_get_err_msg(ER_READ_ONLY_MODE);
589586

590587
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);

storage/innobase/srv/srv0start.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,8 @@ innobase_start_or_create_for_mysql()
15041504
}
15051505

15061506
high_level_read_only = srv_read_only_mode
1507-
|| srv_force_recovery > SRV_FORCE_NO_TRX_UNDO;
1507+
|| srv_force_recovery > SRV_FORCE_NO_TRX_UNDO
1508+
|| srv_sys_space.created_new_raw();
15081509

15091510
/* Reset the start state. */
15101511
srv_start_state = SRV_START_STATE_NONE;

0 commit comments

Comments
 (0)