[TD-5623]<feature>: fix passing pointer issue
This commit is contained in:
parent
97e7f0fec0
commit
91c5deb97f
|
@ -4193,12 +4193,10 @@ 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 colLen = pColRes->info.bytes * numOfRows;
|
||||||
int32_t colCompLen = (*(tDataTypes[pColRes->info.type].compFunc))(pColRes->pData, colLen, numOfRows, *data,
|
return (*(tDataTypes[pColRes->info.type].compFunc))(pColRes->pData, colLen, numOfRows, data,
|
||||||
colLen + COMP_OVERFLOW_BYTES, compressed, NULL, 0);
|
colLen + COMP_OVERFLOW_BYTES, compressed, NULL, 0);
|
||||||
*data += colCompLen;
|
|
||||||
return colCompLen;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data, int8_t compressed, int32_t *compLen) {
|
static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data, int8_t compressed, int32_t *compLen) {
|
||||||
|
@ -4218,7 +4216,8 @@ static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data
|
||||||
for (int32_t col = 0; col < numOfCols; ++col) {
|
for (int32_t col = 0; col < numOfCols; ++col) {
|
||||||
SColumnInfoData* pColRes = taosArrayGet(pRes->pDataBlock, col);
|
SColumnInfoData* pColRes = taosArrayGet(pRes->pDataBlock, col);
|
||||||
if (compressed) {
|
if (compressed) {
|
||||||
compSizes[col] = compressQueryColData(pColRes, pRes->info.rows, &data, compressed);
|
compSizes[col] = compressQueryColData(pColRes, pRes->info.rows, data, compressed);
|
||||||
|
data += compSizes[col];
|
||||||
*compLen += compSizes[col];
|
*compLen += compSizes[col];
|
||||||
} else {
|
} else {
|
||||||
memmove(data, pColRes->pData, pColRes->info.bytes * pRes->info.rows);
|
memmove(data, pColRes->pData, pColRes->info.bytes * pRes->info.rows);
|
||||||
|
@ -4229,7 +4228,8 @@ static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data
|
||||||
for (int32_t col = 0; col < numOfCols; ++col) {
|
for (int32_t col = 0; col < numOfCols; ++col) {
|
||||||
SColumnInfoData* pColRes = taosArrayGet(pRes->pDataBlock, col);
|
SColumnInfoData* pColRes = taosArrayGet(pRes->pDataBlock, col);
|
||||||
if (compressed) {
|
if (compressed) {
|
||||||
compSizes[col] = compressQueryColData(pColRes, numOfRows, &data, compressed);
|
compSizes[col] = compressQueryColData(pColRes, numOfRows, data, compressed);
|
||||||
|
data += compSizes[col];
|
||||||
*compLen += compSizes[col];
|
*compLen += compSizes[col];
|
||||||
} else {
|
} else {
|
||||||
memmove(data, pColRes->pData, pColRes->info.bytes * numOfRows);
|
memmove(data, pColRes->pData, pColRes->info.bytes * numOfRows);
|
||||||
|
|
Loading…
Reference in New Issue