From c1dea81d7813596a0b75fc04e85c39a07343a754 Mon Sep 17 00:00:00 2001 From: hopebo Date: Wed, 2 Mar 2022 09:53:03 +0800 Subject: [PATCH] Bugfix For EXCHANGE PARTITION, make partition table writable while validation --- sql/sql_partition_admin.cc | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc index 0f6535669bf..3ec7d0b0806 100644 --- a/sql/sql_partition_admin.cc +++ b/sql/sql_partition_admin.cc @@ -325,23 +325,11 @@ bool Sql_cmd_alter_table_exchange_partition::exchange_partition( return true; } - /* - Currently no MDL lock that allows both read and write and is upgradeable - to exclusive, so leave the lock type to TL_WRITE_ALLOW_READ also on the - partitioned table. - - TODO: add MDL lock that allows both read and write and is upgradable to - exclusive lock. This would allow to continue using the partitioned table - also with update/insert/delete while the verification of the swap table - is running. - */ - /* NOTE: It is not possible to exchange a crashed partition/table since we need some info from the engine, which we can only access after open, to be able to verify the structure/metadata. */ - table_list->mdl_request.set_type(MDL_SHARED_NO_WRITE); if (open_tables(thd, &table_list, &table_counter, 0, &alter_prelocking_strategy)) return true; -- 2.19.1.3.ge56e4f7