From bc7ffbbb7e12ec9d657c48d1c1fa9ade712a6178 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 6 Aug 2021 15:09:45 +0800 Subject: [PATCH] [TD-5833] fix 1 column error when create table use select _c0 from.. --- src/client/src/tscSQLParser.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 4154335bb4..cd92b4f507 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -7599,10 +7599,6 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { return code; } - if (taosArrayGetSize(pSqlNode->pSelNodeList) <= 1) { - return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg10); - } - if (validateSelectNodeList(&pSql->cmd, pQueryInfo, pSqlNode->pSelNodeList, false, false, false) != TSDB_CODE_SUCCESS) { return TSDB_CODE_TSC_INVALID_OPERATION; } @@ -7648,7 +7644,9 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { return TSDB_CODE_TSC_INVALID_OPERATION; } - pCmd->numOfCols = pQueryInfo->fieldsInfo.numOfOutput; + if (pQueryInfo->fieldsInfo.numOfOutput <= 1) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg10); + } if (validateSqlFunctionInStreamSql(pCmd, pQueryInfo) != TSDB_CODE_SUCCESS) { return TSDB_CODE_TSC_INVALID_OPERATION; -- GitLab