MXS-661: Only COM_QUERY packets are parsed
Parsing on non-COM_QUERY packets caused errors in the parsing of the queries. Only valid packets should be parsed.
This commit is contained in:
@ -1956,6 +1956,8 @@ static int routeQuery(ROUTER* instance,
|
||||
goto retblock;
|
||||
}
|
||||
|
||||
qc_query_op_t op = QUERY_OP_UNDEFINED;
|
||||
|
||||
switch(packet_type)
|
||||
{
|
||||
case MYSQL_COM_QUIT: /*< 1 QUIT will close all sessions */
|
||||
@ -1977,6 +1979,7 @@ static int routeQuery(ROUTER* instance,
|
||||
|
||||
case MYSQL_COM_QUERY:
|
||||
qtype = qc_get_type(querybuf);
|
||||
op = qc_get_operation(querybuf);
|
||||
break;
|
||||
|
||||
case MYSQL_COM_STMT_PREPARE:
|
||||
@ -2028,8 +2031,6 @@ static int routeQuery(ROUTER* instance,
|
||||
* all of them.
|
||||
*/
|
||||
|
||||
qc_query_op_t op = qc_get_operation(querybuf);
|
||||
|
||||
if (packet_type == MYSQL_COM_INIT_DB || op == QUERY_OP_CHANGE_DB)
|
||||
{
|
||||
spinlock_acquire(&router_cli_ses->shardmap->lock);
|
||||
|
Reference in New Issue
Block a user