mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
MDEV-26458 Crash on ALTER TABLE after DISCARD TABLESPACE
ha_innobase::check_if_supported_inplace_alter(): Do not invoke
innobase_table_is_empty() if the tablespace has been discarded.
That is, native ALTER TABLE in InnoDB will treat an empty table
in the same way as a tablespace whose tablespace has been discarded.
(Note: ALTER TABLE...ALGORITHM=COPY will fail if the tablespace
has been discarded.)
This fixes a crash that was introduced
in commit c755974775 (MDEV-19611).
This commit is contained in:
parent
8a33d36dac
commit
7b492d6a70
3 changed files with 25 additions and 0 deletions
|
|
@ -1164,6 +1164,7 @@ ha_innobase::check_if_supported_inplace_alter(
|
|||
/* '0000-00-00' value isn't allowed for datetime datatype
|
||||
for newly added column when table is not empty */
|
||||
if (ha_alter_info->error_if_not_empty
|
||||
&& m_prebuilt->table->space
|
||||
&& !innobase_table_is_empty(m_prebuilt->table)) {
|
||||
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue