提交 653bd2ea 编写于 作者: H Haojun Liao

fix(query): set correct page id list.

上级 26d62139
...@@ -33,13 +33,13 @@ static SFilePage *loadDataFromFilePage(tMemBucket *pMemBucket, int32_t slotIdx) ...@@ -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) { ...@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册