1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.6 into 10.11

This commit is contained in:
Marko Mäkelä
2025-05-21 07:36:35 +03:00
71 changed files with 810 additions and 446 deletions

View File

@@ -8011,7 +8011,7 @@ static bool mysql_inplace_alter_table(THD *thd,
if (table->file->ha_prepare_inplace_alter_table(altered_table,
ha_alter_info))
goto rollback;
goto rollback_no_restore_lock;
debug_crash_here("ddl_log_alter_after_prepare_inplace");
@@ -8067,21 +8067,17 @@ static bool mysql_inplace_alter_table(THD *thd,
res= table->file->ha_inplace_alter_table(altered_table, ha_alter_info);
thd->abort_on_warning= false;
if (start_alter_id && wait_for_master(thd))
goto rollback;
if (res)
goto rollback;
if (res || (start_alter_id && wait_for_master(thd)))
goto rollback_no_restore_lock;
DEBUG_SYNC(thd, "alter_table_inplace_before_lock_upgrade");
// Upgrade to EXCLUSIVE before commit.
if (wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_RENAME))
goto rollback;
goto rollback_no_restore_lock;
/* Set MDL_BACKUP_DDL */
if (backup_reset_alter_copy_lock(thd))
goto rollback;
goto rollback_no_restore_lock;
/* Crashing here should cause the original table to be used */
debug_crash_here("ddl_log_alter_after_copy");
@@ -8110,7 +8106,7 @@ static bool mysql_inplace_alter_table(THD *thd,
if (!(table->file->partition_ht()->flags &
HTON_REQUIRES_NOTIFY_TABLEDEF_CHANGED_AFTER_COMMIT) &&
notify_tabledef_changed(table_list))
goto rollback;
goto rollback_restore_lock;
{
TR_table trt(thd, true);
@@ -8123,17 +8119,17 @@ static bool mysql_inplace_alter_table(THD *thd,
if (!TR_table::use_transaction_registry)
{
my_error(ER_VERS_TRT_IS_DISABLED, MYF(0));
goto rollback;
goto rollback_restore_lock;
}
if (trt.update(trx_start_id, trx_end_id))
goto rollback;
goto rollback_restore_lock;
}
}
if (table->file->ha_commit_inplace_alter_table(altered_table,
ha_alter_info,
true))
goto rollback;
goto rollback_restore_lock;
DEBUG_SYNC(thd, "alter_table_inplace_after_commit");
}
@@ -8230,7 +8226,11 @@ static bool mysql_inplace_alter_table(THD *thd,
DBUG_RETURN(commit_succeded_with_error);
rollback:
rollback_restore_lock:
/* Wait for backup if it is running */
backup_reset_alter_copy_lock(thd);
rollback_no_restore_lock:
table->file->ha_commit_inplace_alter_table(altered_table,
ha_alter_info,
false);
@@ -12414,7 +12414,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, bool ignore,
if (unlikely(mysql_trans_commit_alter_copy_data(thd)))
error= 1;
err:
end:
if (bulk_insert_started)
(void) to->file->ha_end_bulk_insert();
@@ -12445,6 +12445,10 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, bool ignore,
error= 1;
thd_progress_end(thd);
DBUG_RETURN(error > 0 ? -1 : 0);
err:
backup_reset_alter_copy_lock(thd);
goto end;
}