mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-23295 ROW_FORMAT mismatch in instant ALTER TABLE
An instant ADD/DROP/reorder column could create a dummy table object with the wrong ROW_FORMAT when innodb_default_row_format was changed between CREATE TABLE and ALTER TABLE. prepare_inplace_alter_table_dict(): If we had promised that ALGORITHM=INPLACE is supported, we must preserve the ROW_FORMAT. dict_table_t::prepare_instant(): Add debug assertions to catch ROW_FORMAT mismatch. The rest of the changes are related to adding Alter_inplace_info::inplace_supported to cache the return value of handler::check_if_supported_inplace_alter().
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2016, 2018, MariaDB Corporation
|
||||
Copyright (c) 2016, 2020, MariaDB Corporation
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -127,10 +127,10 @@ const char* Alter_info::lock() const
|
||||
}
|
||||
|
||||
|
||||
bool Alter_info::supports_algorithm(THD *thd, enum_alter_inplace_result result,
|
||||
bool Alter_info::supports_algorithm(THD *thd,
|
||||
const Alter_inplace_info *ha_alter_info)
|
||||
{
|
||||
switch (result) {
|
||||
switch (ha_alter_info->inplace_supported) {
|
||||
case HA_ALTER_INPLACE_EXCLUSIVE_LOCK:
|
||||
case HA_ALTER_INPLACE_SHARED_LOCK:
|
||||
case HA_ALTER_INPLACE_NO_LOCK:
|
||||
@ -171,10 +171,10 @@ bool Alter_info::supports_algorithm(THD *thd, enum_alter_inplace_result result,
|
||||
}
|
||||
|
||||
|
||||
bool Alter_info::supports_lock(THD *thd, enum_alter_inplace_result result,
|
||||
bool Alter_info::supports_lock(THD *thd,
|
||||
const Alter_inplace_info *ha_alter_info)
|
||||
{
|
||||
switch (result) {
|
||||
switch (ha_alter_info->inplace_supported) {
|
||||
case HA_ALTER_INPLACE_EXCLUSIVE_LOCK:
|
||||
// If SHARED lock and no particular algorithm was requested, use COPY.
|
||||
if (requested_lock == Alter_info::ALTER_TABLE_LOCK_SHARED &&
|
||||
|
Reference in New Issue
Block a user