mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 06:03:02 +01:00
Applied modified patch from Damyan fixing piped decompression
This commit is contained in:
parent
04508a0f73
commit
9f3fa49fe3
@ -1494,7 +1494,18 @@ void NBackup::restore_database(const BackupFiles& files, bool inc_rest)
|
|||||||
// We may also add SCN check, but GUID check covers this case too
|
// We may also add SCN check, but GUID check covers this case too
|
||||||
if (memcmp(&bakheader.prev_guid, &prev_guid, sizeof(Guid)) != 0)
|
if (memcmp(&bakheader.prev_guid, &prev_guid, sizeof(Guid)) != 0)
|
||||||
status_exception::raise(Arg::Gds(isc_nbackup_wrong_orderbk) << bakname.c_str());
|
status_exception::raise(Arg::Gds(isc_nbackup_wrong_orderbk) << bakname.c_str());
|
||||||
seek_file(backup, bakheader.page_size);
|
|
||||||
|
// Emulate seek_file(backup, bakheader.page_size)
|
||||||
|
// Backup is stream-oriented, if -decompress is used pipe can't be seek()'ed
|
||||||
|
FB_SIZE_T left = bakheader.page_size - sizeof(bakheader);
|
||||||
|
while (left)
|
||||||
|
{
|
||||||
|
char char_buf[1024];
|
||||||
|
FB_SIZE_T step = left > sizeof(char_buf) ? sizeof(char_buf) : left;
|
||||||
|
if (read_file(backup, &char_buf, step) != step)
|
||||||
|
status_exception::raise(Arg::Gds(isc_nbackup_err_eofhdrbk) << bakname.c_str());
|
||||||
|
left -= step;
|
||||||
|
}
|
||||||
|
|
||||||
if (!inc_rest)
|
if (!inc_rest)
|
||||||
delete_database = true;
|
delete_database = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user