Skip to content

Commit

Permalink
fix copy of list elements
Browse files Browse the repository at this point in the history
  • Loading branch information
ray6080 committed Jan 3, 2023
1 parent 63c2813 commit ba00990
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/storage/storage_structure/in_mem_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ template<DataTypeID DT>
void InMemOverflowFile::copyVarSizedValuesToPages(ku_list_t& resultKUList,
const Literal& listLiteral, PageByteCursor& overflowCursor, uint64_t numBytesOfListElement) {
assert(DT == STRING || DT == LIST);
auto overflowPageIdx = overflowCursor.pageIdx;
auto overflowPageOffset = overflowCursor.offsetInPage;
// Reserve space for ku_list or ku_string objects.
overflowCursor.offsetInPage += (resultKUList.size * numBytesOfListElement);
Expand All @@ -105,7 +106,7 @@ void InMemOverflowFile::copyVarSizedValuesToPages(ku_list_t& resultKUList,
}
shared_lock lck(lock);
for (auto i = 0u; i < listLiteral.listVal.size(); i++) {
pages[overflowCursor.pageIdx]->write(overflowPageOffset + (i * numBytesOfListElement),
pages[overflowPageIdx]->write(overflowPageOffset + (i * numBytesOfListElement),
overflowPageOffset + (i * numBytesOfListElement), (uint8_t*)&kuStrings[i],
numBytesOfListElement);
}
Expand All @@ -117,7 +118,7 @@ void InMemOverflowFile::copyVarSizedValuesToPages(ku_list_t& resultKUList,
}
shared_lock lck(lock);
for (auto i = 0u; i < listLiteral.listVal.size(); i++) {
pages[overflowCursor.pageIdx]->write(overflowPageOffset + (i * numBytesOfListElement),
pages[overflowPageIdx]->write(overflowPageOffset + (i * numBytesOfListElement),
overflowPageOffset + (i * numBytesOfListElement), (uint8_t*)&kuLists[i],
numBytesOfListElement);
}
Expand Down

0 comments on commit ba00990

Please sign in to comment.