Removed corrupted error messages from readwritesplit
When a slave server fails to execute a session command, the log message printed the command that was being executed as if the ERR packet was a COM_QUERY packet. This caused corrupt strings to be printed into the error logs.
This commit is contained in:
@ -2793,21 +2793,17 @@ static void clientReply (
|
||||
uint8_t* replybuf = (uint8_t *)GWBUF_DATA(writebuf);
|
||||
size_t len = MYSQL_GET_PACKET_LEN(buf);
|
||||
size_t replylen = MYSQL_GET_PACKET_LEN(replybuf);
|
||||
char* cmdstr = strndup(&((char *)buf)[5], len-4);
|
||||
char* err = strndup(&((char *)replybuf)[8], 5);
|
||||
char* replystr = strndup(&((char *)replybuf)[13],
|
||||
replylen-4-5);
|
||||
|
||||
ss_dassert(len+4 == GWBUF_LENGTH(scur->scmd_cur_cmd->my_sescmd_buf));
|
||||
|
||||
MXS_ERROR("Failed to execute %s in %s:%d. %s %s",
|
||||
cmdstr,
|
||||
MXS_ERROR("Failed to execute session command in %s:%d. Error was: %s %s",
|
||||
bref->bref_backend->backend_server->name,
|
||||
bref->bref_backend->backend_server->port,
|
||||
err,
|
||||
replystr);
|
||||
|
||||
free(cmdstr);
|
||||
free(err);
|
||||
free(replystr);
|
||||
}
|
||||
|
Reference in New Issue
Block a user