add the number of blocks in the SMeterDataInfo

fix bug that failed to add the number of blocks in the records (SMeterDataInfo) for each table
This commit is contained in:
haojun Liao 2020-01-07 12:26:11 +08:00 committed by GitHub
parent ce9f1e5bae
commit e2299ef22e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -5861,7 +5861,7 @@ static void clearAllMeterDataBlockInfo(SMeterDataInfo** pMeterDataInfo, int32_t
for(int32_t i = start; i < end; ++i) { for(int32_t i = start; i < end; ++i) {
tfree(pMeterDataInfo[i]->pBlock); tfree(pMeterDataInfo[i]->pBlock);
pMeterDataInfo[i]->numOfBlocks = 0; pMeterDataInfo[i]->numOfBlocks = 0;
pMeterDataInfo[i]->start = 0; pMeterDataInfo[i]->start = -1;
} }
} }
@ -5989,6 +5989,7 @@ int32_t getDataBlocksForMeters(SMeterQuerySupportObj *pSupporter, SQuery *pQuery
int32_t size = compInfo.numOfBlocks * sizeof(SCompBlock); int32_t size = compInfo.numOfBlocks * sizeof(SCompBlock);
size_t bufferSize = size + sizeof(TSCKSUM); size_t bufferSize = size + sizeof(TSCKSUM);
pMeterDataInfo[j]->numOfBlocks = compInfo.numOfBlocks;
pMeterDataInfo[j]->pBlock = calloc(1, bufferSize); pMeterDataInfo[j]->pBlock = calloc(1, bufferSize);
if (pMeterDataInfo[j]->pBlock == NULL) { if (pMeterDataInfo[j]->pBlock == NULL) {
clearAllMeterDataBlockInfo(pMeterDataInfo, 0, j); clearAllMeterDataBlockInfo(pMeterDataInfo, 0, j);