fix(query): set correct page id list.
This commit is contained in:
parent
26d6213937
commit
653bd2ea6e
|
@ -33,13 +33,13 @@ static SFilePage *loadDataFromFilePage(tMemBucket *pMemBucket, int32_t slotIdx)
|
||||||
SFilePage *buffer = (SFilePage *)taosMemoryCalloc(1, pMemBucket->bytes * pMemBucket->pSlots[slotIdx].info.size + sizeof(SFilePage));
|
SFilePage *buffer = (SFilePage *)taosMemoryCalloc(1, pMemBucket->bytes * pMemBucket->pSlots[slotIdx].info.size + sizeof(SFilePage));
|
||||||
|
|
||||||
int32_t groupId = getGroupId(pMemBucket->numOfSlots, slotIdx, pMemBucket->times);
|
int32_t groupId = getGroupId(pMemBucket->numOfSlots, slotIdx, pMemBucket->times);
|
||||||
SIDList list = taosHashGet(pMemBucket->groupPagesMap, &groupId, sizeof(groupId));
|
SArray* pIdList = *(SArray**)taosHashGet(pMemBucket->groupPagesMap, &groupId, sizeof(groupId));
|
||||||
|
|
||||||
int32_t offset = 0;
|
int32_t offset = 0;
|
||||||
for(int32_t i = 0; i < list->size; ++i) {
|
for(int32_t i = 0; i < taosArrayGetSize(pIdList); ++i) {
|
||||||
struct SPageInfo* pgInfo = *(struct SPageInfo**) taosArrayGet(list, i);
|
int32_t* pageId = taosArrayGet(pIdList, i);
|
||||||
|
|
||||||
SFilePage* pg = getBufPage(pMemBucket->pBuffer, getPageId(pgInfo));
|
SFilePage* pg = getBufPage(pMemBucket->pBuffer, *pageId);
|
||||||
memcpy(buffer->data + offset, pg->data, (size_t)(pg->num * pMemBucket->bytes));
|
memcpy(buffer->data + offset, pg->data, (size_t)(pg->num * pMemBucket->bytes));
|
||||||
|
|
||||||
offset += (int32_t)(pg->num * pMemBucket->bytes);
|
offset += (int32_t)(pg->num * pMemBucket->bytes);
|
||||||
|
|
|
@ -639,6 +639,7 @@ void clearDiskbasedBuf(SDiskbasedBuf* pBuf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
taosArrayClear(pBuf->pIdList);
|
taosArrayClear(pBuf->pIdList);
|
||||||
|
pBuf->pIdList = NULL;
|
||||||
|
|
||||||
tdListEmpty(pBuf->lruList);
|
tdListEmpty(pBuf->lruList);
|
||||||
tdListEmpty(pBuf->freePgList);
|
tdListEmpty(pBuf->freePgList);
|
||||||
|
|
Loading…
Reference in New Issue