mysqladmin kill can't handle 64-bit thread IDs. (Bug #32457)

This commit is contained in:
Jim Winstead 2009-05-07 13:09:53 -07:00
parent 038be08a1b
commit 9345dbba6f

View File

@ -679,10 +679,16 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
pos=argv[1]; pos=argv[1];
for (;;) for (;;)
{ {
if (mysql_kill(mysql,(ulong) atol(pos))) /* We don't use mysql_kill(), since it only handles 32-bit IDs. */
char buff[26], *out; /* "KILL " + max 20 digs + NUL */
out= strxmov(buff, "KILL ", NullS);
ullstr(strtoull(pos, NULL, 0), out);
if (mysql_query(mysql, buff))
{ {
my_printf_error(0, "kill failed on %ld; error: '%s'", error_flags, /* out still points to just the number */
atol(pos), mysql_error(mysql)); my_printf_error(0, "kill failed on %s; error: '%s'", error_flags,
out, mysql_error(mysql));
error=1; error=1;
} }
if (!(pos=strchr(pos,','))) if (!(pos=strchr(pos,',')))