From b7046b568d3db1d448975f7b5cf76258e7b84482 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Fri, 28 Oct 2022 11:51:43 +0800 Subject: [PATCH] fix: push down limit --- source/libs/planner/src/planOptimizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index e882f83225..0d65e8d8f5 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -1724,7 +1724,7 @@ static int32_t rewriteTailOptCreateLimit(SNode* pLimit, SNode* pOffset, SNode** return TSDB_CODE_OUT_OF_MEMORY; } pLimitNode->limit = NULL == pLimit ? -1 : ((SValueNode*)pLimit)->datum.i; - pLimitNode->offset = NULL == pOffset ? -1 : ((SValueNode*)pOffset)->datum.i; + pLimitNode->offset = NULL == pOffset ? 0 : ((SValueNode*)pOffset)->datum.i; *pOutput = (SNode*)pLimitNode; return TSDB_CODE_SUCCESS; } -- GitLab