From e9fe84f42acc82dadce28fdb3ea0a0aba4fd081f Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sun, 4 Apr 2021 23:37:01 +0800 Subject: [PATCH] [td-3664]:fix bug in top/bottom query. --- src/client/src/tscLocalMerge.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscLocalMerge.c b/src/client/src/tscLocalMerge.c index 89642a067d..851f7398db 100644 --- a/src/client/src/tscLocalMerge.c +++ b/src/client/src/tscLocalMerge.c @@ -1159,9 +1159,10 @@ static void fillMultiRowsOfTagsVal(SQueryInfo *pQueryInfo, int32_t numOfRes, SLo memset(buf, 0, (size_t)maxBufSize); memcpy(buf, pCtx->pOutput, (size_t)pCtx->outputBytes); + char* next = pCtx->pOutput; for (int32_t i = 0; i < inc; ++i) { - pCtx->pOutput += pCtx->outputBytes; - memcpy(pCtx->pOutput, buf, (size_t)pCtx->outputBytes); + next += pCtx->outputBytes; + memcpy(next, buf, (size_t)pCtx->outputBytes); } } -- GitLab