diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-11-11 12:56:33 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2021-11-11 15:12:30 +0530 |
commit | 33b64f89803042849b16089754506532a46a7eff (patch) | |
tree | 2e8f583e45f453fd04c87541e8642981ac1eb3ba /sql/sql_table.cc | |
parent | 3480c3f95b27c8f3e6f4ecbe6262e5b80109c0d4 (diff) | |
download | mariadb-git-bb-10.6-MDEV-23805.tar.gz |
MDEV-23805 Make Online DDL to Instant DDL when table is emptybb-10.6-MDEV-23805
- In ha_innobase::prepare_inplace_alter_table(), InnoDB should
check whether the table is empty. If the table is empty then
server should avoid downgrading the MDL after prepare phase.
It is more like instant alter, does change only in dicationary
and metadata.
- Changed few debug test case to make non-empty DDL table
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 6ab73458755..07b4174e75d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -7367,7 +7367,8 @@ static bool mysql_inplace_alter_table(THD *thd, necessary only for prepare phase (unless we are not under LOCK TABLES) and user has not explicitly requested exclusive lock. */ - if ((inplace_supported == HA_ALTER_INPLACE_COPY_NO_LOCK || + if (!ha_alter_info->mdl_exclusive_after_prepare && + (inplace_supported == HA_ALTER_INPLACE_COPY_NO_LOCK || inplace_supported == HA_ALTER_INPLACE_COPY_LOCK || inplace_supported == HA_ALTER_INPLACE_NOCOPY_LOCK || inplace_supported == HA_ALTER_INPLACE_NOCOPY_NO_LOCK) && |