From 8a7d384b220dba786d761bec966cf32d6dbee7db Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Fri, 24 Sep 2021 09:07:43 +0800 Subject: [PATCH] fix csum/mavg order by ts desc error --- src/query/src/qAggMain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index ce870fb2ea..80e7304e59 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -4558,7 +4558,7 @@ static void csum_function(SQLFunctionCtx *pCtx) { int32_t notNullElems = 0; int32_t step = GET_FORWARD_DIRECTION_FACTOR(pCtx->order); - int32_t i = (pCtx->order = TSDB_ORDER_ASC) ? 0 : pCtx->size -1; + int32_t i = (pCtx->order == TSDB_ORDER_ASC) ? 0 : pCtx->size -1; TSKEY* pTimestamp = pCtx->ptsOutputBuf; TSKEY* tsList = GET_TS_LIST(pCtx); @@ -4623,7 +4623,7 @@ static void mavg_function(SQLFunctionCtx *pCtx) { int32_t notNullElems = 0; int32_t step = GET_FORWARD_DIRECTION_FACTOR(pCtx->order); - int32_t i = (pCtx->order = TSDB_ORDER_ASC) ? 0 : pCtx->size -1; + int32_t i = (pCtx->order == TSDB_ORDER_ASC) ? 0 : pCtx->size -1; TSKEY* pTimestamp = pCtx->ptsOutputBuf; char* pOutput = pCtx->pOutput; -- GitLab