From 9150fb18890bb18beb2bf70ce166c8363e909384 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 1 Jul 2021 10:43:12 +0800 Subject: [PATCH] [td-4970]: limit/offset is not active in the outer query. --- src/client/src/tscSQLParser.c | 4 ++-- src/client/src/tscUtil.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index ac4a0bc9d8..329c9eee8f 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -5953,8 +5953,8 @@ int32_t validateLimitNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSqlN if (tscOrderedProjectionQueryOnSTable(pQueryInfo, 0)) { /* - * the offset value should be removed during retrieve data from virtual node, since the - * global order are done in client side, so the offset is applied at the client side + * The offset value should be removed during retrieve data from virtual node, since the + * global order are done at the client side, so the offset is applied at the client side. * However, note that the maximum allowed number of result for each table should be less * than or equal to the value of limit. */ diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index c74c0fa6cf..d366f4c4c7 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -2938,6 +2938,7 @@ int32_t tscQueryInfoCopy(SQueryInfo* pQueryInfo, const SQueryInfo* pSrc) { pQueryInfo->pTableMetaInfo = NULL; pQueryInfo->bufLen = pSrc->bufLen; + pQueryInfo->orderProjectQuery = pSrc->orderProjectQuery; pQueryInfo->buf = malloc(pSrc->bufLen); if (pQueryInfo->buf == NULL) { code = TSDB_CODE_TSC_OUT_OF_MEMORY; -- GitLab