mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 04:43:03 +01:00
Fixed CORE-3649: gbak deletes backup file even if error happens when it's already successfully closed
This commit is contained in:
parent
67436c2787
commit
aa64bc7424
@ -412,8 +412,8 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)
|
||||
// Finish up
|
||||
|
||||
put(tdgbl, (UCHAR) rec_end);
|
||||
|
||||
FB_UINT64 cumul_count = MVOL_fini_write(&tdgbl->io_cnt, &tdgbl->io_ptr);
|
||||
tdgbl->action->act_action = ACT_backup_fini;
|
||||
BURP_verbose(176, SafeArg() << cumul_count);
|
||||
// msg 176 closing file, committing, and finishing. %ld bytes written
|
||||
|
||||
|
@ -1232,6 +1232,10 @@ int gbak(Firebird::UtilSvc* uSvc)
|
||||
{
|
||||
// All calls to exit_local(), normal and error exits, wind up here
|
||||
tdgbl->burp_throw = false;
|
||||
if (tdgbl->action->act_action == ACT_backup_fini)
|
||||
{
|
||||
tdgbl->exit_code = 0;
|
||||
}
|
||||
exit_code = tdgbl->exit_code;
|
||||
}
|
||||
|
||||
@ -1316,7 +1320,8 @@ void BURP_abort()
|
||||
|
||||
if (!tdgbl->uSvc->isService())
|
||||
{
|
||||
BURP_print(true, 83);
|
||||
BURP_print(true, tdgbl->action->act_action == ACT_backup_fini ? 351 : 83);
|
||||
// msg 351 Error closing database, but backup file is OK
|
||||
// msg 83 Exiting before completion due to errors
|
||||
}
|
||||
|
||||
|
@ -822,6 +822,7 @@ enum act_t {
|
||||
ACT_unknown, // action is unknown
|
||||
ACT_backup,
|
||||
ACT_backup_split,
|
||||
ACT_backup_fini,
|
||||
ACT_restore,
|
||||
ACT_restore_join
|
||||
};
|
||||
|
@ -9,7 +9,7 @@ set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUM
|
||||
('2012-01-13 11:20:16', 'DYN', 8, 285)
|
||||
('1996-11-07 13:39:40', 'INSTALL', 10, 1)
|
||||
('1996-11-07 13:38:41', 'TEST', 11, 4)
|
||||
('2011-06-01 12:57:44', 'GBAK', 12, 351)
|
||||
('2012-03-02 11:55:44', 'GBAK', 12, 352)
|
||||
('2012-02-18 20:00:00', 'SQLERR', 13, 1033)
|
||||
('1996-11-07 13:38:42', 'SQLWARN', 14, 613)
|
||||
('2006-09-10 03:04:31', 'JRD_BUGCHK', 15, 307)
|
||||
|
@ -2230,6 +2230,7 @@ ERROR: Backup incomplete', NULL, NULL);
|
||||
('gbak_db_format_too_old2', 'BACKUP_backup', 'backup.epp', NULL, 12, 348, NULL, 'database format @1 is too old to backup', NULL, NULL);
|
||||
(NULL, 'restore', 'restore.epp', NULL, 12, 349, NULL, 'backup version is @1', NULL, NULL);
|
||||
(NULL, 'fix_system_generators', 'restore.epp', NULL, 12, 350, NULL, 'fixing system generators', NULL, NULL);
|
||||
(NULL, 'BURP_abort', 'burp.cpp', NULL, 12, 351, NULL, 'Error closing database, but backup file is OK', NULL, NULL);
|
||||
-- SQLERR
|
||||
(NULL, NULL, NULL, NULL, 13, 1, NULL, 'Firebird error', NULL, NULL);
|
||||
(NULL, NULL, NULL, NULL, 13, 74, NULL, 'Rollback not performed', NULL, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user