Remove explicit calls to parse_query.
Now that all query classifier functions parse the query if it has not been parsed, there is no reason for any module to call parse_query explicitly.
This commit is contained in:
@ -1125,19 +1125,7 @@ routeQuery(FILTER *instance, void *session, GWBUF *queue)
|
|||||||
|
|
||||||
if (modutil_is_SQL(queue))
|
if (modutil_is_SQL(queue))
|
||||||
{
|
{
|
||||||
|
success = true;
|
||||||
/**Parse the query*/
|
|
||||||
|
|
||||||
if (!query_is_parsed(queue))
|
|
||||||
{
|
|
||||||
success = parse_query(queue);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!success)
|
|
||||||
{
|
|
||||||
MXS_ERROR("Parsing query failed.");
|
|
||||||
goto send_downstream;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!my_instance->log_all)
|
if (!my_instance->log_all)
|
||||||
{
|
{
|
||||||
|
@ -316,11 +316,6 @@ time_t now = time(NULL);
|
|||||||
queue = gwbuf_make_contiguous(queue);
|
queue = gwbuf_make_contiguous(queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!query_is_parsed(queue))
|
|
||||||
{
|
|
||||||
parse_query(queue);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(query_classifier_get_operation(queue) & (QUERY_OP_DELETE|QUERY_OP_INSERT|QUERY_OP_UPDATE))
|
if(query_classifier_get_operation(queue) & (QUERY_OP_DELETE|QUERY_OP_INSERT|QUERY_OP_UPDATE))
|
||||||
{
|
{
|
||||||
if((sql = modutil_get_SQL(queue)) != NULL)
|
if((sql = modutil_get_SQL(queue)) != NULL)
|
||||||
|
@ -522,10 +522,6 @@ char* get_shard_target_name(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client,
|
|||||||
char* rval = NULL,*query, *tmp = NULL;
|
char* rval = NULL,*query, *tmp = NULL;
|
||||||
bool has_dbs = false; /**If the query targets any database other than the current one*/
|
bool has_dbs = false; /**If the query targets any database other than the current one*/
|
||||||
|
|
||||||
if(!query_is_parsed(buffer)){
|
|
||||||
parse_query(buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
dbnms = skygw_get_database_names(buffer,&sz);
|
dbnms = skygw_get_database_names(buffer,&sz);
|
||||||
|
|
||||||
HASHTABLE* ht = client->shardmap->hash;
|
HASHTABLE* ht = client->shardmap->hash;
|
||||||
|
@ -447,11 +447,6 @@ get_shard_target_name(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client, GWBUF*
|
|||||||
char *query = NULL,*tmp = NULL;
|
char *query = NULL,*tmp = NULL;
|
||||||
bool has_dbs = false; /**If the query targets any database other than the current one*/
|
bool has_dbs = false; /**If the query targets any database other than the current one*/
|
||||||
|
|
||||||
if(!query_is_parsed(buffer))
|
|
||||||
{
|
|
||||||
parse_query(buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
dbnms = skygw_get_database_names(buffer, &sz);
|
dbnms = skygw_get_database_names(buffer, &sz);
|
||||||
|
|
||||||
if(sz > 0)
|
if(sz > 0)
|
||||||
|
Reference in New Issue
Block a user