From da82e75901644b0f9ea25b526e13b4db1c9c8e63 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 24 Jan 2020 00:44:48 +0400 Subject: handler::rebind() - rename PFS specific rebind_psi() to generic rebind() - call rebind independently of PFS compilation status - allow rebind() return an error --- storage/mroonga/ha_mroonga.cpp | 23 ++++++++++++++--------- storage/mroonga/ha_mroonga.hpp | 6 +++--- 2 files changed, 17 insertions(+), 12 deletions(-) (limited to 'storage/mroonga') diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp index 5cdf062922b..d2a83dffaaf 100644 --- a/storage/mroonga/ha_mroonga.cpp +++ b/storage/mroonga/ha_mroonga.cpp @@ -17023,34 +17023,39 @@ void ha_mroonga::unbind_psi() DBUG_VOID_RETURN; } -void ha_mroonga::wrapper_rebind_psi() +int ha_mroonga::wrapper_rebind() { MRN_DBUG_ENTER_METHOD(); MRN_SET_WRAP_SHARE_KEY(share, table->s); MRN_SET_WRAP_TABLE_KEY(this, table); - wrap_handler->rebind_psi(); + int error= wrap_handler->rebind(); MRN_SET_BASE_SHARE_KEY(share, table->s); MRN_SET_BASE_TABLE_KEY(this, table); - DBUG_VOID_RETURN; + DBUG_RETURN(error); } -void ha_mroonga::storage_rebind_psi() +void ha_mroonga::storage_rebind() { MRN_DBUG_ENTER_METHOD(); DBUG_VOID_RETURN; } -void ha_mroonga::rebind_psi() +int ha_mroonga::rebind() { MRN_DBUG_ENTER_METHOD(); - handler::rebind_psi(); + if (int error= handler::rebind()) + DBUG_RETURN(error); if (share->wrapper_mode) { - wrapper_rebind_psi(); + if (int error= wrapper_rebind()) + { + handler::unbind_psi(); + DBUG_RETURN(error); + } } else { - storage_rebind_psi(); + storage_rebind(); } - DBUG_VOID_RETURN; + DBUG_RETURN(0); } #endif diff --git a/storage/mroonga/ha_mroonga.hpp b/storage/mroonga/ha_mroonga.hpp index 4e3f4bec17c..632e45dab12 100644 --- a/storage/mroonga/ha_mroonga.hpp +++ b/storage/mroonga/ha_mroonga.hpp @@ -631,7 +631,7 @@ protected: void free_foreign_key_create_info(char* str) mrn_override; #ifdef MRN_HAVE_HA_REBIND_PSI void unbind_psi() mrn_override; - void rebind_psi() mrn_override; + int rebind() mrn_override; #endif my_bool register_query_cache_table(THD *thd, const char *table_key, @@ -1290,8 +1290,8 @@ private: #ifdef MRN_HAVE_HA_REBIND_PSI void wrapper_unbind_psi(); void storage_unbind_psi(); - void wrapper_rebind_psi(); - void storage_rebind_psi(); + int wrapper_rebind(); + void storage_rebind(); #endif my_bool wrapper_register_query_cache_table(THD *thd, const char *table_key, -- cgit v1.2.1