From 7e6009071a630bb9990da12ba0b74b18fe9038e3 Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Mon, 19 Apr 2021 17:08:44 +0800 Subject: [PATCH] fix bug --- src/query/src/qAggMain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index 505057ef33..f312b4ab64 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -2615,6 +2615,10 @@ static void top_function_f(SQLFunctionCtx *pCtx, int32_t index) { STopBotInfo *pRes = getTopBotOutputInfo(pCtx); assert(pRes->num >= 0); + + if ((void *)pRes->res[0] != (void *)((char *)pRes + sizeof(STopBotInfo) + POINTER_BYTES * pCtx->param[0].i64)) { + buildTopBotStruct(pRes, pCtx); + } SET_VAL(pCtx, 1, 1); TSKEY ts = GET_TS_DATA(pCtx, index); -- GitLab