Validate attribute prefix existance on query string

pull/6763/head^2
Gokhan Gulbiz 2023-03-13 13:24:27 +03:00
parent 6d8cd8a9a0
commit 21298f6661
No known key found for this signature in database
GPG Key ID: 608EF06B6BD1B45B
1 changed files with 19 additions and 21 deletions

View File

@ -33,7 +33,7 @@ static void AttributeMetricsIfApplicable(void);
ExecutorEnd_hook_type prev_ExecutorEnd = NULL;
#define ATTRIBUTE_PREFIX "/*{"
#define ATTRIBUTE_PREFIX "{\"tId\":"
#define ATTRIBUTE_STRING_FORMAT "/*{\"tId\":%s,\"cId\":%d}*/"
#define CITUS_STATS_TENANTS_COLUMNS 7
#define ONE_QUERY_SCORE 1000000000
@ -202,6 +202,8 @@ AttributeQueryIfAnnotated(const char *query_string, CmdType commandType)
return;
}
if (strncmp(ATTRIBUTE_PREFIX, query_string, strlen(ATTRIBUTE_PREFIX)) == 0)
{
char *annotation = extractTopComment(query_string);
if (annotation != NULL)
{
@ -224,12 +226,8 @@ AttributeQueryIfAnnotated(const char *query_string, CmdType commandType)
colocationGroupId)));
}
}
else
{
strcpy_s(attributeToTenant, sizeof(attributeToTenant), "");
}
/*DetachSegment(); */
attributeToTenantStart = clock();
}