Skip to content

Commit a83fcba

Browse files
authored
MDEV-14632 Assertion `!((new_col->prtype ^ col->prtype) & ~256U)' failed in row_log_table_apply_convert_mrec
SQL: add exclusive lock to ADD/DROP SYSTEM VERSIONING clauses This is needed because Online DDL is not working yet for such queries.
1 parent bc4a866 commit a83fcba

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sql/handler.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7098,6 +7098,18 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info,
70987098
if (!need_check() && !share->versioned)
70997099
return false;
71007100

7101+
if (with_system_versioning || without_system_versioning)
7102+
{
7103+
// Disable Online DDL which is not implemented yet for ADD/DROP SYSTEM VERSIONING.
7104+
if (thd->mdl_context.upgrade_shared_lock(table->mdl_ticket, MDL_EXCLUSIVE,
7105+
thd->variables.lock_wait_timeout))
7106+
{
7107+
my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0));
7108+
return true;
7109+
}
7110+
alter_info->requested_lock= Alter_info::ALTER_TABLE_LOCK_EXCLUSIVE;
7111+
}
7112+
71017113
if (with_system_versioning && table->versioned())
71027114
{
71037115
my_error(ER_VERS_ALREADY_VERSIONED, MYF(0), table_name);

0 commit comments

Comments
 (0)