From 1277f9b4513a0f4c3303a41e142465dc7e403ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 24 Mar 2025 12:00:30 +0200 Subject: [PATCH] MDEV-36372: Compilation is broken with the PLUGIN_PARTITION=NO Fixed a compilation error caused by MDEV-27861 that occurs when building with cmake -DPLUGIN_PARTITION=NO, because the default_part_plugin variable is only visible when WITH_PARTITION_STORAGE_ENGINE is defined. Signed-off-by: Julius Goryavsky --- sql/sql_truncate.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index e86325d31a5..863c1bd795e 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -271,7 +271,7 @@ Sql_cmd_truncate_table::handler_truncate(THD *thd, TABLE_LIST *table_ref, bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref, bool *hton_can_recreate) { - handlerton *hton; + const handlerton *hton; bool versioned; bool sequence= false; TABLE *table= NULL; @@ -342,8 +342,12 @@ bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref, table we need to find out default partition handlerton. */ - const handlerton *ht= share->default_part_plugin ? - plugin_hton(share->default_part_plugin) : hton; + const handlerton* const ht= +#ifdef WITH_PARTITION_STORAGE_ENGINE + share->default_part_plugin ? + plugin_hton(share->default_part_plugin) : +#endif + hton; if (ht && !wsrep_should_replicate_ddl(thd, ht)) {