Fixed false positives in SHOW SHARDS detection.
This commit is contained in:
@ -4419,7 +4419,7 @@ static sescmd_cursor_t* backend_ref_get_sescmd_cursor (
|
|||||||
bool detect_show_shards(GWBUF* query)
|
bool detect_show_shards(GWBUF* query)
|
||||||
{
|
{
|
||||||
bool rval = false;
|
bool rval = false;
|
||||||
char* querystr;
|
char *querystr,*tok,*sptr;
|
||||||
|
|
||||||
if(query == NULL)
|
if(query == NULL)
|
||||||
{
|
{
|
||||||
@ -4438,8 +4438,11 @@ bool detect_show_shards(GWBUF* query)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strcasestr(querystr,"show shards") != NULL)
|
tok = strtok_r(querystr," ",&sptr);
|
||||||
|
if(tok && strcasecmp(tok,"show") == 0)
|
||||||
{
|
{
|
||||||
|
tok = strtok_r(NULL," ",&sptr);
|
||||||
|
if(tok && strcasecmp(tok,"shards") == 0)
|
||||||
rval = true;
|
rval = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user