fix(query): set correct length for json value.

This commit is contained in:
Haojun Liao 2024-05-08 22:28:49 +08:00
parent 81abf3fe6d
commit cbf994f04f
1 changed files with 6 additions and 1 deletions

View File

@ -1462,7 +1462,12 @@ static int32_t getPageBufIncForRow(SSDataBlock* pSrcBlock, int32_t srcRowIndex,
if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) {
if ((pColInfoData->varmeta.offset[srcRowIndex] != -1) && (pColInfoData->pData)) { if ((pColInfoData->varmeta.offset[srcRowIndex] != -1) && (pColInfoData->pData)) {
char* p = colDataGetData(pColInfoData, srcRowIndex); char* p = colDataGetData(pColInfoData, srcRowIndex);
size += varDataTLen(p);
if (pColInfoData->info.type == TSDB_DATA_TYPE_JSON) {
size += getJsonValueLen(p);
} else {
size += varDataTLen(p);
}
} }
size += sizeof(pColInfoData->varmeta.offset[0]); size += sizeof(pColInfoData->varmeta.offset[0]);