Skip to content

Commit 8afaeae

Browse files
TreeHunter9Artyom Ivanov
authored andcommitted
fix(pag): Incorrect calculation of last used page when database contains only one PIP (#8949)
Co-authored-by: Artyom Ivanov <artyom.ivanov@red-soft.ru>
1 parent c32b35e commit 8afaeae

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/jrd/pag.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,9 @@ ULONG PageSpace::lastUsedPage()
23182318
CCH_RELEASE(tdbb, &window);
23192319
pipMaxKnown = pipLast;
23202320

2321-
return last_bit + 1 + (pipLast == pipFirst ? 0 : pipLast);
2321+
if (pipLast == pipFirst)
2322+
return last_bit > 0 ? last_bit : 0;
2323+
return pipLast + last_bit + 1;
23222324
}
23232325

23242326
ULONG PageSpace::lastUsedPage(const Database* dbb)

0 commit comments

Comments
 (0)