1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-04 01:23:45 +03:00

online alter: relax the lock to upgrade to on the last replication stage

This will allow selects pass until the rename/commit stage.
The lock is anyway upgraded to MDL_EXCLUSIVE later by the
wait_while_table_is_used call in mysql_alter_table.
This commit is contained in:
Nikita Malyavin
2024-01-31 19:59:07 +01:00
parent dccce98388
commit 3059f274fb

View File

@ -12354,7 +12354,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
DEBUG_SYNC(thd, "alter_table_online_before_lock"); DEBUG_SYNC(thd, "alter_table_online_before_lock");
int lock_error= int lock_error=
thd->mdl_context.upgrade_shared_lock(from->mdl_ticket, MDL_EXCLUSIVE, thd->mdl_context.upgrade_shared_lock(from->mdl_ticket, MDL_SHARED_NO_WRITE,
(double)thd->variables.lock_wait_timeout); (double)thd->variables.lock_wait_timeout);
if (!error) if (!error)
error= lock_error; error= lock_error;