diff --git a/src/jrd/pag.cpp b/src/jrd/pag.cpp index 2745fe5fbe4..43af9de7839 100644 --- a/src/jrd/pag.cpp +++ b/src/jrd/pag.cpp @@ -1858,7 +1858,9 @@ ULONG PageSpace::lastUsedPage() CCH_RELEASE(tdbb, &window); pipMaxKnown = pipLast; - return last_bit + 1 + (pipLast == pipFirst ? 0 : pipLast); + if (pipLast == pipFirst) + return last_bit > 0 ? last_bit : 0; + return pipLast + last_bit + 1; } ULONG PageSpace::lastUsedPage(const Database* dbb)