TD-97: extract table name from id

This commit is contained in:
localvar 2020-04-23 19:08:35 +08:00
parent 7bb402ea78
commit 8317e1a6ad
1 changed files with 4 additions and 5 deletions

View File

@ -1199,7 +1199,9 @@ tExprNode* exprTreeFromTableName(const char* tbnameCond) {
const char* cond = tbnameCond + QUERY_COND_REL_PREFIX_IN_LEN; const char* cond = tbnameCond + QUERY_COND_REL_PREFIX_IN_LEN;
for (const char *e = cond; *e != 0; e++) { for (const char *e = cond; *e != 0; e++) {
if (*e == ',') { if (*e == TS_PATH_DELIMITER[0]) {
cond = e + 1;
} else if (*e == ',') {
size_t len = e - cond + 1; size_t len = e - cond + 1;
char* p = malloc( len ); char* p = malloc( len );
memcpy(p, cond, len); memcpy(p, cond, len);
@ -1210,10 +1212,7 @@ tExprNode* exprTreeFromTableName(const char* tbnameCond) {
} }
if (*cond != 0) { if (*cond != 0) {
size_t len = strlen(cond) + 1; char* p = strdup( cond );
char* p = malloc( len );
memcpy(p, cond, len);
p[len - 1] = 0;
taosArrayPush(pVal->arr, &p); taosArrayPush(pVal->arr, &p);
} }