From 1031e421aafec7d28fcf75cee1c1eb84bbc96208 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 15 Jun 2021 22:22:52 +0800 Subject: [PATCH] [TD-3086] tag support timestam --- src/client/src/tscSQLParser.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index e9a4f87cb0..75a81c2096 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -8007,28 +8007,21 @@ int32_t exprTreeFromSqlExpr(SSqlCmd* pCmd, tExprNode **pExpr, const tSqlExpr* pS assert(pSqlExpr->pRight == NULL); if (pSqlExpr->type == SQL_NODE_VALUE) { + int32_t ret = TSDB_CODE_SUCCESS; *pExpr = calloc(1, sizeof(tExprNode)); (*pExpr)->nodeType = TSQL_NODE_VALUE; (*pExpr)->pVal = calloc(1, sizeof(tVariant)); tVariantAssign((*pExpr)->pVal, &pSqlExpr->value); - int32_t type = -1; STableMeta* pTableMeta = tscGetMetaInfo(pQueryInfo, 0)->pTableMeta; if (pCols != NULL) { SColIndex* idx = taosArrayGet(pCols, 0); SSchema* pSchema = tscGetTableColumnSchema(pTableMeta, idx->colIndex); - if (pSchema != NULL) { - type = pSchema->type; - } - } - if (type == TSDB_DATA_TYPE_TIMESTAMP) { - int32_t ret = setColumnFilterInfoForTimestamp(pCmd, pQueryInfo, (*pExpr)->pVal); - if (ret != TSDB_CODE_SUCCESS) { - return ret; + if (pSchema != NULL && pSchema->type == TSDB_DATA_TYPE_TIMESTAMP) { + ret = setColumnFilterInfoForTimestamp(pCmd, pQueryInfo, (*pExpr)->pVal); } } - - return TSDB_CODE_SUCCESS; + return ret; } else if (pSqlExpr->type == SQL_NODE_SQLFUNCTION) { // arithmetic expression on the results of aggregation functions *pExpr = calloc(1, sizeof(tExprNode)); -- GitLab