MXS-1776: Fix utility functions
The COM_STMT_FETCH command will create a response. This was a readwritesplit-specific interpretation of the command and it was wrong. Also record the currently executed command event for session commands.
This commit is contained in:
parent
ad5458f0e7
commit
fab8477c05
@ -1657,8 +1657,7 @@ bool mxs_mysql_command_will_respond(uint8_t cmd)
|
||||
{
|
||||
return cmd != MXS_COM_STMT_SEND_LONG_DATA &&
|
||||
cmd != MXS_COM_QUIT &&
|
||||
cmd != MXS_COM_STMT_CLOSE &&
|
||||
cmd != MXS_COM_STMT_FETCH;
|
||||
cmd != MXS_COM_STMT_CLOSE;
|
||||
}
|
||||
|
||||
typedef std::vector< std::pair<SERVER*, uint64_t> > TargetList;
|
||||
|
@ -527,6 +527,7 @@ bool reply_is_complete(SRWBackend& backend, GWBUF *buffer)
|
||||
int n_eof = modutil_count_signal_packets(buffer, 0, &more, &state);
|
||||
backend->set_large_packet(state.state);
|
||||
|
||||
// If the server responded with an error, n_eof > 0
|
||||
if (n_eof > 0 || backend->consume_fetched_rows(buffer))
|
||||
{
|
||||
LOG_RS(backend, REPLY_STATE_DONE);
|
||||
|
@ -30,7 +30,8 @@ RWBackend::~RWBackend()
|
||||
|
||||
bool RWBackend::execute_session_command()
|
||||
{
|
||||
bool expect_response = mxs_mysql_command_will_respond(next_session_command()->get_command());
|
||||
m_command = next_session_command()->get_command();
|
||||
bool expect_response = mxs_mysql_command_will_respond(m_command);
|
||||
bool rval = mxs::Backend::execute_session_command();
|
||||
|
||||
if (rval && expect_response)
|
||||
|
Loading…
x
Reference in New Issue
Block a user