diff --git a/dbms/src/TiDB/Schema/SchemaBuilder.cpp b/dbms/src/TiDB/Schema/SchemaBuilder.cpp index ff33991ba61..696f07d08d0 100644 --- a/dbms/src/TiDB/Schema/SchemaBuilder.cpp +++ b/dbms/src/TiDB/Schema/SchemaBuilder.cpp @@ -764,6 +764,24 @@ 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 fa726504e69..79e7da626e8 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="system"