8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 14:03:02 +01:00

Backported fix for CORE-2876: Wrong backup mode when using "alter database add difference file"

This commit is contained in:
alexpeshkoff 2010-03-14 15:27:44 +00:00
parent 569200e719
commit 2519440c2b

View File

@ -202,21 +202,30 @@ void BackupManager::beginBackup(thread_db* tdbb)
WIN window(HEADER_PAGE_NUMBER); WIN window(HEADER_PAGE_NUMBER);
StateWriteGuard stateGuard(tdbb, &window);
Ods::header_page* header = (Ods::header_page*) window.win_buffer;
// Check state
if (backup_state != nbak_state_normal) {
NBAK_TRACE(("end backup - invalid state %d", backup_state));
return;
}
try try
{ {
StateWriteGuard stateGuard(tdbb, &window);
Ods::header_page* header = (Ods::header_page*) window.win_buffer;
// Check state
if (backup_state != nbak_state_normal) {
NBAK_TRACE(("end backup - invalid state %d", backup_state));
return;
}
// Create file // Create file
NBAK_TRACE(("Creating difference file %s", diff_name.c_str())); NBAK_TRACE(("Creating difference file %s", diff_name.c_str()));
diff_file = PIO_create(database, diff_name, true, false, false); diff_file = PIO_create(database, diff_name, true, false, false);
}
catch (const Firebird::Exception&)
{
// no reasons to set it to unknown if we just failed to open difference file
backup_state = nbak_state_normal;
throw;
}
try
{
if (database->dbb_flags & (DBB_force_write | DBB_no_fs_cache)) if (database->dbb_flags & (DBB_force_write | DBB_no_fs_cache))
{ {
PIO_force_write(diff_file, PIO_force_write(diff_file,