revert deprecate eof

This commit is contained in:
Dapeng Huang 2018-01-22 20:26:43 +08:00
parent f41f3a1544
commit 1729d73b19

View File

@ -1231,8 +1231,6 @@ create_capabilities(MySQLProtocol *conn, bool with_ssl, bool db_specified, bool
}
/** add session track */
final_capabilities |= (uint32_t)GW_MYSQL_CAPABILITIES_SESSION_TRACK;
/** support deprecate eof */
final_capabilities |= (uint32_t)GW_MYSQL_CAPABILITIES_DEPRECATE_EOF;
/* Compression is not currently supported */
ss_dassert(!compress);
@ -1860,6 +1858,14 @@ void mxs_mysql_get_session_track_info(GWBUF *buff, MySQLProtocol *proto)
size_t packet_len = gw_mysql_get_byte3(header_and_command);
uint8_t cmd = header_and_command[MYSQL_COM_OFFSET];
if (packet_len > MYSQL_OK_PACKET_MIN_LEN &&
cmd == MYSQL_REPLY_OK &&
(proto->num_eof_packets % 2) == 0)
{
buff->gwbuf_type |= GWBUF_TYPE_REPLY_OK;
mxs_mysql_parse_ok_packet(buff, offset, packet_len);
}
if ((proto->current_command == MXS_COM_QUERY ||
proto->current_command == MXS_COM_STMT_FETCH ||
proto->current_command == MXS_COM_STMT_EXECUTE) &&
@ -1867,20 +1873,7 @@ void mxs_mysql_get_session_track_info(GWBUF *buff, MySQLProtocol *proto)
{
proto->num_eof_packets++;
}
if (packet_len > MYSQL_OK_PACKET_MIN_LEN &&
(proto->num_eof_packets % 2) == 0)
{
/* ok packet or deprecated eof */
if (cmd == MYSQL_REPLY_OK ||
(cmd == MYSQL_REPLY_EOF &&
proto->server_capabilities & GW_MYSQL_CAPABILITIES_DEPRECATE_EOF))
{
buff->gwbuf_type |= GWBUF_TYPE_REPLY_OK;
mxs_mysql_parse_ok_packet(buff, offset, packet_len);
}
}
offset += (packet_len + + MYSQL_HEADER_LEN);
offset += (packet_len + MYSQL_HEADER_LEN);
}
}
}