From 9ac27abdcaee8c20bf4e694438a2516dbabca6a5 Mon Sep 17 00:00:00 2001 From: hvlad Date: Sun, 28 Jun 2009 21:11:18 +0000 Subject: [PATCH] Fixed bug CORE-2532 : Incorrect size of volumes in multi volume database --- src/jrd/os/posix/unix.cpp | 3 +++ src/jrd/os/win32/winnt.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/jrd/os/posix/unix.cpp b/src/jrd/os/posix/unix.cpp index 3c223f199a..1f6e124fb8 100644 --- a/src/jrd/os/posix/unix.cpp +++ b/src/jrd/os/posix/unix.cpp @@ -610,6 +610,9 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect USHORT leftPages = initPages; const ULONG initBy = MIN(file->fil_max_page - startPage, leftPages); + if (initBy < leftPages) + leftPages = initBy; + for (ULONG i = startPage; i < startPage + initBy; ) { bdb.bdb_page = PageNumber(0, i); diff --git a/src/jrd/os/win32/winnt.cpp b/src/jrd/os/win32/winnt.cpp index 626b1142a4..a18cda4217 100644 --- a/src/jrd/os/win32/winnt.cpp +++ b/src/jrd/os/win32/winnt.cpp @@ -595,6 +595,9 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect USHORT leftPages = initPages; const ULONG initBy = MIN(file->fil_max_page - startPage, leftPages); + if (initBy < leftPages) + leftPages = initBy; + for (ULONG i = startPage; i < startPage + initBy; ) { bdb.bdb_page = PageNumber(0, i);