1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

CONC-696: Replace COM_PROCESS_KILL by KILL command

Since COM_PROCESS_KILL isn't supported by newer MySQL
versions.
This commit is contained in:
Georg Richter
2024-05-13 15:57:39 +02:00
parent 96bedf002a
commit d5394838fd

View File

@@ -2785,10 +2785,13 @@ mysql_refresh(MYSQL *mysql,uint options)
int STDCALL int STDCALL
mysql_kill(MYSQL *mysql,ulong pid) mysql_kill(MYSQL *mysql,ulong pid)
{ {
char buff[12]; char buff[26];
int4store(buff,pid);
/* if we kill our own thread, reading the response packet will fail */ if (pid & (~0xFFFFFFFFUL))
return(ma_simple_command(mysql, COM_PROCESS_KILL,buff,4,0,0)); 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));
} }