From 4af2ab3d1d831c9f7225d6e06747bc92657863e8 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 5 Aug 2021 18:08:29 +0800 Subject: [PATCH] [TD-5822] optimize invalidate operation tips --- src/client/src/tscSQLParser.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 5739333886..f534140be9 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -7556,6 +7556,7 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { const char* msg6 = "from missing in subclause"; const char* msg7 = "time interval is required"; const char* msg8 = "the first column should be primary timestamp column"; + const char* msg9 = "Continuous query do not support sub query"; SSqlCmd* pCmd = &pSql->cmd; SQueryInfo* pQueryInfo = tscGetQueryInfo(pCmd); @@ -7576,7 +7577,11 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { if (pFromInfo == NULL || taosArrayGetSize(pFromInfo->list) == 0) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6); } - + + if (pFromInfo->type == SQL_NODE_FROM_SUBQUERY){ + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg9); + } + SRelElementPair* p1 = taosArrayGet(pFromInfo->list, 0); SStrToken srcToken = {.z = p1->tableName.z, .n = p1->tableName.n, .type = TK_STRING}; if (tscValidateName(&srcToken) != TSDB_CODE_SUCCESS) { -- GitLab