diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index d015b4cf11c34da66a8483e6ed43e0977b0dce27..c8c73e4cf397f57054001b63ee405eb2bf168b17 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -4710,7 +4710,7 @@ static void copySampleFuncRes(SQLFunctionCtx *pCtx, int32_t type) { TSKEY* pTimestamp = pCtx->ptsOutputBuf; char* pOutput = pCtx->pOutput; for (int32_t i = 0; i < pRes->numSampled; ++i) { - assignVal(pOutput, pRes->values + i*pCtx->inputBytes, pRes->colBytes, type); + assignVal(pOutput, pRes->values + i*pRes->colBytes, pRes->colBytes, type); *pTimestamp = *(pRes->timeStamps + i); pOutput += pCtx->outputBytes;