cache/var-data: realloc var data
This commit is contained in:
parent
bb481c52b6
commit
6e29d7879f
|
@ -703,6 +703,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
|
||||||
*pTmpLastCol = *pLastCol;
|
*pTmpLastCol = *pLastCol;
|
||||||
pLastCol = pTmpLastCol;
|
pLastCol = pTmpLastCol;
|
||||||
|
|
||||||
|
reallocVarData(&pLastCol->colVal);
|
||||||
size_t charge = sizeof(*pLastCol);
|
size_t charge = sizeof(*pLastCol);
|
||||||
if (IS_VAR_DATA_TYPE(pLastCol->colVal.type)) {
|
if (IS_VAR_DATA_TYPE(pLastCol->colVal.type)) {
|
||||||
charge += pLastCol->colVal.value.nData;
|
charge += pLastCol->colVal.value.nData;
|
||||||
|
@ -853,8 +854,8 @@ int32_t tsdbCacheGetBatch(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCache
|
||||||
|
|
||||||
SLastCol lastCol = *pLastCol;
|
SLastCol lastCol = *pLastCol;
|
||||||
reallocVarData(&lastCol.colVal);
|
reallocVarData(&lastCol.colVal);
|
||||||
|
|
||||||
taosArraySet(pLastArray, idxKey->idx, &lastCol);
|
taosArraySet(pLastArray, idxKey->idx, &lastCol);
|
||||||
|
|
||||||
if (h) {
|
if (h) {
|
||||||
taosLRUCacheRelease(pCache, h, false);
|
taosLRUCacheRelease(pCache, h, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,14 +315,14 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
tsdbCacheGetBatch(pr->pTsdb, pKeyInfo->uid, pRow, pr, ltype);
|
tsdbCacheGetBatch(pr->pTsdb, pKeyInfo->uid, pRow, pr, ltype);
|
||||||
// tsdbCacheGet(pr->pTsdb, pKeyInfo->uid, pRow, pr, ltype);
|
// tsdbCacheGet(pr->pTsdb, pKeyInfo->uid, pRow, pr, ltype);
|
||||||
if (TARRAY_SIZE(pRow) <= 0) {
|
if (TARRAY_SIZE(pRow) <= 0) {
|
||||||
// taosArrayClearEx(pRow, freeItem);
|
taosArrayClearEx(pRow, freeItem);
|
||||||
taosArrayClear(pRow);
|
// taosArrayClear(pRow);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
SLastCol* pColVal = taosArrayGet(pRow, 0);
|
SLastCol* pColVal = taosArrayGet(pRow, 0);
|
||||||
if (COL_VAL_IS_NONE(&pColVal->colVal)) {
|
if (COL_VAL_IS_NONE(&pColVal->colVal)) {
|
||||||
// taosArrayClearEx(pRow, freeItem);
|
taosArrayClearEx(pRow, freeItem);
|
||||||
taosArrayClear(pRow);
|
// taosArrayClear(pRow);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,8 +381,8 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// taosArrayClearEx(pRow, freeItem);
|
taosArrayClearEx(pRow, freeItem);
|
||||||
taosArrayClear(pRow);
|
// taosArrayClear(pRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasRes) {
|
if (hasRes) {
|
||||||
|
@ -394,20 +394,20 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
|
||||||
|
|
||||||
tsdbCacheGetBatch(pr->pTsdb, uid, pRow, pr, ltype);
|
tsdbCacheGetBatch(pr->pTsdb, uid, pRow, pr, ltype);
|
||||||
if (TARRAY_SIZE(pRow) <= 0) {
|
if (TARRAY_SIZE(pRow) <= 0) {
|
||||||
// taosArrayClearEx(pRow, freeItem);
|
taosArrayClearEx(pRow, freeItem);
|
||||||
taosArrayClear(pRow);
|
// taosArrayClear(pRow);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0);
|
SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0);
|
||||||
if (COL_VAL_IS_NONE(&pColVal->colVal)) {
|
if (COL_VAL_IS_NONE(&pColVal->colVal)) {
|
||||||
// taosArrayClearEx(pRow, freeItem);
|
taosArrayClearEx(pRow, freeItem);
|
||||||
taosArrayClear(pRow);
|
// taosArrayClear(pRow);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
saveOneRow(pRow, pResBlock, pr, slotIds, dstSlotIds, pRes, pr->idstr);
|
saveOneRow(pRow, pResBlock, pr, slotIds, dstSlotIds, pRes, pr->idstr);
|
||||||
// taosArrayClearEx(pRow, freeItem);
|
taosArrayClearEx(pRow, freeItem);
|
||||||
taosArrayClear(pRow);
|
// taosArrayClear(pRow);
|
||||||
|
|
||||||
taosArrayPush(pTableUidList, &uid);
|
taosArrayPush(pTableUidList, &uid);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue