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

Merge branch '3.3' into 3.4

This commit is contained in:
Georg Richter
2024-05-14 09:54:50 +02:00

View File

@@ -3313,10 +3313,17 @@ 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[16];
/* process id can't be larger than 4-bytes */
if (pid & (~0xFFFFFFFFUL))
{
my_set_error(mysql, CR_CONNECTION_ERROR, SQLSTATE_UNKNOWN, 0);
return 1;
}
snprintf(buff, sizeof buff, "KILL %lu", pid);
return mysql_real_query(mysql, (char *)buff, (ulong)strlen(buff));
}