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:
Johan Wikman
2016-01-11 10:15:13 +02:00
parent 6e6ad67504
commit ec281849aa
4 changed files with 1 additions and 27 deletions

View File

@ -1125,19 +1125,7 @@ routeQuery(FILTER *instance, void *session, GWBUF *queue)
if (modutil_is_SQL(queue))
{
/**Parse the query*/
if (!query_is_parsed(queue))
{
success = parse_query(queue);
}
if (!success)
{
MXS_ERROR("Parsing query failed.");
goto send_downstream;
}
success = true;
if (!my_instance->log_all)
{

View File

@ -316,11 +316,6 @@ time_t now = time(NULL);
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((sql = modutil_get_SQL(queue)) != NULL)

View File

@ -522,10 +522,6 @@ char* get_shard_target_name(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client,
char* rval = NULL,*query, *tmp = NULL;
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);
HASHTABLE* ht = client->shardmap->hash;

View File

@ -447,11 +447,6 @@ get_shard_target_name(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client, GWBUF*
char *query = NULL,*tmp = NULL;
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);
if(sz > 0)