diff --git a/dbms/src/TiDB/Schema/SchemaBuilder.cpp b/dbms/src/TiDB/Schema/SchemaBuilder.cpp index 8e1866daddb..f19b2bcbc06 100644 --- a/dbms/src/TiDB/Schema/SchemaBuilder.cpp +++ b/dbms/src/TiDB/Schema/SchemaBuilder.cpp @@ -757,6 +757,25 @@ void SchemaBuilder::applyRenamePhysicalTable( template void SchemaBuilder::applyExchangeTablePartition(const SchemaDiff & diff) { + if (diff.old_table_id == diff.table_id && diff.old_schema_id == diff.schema_id) + { + // Only internal changes in non-partitioned table, not affecting TiFlash + LOG_DEBUG( + log, + "Table is going to be exchanged, skipping for now. database_id={} table_id={}", + diff.schema_id, + diff.table_id); + return; + } + LOG_DEBUG( + log, + "Table and partition is exchanged. database_id={} table_id={}, part_db_id={}, part_table_id={} partition_id={}", + diff.old_schema_id, + diff.old_table_id, + diff.affected_opts[0].schema_id, + diff.affected_opts[0].table_id, + diff.table_id); + /// Exchange table partition is used for ddl: /// alter table partition_table exchange partition partition_name with table non_partition_table /// It involves three table/partition: partition_table, partition_name and non_partition_table diff --git a/tests/_env.sh b/tests/_env.sh index 0accf9c50c6..d038115cf72 100644 --- a/tests/_env.sh +++ b/tests/_env.sh @@ -33,7 +33,7 @@ fi export storage_server="127.0.0.1" # Server port for connecting -export storage_port="9000" +export storage_port=${storage_port:-9000} # Default database for scripts export storage_db="default"