From 97e7f0fec0e38a35233129facecffa9e3772d9dc Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 11 Aug 2021 23:03:24 +0800 Subject: [PATCH] [TD-5623]: fix passing pointer issue --- src/query/src/qExecutor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 40698dad20..7e67bd0526 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -4193,11 +4193,11 @@ static void updateNumOfRowsInResultRows(SQueryRuntimeEnv* pRuntimeEnv, SQLFuncti } } -static int32_t compressQueryColData(SColumnInfoData *pColRes, int32_t numOfRows, char *data, int8_t compressed) { +static int32_t compressQueryColData(SColumnInfoData *pColRes, int32_t numOfRows, char **data, int8_t compressed) { int32_t colLen = pColRes->info.bytes * numOfRows; - int32_t colCompLen = (*(tDataTypes[pColRes->info.type].compFunc))(pColRes->pData, colLen, numOfRows, data, + int32_t colCompLen = (*(tDataTypes[pColRes->info.type].compFunc))(pColRes->pData, colLen, numOfRows, *data, colLen + COMP_OVERFLOW_BYTES, compressed, NULL, 0); - data += colCompLen; + *data += colCompLen; return colCompLen; } @@ -4218,7 +4218,7 @@ static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data for (int32_t col = 0; col < numOfCols; ++col) { SColumnInfoData* pColRes = taosArrayGet(pRes->pDataBlock, col); if (compressed) { - compSizes[col] = compressQueryColData(pColRes, pRes->info.rows, data, compressed); + compSizes[col] = compressQueryColData(pColRes, pRes->info.rows, &data, compressed); *compLen += compSizes[col]; } else { memmove(data, pColRes->pData, pColRes->info.bytes * pRes->info.rows); @@ -4229,7 +4229,7 @@ static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data for (int32_t col = 0; col < numOfCols; ++col) { SColumnInfoData* pColRes = taosArrayGet(pRes->pDataBlock, col); if (compressed) { - compSizes[col] = compressQueryColData(pColRes, numOfRows, data, compressed); + compSizes[col] = compressQueryColData(pColRes, numOfRows, &data, compressed); *compLen += compSizes[col]; } else { memmove(data, pColRes->pData, pColRes->info.bytes * numOfRows); -- GitLab