MXS-2485 Handle COM_STATISTICS and COM_STMT_FETCH. Rearrange a bit.
This commit is contained in:
@ -817,6 +817,12 @@ public:
|
||||
return m_command;
|
||||
}
|
||||
|
||||
bool server_will_respond() const
|
||||
{
|
||||
return m_command != MXS_COM_STMT_SEND_LONG_DATA // what?
|
||||
&& m_command != MXS_COM_QUIT
|
||||
&& m_command != MXS_COM_STMT_CLOSE;
|
||||
}
|
||||
private:
|
||||
uint8_t m_command;
|
||||
};
|
||||
|
||||
@ -27,7 +27,9 @@ class ComResponse;
|
||||
class PacketTracker
|
||||
{
|
||||
public:
|
||||
enum class State {FirstPacket, Field, FieldEof, ComFieldList, Row, Done, ErrorPacket, Error};
|
||||
enum class State {FirstPacket, Field, FieldEof, Row,
|
||||
ComFieldList, ComStatistics, ComStmtFetch,
|
||||
Done, ErrorPacket, Error};
|
||||
|
||||
PacketTracker() = default;
|
||||
explicit PacketTracker(GWBUF* pQuery); // Track this query
|
||||
@ -38,16 +40,19 @@ public:
|
||||
|
||||
private:
|
||||
// State functions.
|
||||
State first_packet(const ComResponse& com_packet);
|
||||
State field(const ComResponse& com_packet);
|
||||
State field_eof(const ComResponse& com_packet);
|
||||
State com_field_list(const ComResponse& com_packet);
|
||||
State row(const ComResponse& com_packet);
|
||||
State expect_no_more(const ComResponse& com_packet); // states: Done, ErrorPacket, Error
|
||||
State first_packet(const ComResponse& response);
|
||||
State field(const ComResponse& response);
|
||||
State field_eof(const ComResponse& response);
|
||||
State row(const ComResponse& response);
|
||||
State com_field_list(const ComResponse& response);
|
||||
State com_statistics(const ComResponse& response);
|
||||
State com_stmt_fetch(const ComResponse& response);
|
||||
|
||||
State expect_no_more(const ComResponse& response); // states: Done, ErrorPacket, Error
|
||||
|
||||
State m_state = State::Error;
|
||||
bool m_client_packet_bool = false;
|
||||
bool m_server_packet_bool = false;
|
||||
bool m_client_packet_internal = false;
|
||||
bool m_server_packet_internal = false;
|
||||
|
||||
int m_command;
|
||||
int m_total_fields;
|
||||
|
||||
Reference in New Issue
Block a user