8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 04:43:03 +01:00

Correct page pre-allocation logic

This commit is contained in:
hvlad 2007-04-27 08:56:58 +00:00
parent 32c3c9f683
commit 929bc1eb41

View File

@ -813,7 +813,10 @@ PAG PAG_allocate(WIN * window)
fb_assert(new_page);
}
if (!(dbb->dbb_flags & DBB_no_reserve)) {
pageSpace->extend(tdbb, pageNum + 1);
// At this point we sure database have at least pageNum + 1 pages
// allocated. To avoid file growth by one page when next page will
// be allocated extend file up to pageNum + 2 pages now
pageSpace->extend(tdbb, pageNum + 2);
}
}
break; /* Found a page and successfully fake-ed it */