From e99e86e7ad55e4e0257043b71158231a5c570729 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Mon, 16 May 2022 13:53:56 +0800 Subject: [PATCH] fix: default subquery order by ts with interval --- src/client/src/tscSQLParser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 4dd0327a82..e9e32bca78 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -9775,6 +9775,9 @@ static int32_t doValidateSubquery(SSqlNode* pSqlNode, int32_t index, SSqlObj* pS tstrncpy(pTableMetaInfo1->aliasName, subInfo->aliasName.z, subInfo->aliasName.n + 1); } + if (TPARSER_HAS_TOKEN(pSqlNode->interval.interval) && pSub->order.orderColId == INT32_MIN) { + pSub->order.orderColId = PRIMARYKEY_TIMESTAMP_COL_INDEX; + } // NOTE: order mix up in subquery not support yet. pQueryInfo->order = pSub->order; -- GitLab