From d5394838fd586103ac13b39b95701114729a1dbd Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Mon, 13 May 2024 15:57:39 +0200 Subject: [PATCH] CONC-696: Replace COM_PROCESS_KILL by KILL command Since COM_PROCESS_KILL isn't supported by newer MySQL versions. --- libmariadb/mariadb_lib.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libmariadb/mariadb_lib.c b/libmariadb/mariadb_lib.c index 32e66bea..39e69243 100644 --- a/libmariadb/mariadb_lib.c +++ b/libmariadb/mariadb_lib.c @@ -2785,10 +2785,13 @@ mysql_refresh(MYSQL *mysql,uint options) int STDCALL mysql_kill(MYSQL *mysql,ulong pid) { - char buff[12]; - int4store(buff,pid); - /* if we kill our own thread, reading the response packet will fail */ - return(ma_simple_command(mysql, COM_PROCESS_KILL,buff,4,0,0)); + char buff[26]; + + if (pid & (~0xFFFFFFFFUL)) + snprintf(buff, sizeof buff, "KILL %llu", (ulonglong)pid); + else + snprintf(buff, sizeof buff, "KILL %lu", pid); + return mysql_real_query(mysql, (char *)buff, (ulong)strlen(buff)); }