From 7199b01f3d7f2d1f642b66fd8fff4ee19b9e3af8 Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Thu, 22 Apr 2021 11:32:32 +0800 Subject: [PATCH] fix bug --- src/client/src/tscSQLParser.c | 2 +- src/query/inc/qSqlparser.h | 2 +- src/query/src/qSqlParser.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 3ede49c71e..16523571c6 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -3096,7 +3096,7 @@ static int32_t doExtractColumnFilterInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, } else if ((colType == TSDB_DATA_TYPE_TIMESTAMP) && (TSDB_DATA_TYPE_BIGINT == pRight->value.nType)) { STableComInfo tinfo = tscGetTableInfo(pTableMeta); - if ((tinfo.precision == TSDB_TIME_PRECISION_MILLI) && (pRight->flags & (1 << EXPR_FLAG_NOW))) { + if ((tinfo.precision == TSDB_TIME_PRECISION_MILLI) && (pRight->flags & (1 << EXPR_FLAG_US_TIMESTAMP))) { pRight->value.i64 /= 1000; } } diff --git a/src/query/inc/qSqlparser.h b/src/query/inc/qSqlparser.h index 8c96ac2b94..1d62b10c37 100644 --- a/src/query/inc/qSqlparser.h +++ b/src/query/inc/qSqlparser.h @@ -45,7 +45,7 @@ enum SQL_NODE_FROM_TYPE { }; enum SQL_EXPR_FLAG { - EXPR_FLAG_NOW = 1 + EXPR_FLAG_US_TIMESTAMP = 1 }; extern char tTokenTypeSwitcher[13]; diff --git a/src/query/src/qSqlParser.c b/src/query/src/qSqlParser.c index 1dde47e876..45b0fb0ec2 100644 --- a/src/query/src/qSqlParser.c +++ b/src/query/src/qSqlParser.c @@ -144,13 +144,14 @@ tSqlExpr *tSqlExprCreateIdValue(SStrToken *pToken, int32_t optrType) { pSqlExpr->value.nType = TSDB_DATA_TYPE_BIGINT; pSqlExpr->tokenId = TK_TIMESTAMP; // TK_TIMESTAMP used to denote the time value is in microsecond pSqlExpr->type = SQL_NODE_VALUE; - pSqlExpr->flags |= 1 << EXPR_FLAG_NOW; + pSqlExpr->flags |= 1 << EXPR_FLAG_US_TIMESTAMP; } else if (optrType == TK_VARIABLE) { int32_t ret = parseAbsoluteDuration(pToken->z, pToken->n, &pSqlExpr->value.i64); if (ret != TSDB_CODE_SUCCESS) { terrno = TSDB_CODE_TSC_SQL_SYNTAX_ERROR; } + pSqlExpr->flags |= 1 << EXPR_FLAG_US_TIMESTAMP; pSqlExpr->value.nType = TSDB_DATA_TYPE_BIGINT; pSqlExpr->tokenId = TK_TIMESTAMP; pSqlExpr->type = SQL_NODE_VALUE; -- GitLab