fix: prevent slice panic on multi-byte UTF-8 in DDL log truncation

This commit is contained in:
dqn
2026-06-05 01:37:20 +08:00
parent 0887b96236
commit 36374edfc2
+1 -1
View File
@@ -2146,7 +2146,7 @@ where
source_db_type,
table_comment.as_deref(),
);
log::info!("[transfer] creating target table: {}", &ddl[..ddl.len().min(200)]);
log::info!("[transfer] creating target table: {}", ddl.chars().take(200).collect::<String>());
let table_exists = match execute_on_pool(state, target_pool_key, &ddl).await {
Ok(_) => true,
Err(e) => {