From b4d1cbc52928c8e36845b501d0174484940fe296 Mon Sep 17 00:00:00 2001 From: Roman Nozdrin Date: Mon, 20 May 2019 19:10:21 +0300 Subject: [PATCH] MCOL-2178 upstream merge forces to add explicit namespaces. Add a magic value check to avoid cleanup procedures only if needed. --- dbcon/mysql/ha_calpont_impl.cpp | 4 ++-- dbcon/mysql/ha_calpont_impl_if.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dbcon/mysql/ha_calpont_impl.cpp b/dbcon/mysql/ha_calpont_impl.cpp index 989d9ea6b..8fe27ea0d 100644 --- a/dbcon/mysql/ha_calpont_impl.cpp +++ b/dbcon/mysql/ha_calpont_impl.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 InfiniDB, Inc. + /* Copyright (C) 2014 InfiniDB, Inc. Copyright (C) 2019 MariaDB Corporaton This program is free software; you can redistribute it and/or @@ -4203,7 +4203,7 @@ int ha_calpont_impl_close_connection (handlerton* hton, THD* thd) // An ugly way. I will use ha_data w/o external_lock. // This in MCOL-2178 cal_connection_info* ci = NULL; - if(thd_get_ha_data(thd, hton)) + if(thd_get_ha_data(thd, hton) != (void*)0x42) // 0x42 is the magic CS sets when setup hton { ci = reinterpret_cast(thd_get_ha_data(thd, hton)); } diff --git a/dbcon/mysql/ha_calpont_impl_if.h b/dbcon/mysql/ha_calpont_impl_if.h index 820f8d430..190ed620b 100644 --- a/dbcon/mysql/ha_calpont_impl_if.h +++ b/dbcon/mysql/ha_calpont_impl_if.h @@ -286,6 +286,7 @@ struct cal_connection_info std::stack cal_conn_hndl_st; int queryState; CalTableMap tableMap; + std::set physTablesList; sm::tableid_t currentTable; uint32_t traceFlags; std::string queryStats; @@ -337,8 +338,8 @@ const std::string infinidb_err_msg = "\nThe query includes syntax that is not su int cp_get_plan(THD* thd, execplan::SCSEP& csep); int cp_get_table_plan(THD* thd, execplan::SCSEP& csep, cal_impl_if::cal_table_info& ti); int cp_get_group_plan(THD* thd, execplan::SCSEP& csep, cal_impl_if::cal_group_info& gi); -int cs_get_derived_plan(derived_handler* handler, THD* thd, SCSEP& csep); -int cs_get_select_plan(select_handler* handler, THD* thd, SCSEP& csep); +int cs_get_derived_plan(derived_handler* handler, THD* thd, execplan::SCSEP& csep); +int cs_get_select_plan(select_handler* handler, THD* thd, execplan::SCSEP& csep); int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, execplan::SCSEP& csep, bool isUnion = false, bool isPushdownHand = false); int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, execplan::SCSEP& csep, cal_group_info& gi, bool isUnion = false); void setError(THD* thd, uint32_t errcode, const std::string errmsg, gp_walk_info* gwi);