From b551e85e852fa1a071c55d9f85b8b69c32aa5795 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 8 Mar 2022 14:22:21 +0800 Subject: [PATCH] [TD-11216]: Time window related keywords --- src/client/src/tscSQLParser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 76248393d4..9ee4397662 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -2411,6 +2411,7 @@ int32_t addProjectionExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, t const char* msg4 = "-> operate can only used in json type"; const char* msg5 = "the right value of -> operation must be string"; const char* msg6 = "select name is too long than 64, please use alias name"; + const char* msg7 = "_wstart/_wstop/_wduraion can only be applied to time window query"; int32_t startPos = (int32_t)tscNumOfExprs(pQueryInfo); int32_t tokenId = pItem->pNode->tokenId; @@ -2511,6 +2512,9 @@ int32_t addProjectionExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, t functionId = TSDB_FUNC_TAGPRJ; colType = TSDB_COL_TAG; } else { + if (!timeWindowQuery) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg7); + } colSchema = *tGetTimeWindowColumnSchema(index.columnIndex); switch (index.columnIndex) { case TSDB_TSWIN_START_COLUMN_INDEX: { -- GitLab