Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ray6080 committed May 15, 2023
1 parent 5d5ecd7 commit bb12971
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
3 changes: 3 additions & 0 deletions src/storage/storage_structure/column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ void Column::scan(transaction::Transaction* transaction, common::ValueVector* no
while (
nodeIDVector->state->selVector->selectedPositions[posInSelVector] < numValuesRead) {
posInSelVector++;
if (posInSelVector >= nodeIDVector->state->selVector->selectedSize) {
return;
}
}
}
}
Expand Down
24 changes: 4 additions & 20 deletions src/storage/storage_structure/storage_structure_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,13 @@ namespace storage {
std::pair<BMFileHandle*, page_idx_t> StorageStructureUtils::getFileHandleAndPhysicalPageIdxToPin(
BMFileHandle& fileHandle, page_idx_t physicalPageIdx, WAL& wal,
transaction::TransactionType trxType) {
if (trxType == transaction::TransactionType::READ_ONLY) {
if (trxType == transaction::TransactionType::READ_ONLY ||
!fileHandle.hasWALPageVersionNoWALPageIdxLock(physicalPageIdx)) {
return std::make_pair(&fileHandle, physicalPageIdx);
} else {
if (fileHandle.hasWALPageGroup(physicalPageIdx)) {
fileHandle.acquireWALPageIdxLock(physicalPageIdx);
if (fileHandle.hasWALPageVersionNoWALPageIdxLock(physicalPageIdx)) {
auto result = std::make_pair(wal.fileHandle.get(),
fileHandle.getWALPageIdxNoWALPageIdxLock(physicalPageIdx));
fileHandle.releaseWALPageIdxLock(physicalPageIdx);
return result;
} else {
fileHandle.releaseWALPageIdxLock(physicalPageIdx);
}
}
return std::make_pair(&fileHandle, physicalPageIdx);
return std::make_pair(
wal.fileHandle.get(), fileHandle.getWALPageIdxNoWALPageIdxLock(physicalPageIdx));
}
// if (trxType == transaction::TransactionType::READ_ONLY ||
// !fileHandle.hasWALPageVersionNoWALPageIdxLock(physicalPageIdx)) {
// return std::make_pair(&fileHandle, physicalPageIdx);
// } else {
// return std::make_pair(
// wal.fileHandle.get(), fileHandle.getWALPageIdxNoWALPageIdxLock(physicalPageIdx));
// }
}

void StorageStructureUtils::updatePage(BMFileHandle& fileHandle,
Expand Down

0 comments on commit bb12971

Please sign in to comment.