Send the OK outside the KILL functions

By sending the OK for the KILL commands outside the function, they can be
used to kill connections that do not expect responses.
This commit is contained in:
Markus Mäkelä 2019-06-13 16:44:26 +03:00
parent f5c239cc8d
commit 8311dba654
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 3 additions and 4 deletions

View File

@ -2030,6 +2030,7 @@ static spec_com_res_t process_special_commands(DCB* dcb, GWBUF* read_buffer, int
{
uint64_t process_id = gw_mysql_get_byte4(bytes);
mxs_mysql_execute_kill(dcb->session, process_id, KT_CONNECTION);
mxs_mysql_send_ok(dcb, 1, 0, NULL);
rval = RES_END;
}
}
@ -2106,6 +2107,8 @@ spec_com_res_t handle_query_kill(DCB* dcb,
{
mxs_mysql_execute_kill_user(dcb->session, user.c_str(), kt);
}
mxs_mysql_send_ok(dcb, 1, 0, NULL);
}
}
}

View File

@ -1445,8 +1445,6 @@ void mxs_mysql_execute_kill(MXS_SESSION* issuer, uint64_t target_id, kill_type_t
(intptr_t)worker_func,
(intptr_t) new ConnKillInfo(target_id, ss.str(), issuer));
}
mxs_mysql_send_ok(issuer->client_dcb, 1, 0, NULL);
}
void mxs_mysql_execute_kill_user(MXS_SESSION* issuer, const char* user, kill_type_t type)
@ -1465,8 +1463,6 @@ void mxs_mysql_execute_kill_user(MXS_SESSION* issuer, const char* user, kill_typ
(intptr_t)worker_func,
(intptr_t) new UserKillInfo(user, ss.str(), issuer));
}
mxs_mysql_send_ok(issuer->client_dcb, 1, 0, NULL);
}
/**