提交 8317e1a6 编写于 作者: weixin_48148422's avatar weixin_48148422

TD-97: extract table name from id

上级 7bb402ea
...@@ -1199,7 +1199,9 @@ tExprNode* exprTreeFromTableName(const char* tbnameCond) { ...@@ -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) { ...@@ -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);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册