From e4eebd5d4aca808305e42b75585ebcd516e21d88 Mon Sep 17 00:00:00 2001 From: liangwenjia <1757640220@qq.com> Date: Mon, 13 May 2024 22:23:24 +0800 Subject: [PATCH] adapt 8.0.35 --- plugin/thread_pool/CMakeLists.txt | 16 +++++++++++-- plugin/thread_pool/threadpool_common.cc | 32 +++++++++++++++++++++---- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/plugin/thread_pool/CMakeLists.txt b/plugin/thread_pool/CMakeLists.txt index 71e77f966..595ca67a9 100644 --- a/plugin/thread_pool/CMakeLists.txt +++ b/plugin/thread_pool/CMakeLists.txt @@ -13,16 +13,28 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +INCLUDE(${CMAKE_SOURCE_DIR}/cmake/mysql_version.cmake) -ADD_COMPILE_DEFINITIONS( - COMPILE_DEFINITIONS MYSQL_DYNAMIC_PLUGIN) +IF(VERSION VERSION_GREATER_EQUAL "8.0.27") + MY_ADD_COMPILE_DEFINITIONS( + COMPILE_DEFINITIONS MYSQL_DYNAMIC_PLUGIN) +ELSE() + ADD_COMPILE_DEFINITIONS( + COMPILE_DEFINITIONS MYSQL_DYNAMIC_PLUGIN) +ENDIF() +IF(VERSION VERSION_GREATER_EQUAL "8.0.33") + SET(RAPIDJSON_OPT "extra::rapidjson") +ELSE() + SET(RAPIDJSON_OPT "") +ENDIF() MYSQL_ADD_PLUGIN(thread_pool numa_affinity_manager.cc threadpool_common.cc threadpool_unix.cc LINK_LIBRARIES + ${RAPIDJSON_OPT} numa MODULE_ONLY MODULE_OUTPUT_NAME "thread_pool" diff --git a/plugin/thread_pool/threadpool_common.cc b/plugin/thread_pool/threadpool_common.cc index 1e646c7eb..57d9778c2 100644 --- a/plugin/thread_pool/threadpool_common.cc +++ b/plugin/thread_pool/threadpool_common.cc @@ -604,7 +604,13 @@ static ST_FIELD_INFO groups_fields_info[] = } // namespace Show -static int groups_fill_table(THD* thd, TABLE_LIST* tables, Item*) +static int groups_fill_table(THD* thd, +#if (MYSQL_VERSION_ID>80031) + Table_ref* tables, +#else + TABLE_LIST* tables, +#endif +Item*) { if (!all_groups) return 0; @@ -675,7 +681,13 @@ static ST_FIELD_INFO queues_field_info[] = typedef connection_queue_t::Iterator connection_queue_iterator; -static int queues_fill_table(THD* thd, TABLE_LIST* tables, Item*) +static int queues_fill_table(THD* thd, +#if (MYSQL_VERSION_ID>80031) + Table_ref* tables, +#else + TABLE_LIST* tables, +#endif +Item*) { if (!all_groups) return 0; @@ -758,7 +770,13 @@ static ST_FIELD_INFO stats_fields_info[] = } // namespace Show -static int stats_fill_table(THD* thd, TABLE_LIST* tables, Item*) +static int stats_fill_table(THD* thd, +#if (MYSQL_VERSION_ID>80031) + Table_ref* tables, +#else + TABLE_LIST* tables, +#endif +Item*) { if (!all_groups) return 0; @@ -830,7 +848,13 @@ static const LEX_CSTRING wait_reasons[THD_WAIT_LAST] = extern std::atomic tp_waits[THD_WAIT_LAST]; -static int waits_fill_table(THD* thd, TABLE_LIST* tables, Item*) +static int waits_fill_table(THD* thd, +#if (MYSQL_VERSION_ID>80031) + Table_ref* tables, +#else + TABLE_LIST* tables, +#endif +Item*) { if (!all_groups) return 0; -- Gitee