From ae85835cc7fa88bb80a282106c1e905d85157923 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sun, 5 Sep 2021 19:37:13 +0200 Subject: [PATCH] Fix warnings from -DPLUGIN_PARTITION=NO, portably. Also fix Spider's cmake. --- sql/datadict.cc | 4 +++- sql/handler.cc | 4 +++- storage/spider/CMakeLists.txt | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sql/datadict.cc b/sql/datadict.cc index 5bde9f1cb79..783229a47a6 100644 --- a/sql/datadict.cc +++ b/sql/datadict.cc @@ -151,7 +151,9 @@ Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name, } } -cont: __attribute__((unused)); +#ifdef WITH_PARTITION_STORAGE_ENGINE +cont: +#endif /* read the true engine name */ { MY_STAT state; diff --git a/sql/handler.cc b/sql/handler.cc index 0c75d58c8ea..7a220068a7c 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -6201,7 +6201,9 @@ bool ha_table_exists(THD *thd, const LEX_CSTRING *db, DBUG_RETURN(TRUE); } -retry_from_frm: __attribute__((unused)); +#ifdef WITH_PARTITION_STORAGE_ENGINE +retry_from_frm: +#endif char path[FN_REFLEN + 1]; size_t path_len = build_table_filename(path, sizeof(path) - 1, db->str, table_name->str, "", 0); diff --git a/storage/spider/CMakeLists.txt b/storage/spider/CMakeLists.txt index 397478bfc40..898421fa532 100644 --- a/storage/spider/CMakeLists.txt +++ b/storage/spider/CMakeLists.txt @@ -73,7 +73,7 @@ IF(ORACLE_INCLUDE_DIR AND ORACLE_OCI_LIBRARY) ENDIF() ENDIF() -IF(MSVC) +IF(MSVC AND (TARGET spider)) IF (CMAKE_BUILD_TYPE STREQUAL "Debug") ADD_CUSTOM_COMMAND(TARGET spider POST_BUILD