From 00f4baf2624a40a4182e52564599ee01646e35e6 Mon Sep 17 00:00:00 2001 From: lijieac Date: Thu, 5 Jun 2025 20:19:43 +0800 Subject: [PATCH] fix: crash caused by alter-info is null --- storage/ctc/ha_ctc.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/storage/ctc/ha_ctc.cc b/storage/ctc/ha_ctc.cc index 94c4658..772d26c 100644 --- a/storage/ctc/ha_ctc.cc +++ b/storage/ctc/ha_ctc.cc @@ -1520,10 +1520,13 @@ bool is_dml_cmd(const String& sql) static int ctc_commit(handlerton *hton, THD *thd, bool commit_trx) { DBUG_TRACE; BEGIN_RECORD_STATS - bool is_alter_copy = is_alter_table_copy(thd); - if (engine_ddl_passthru(thd) && (is_alter_copy || is_create_table_check(thd) || is_lock_table(thd))) { - END_RECORD_STATS(EVENT_TYPE_COMMIT) - return 0; + bool is_alter_copy = false; + if (engine_ddl_passthru(thd)) { + is_alter_copy = is_alter_table_copy(thd); + if (is_alter_copy || is_create_table_check(thd) || is_lock_table(thd)) { + END_RECORD_STATS(EVENT_TYPE_COMMIT) + return 0; + } } ctc_handler_t tch; -- Gitee