File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -1100,7 +1100,8 @@ void PAG_header(thread_db* tdbb, bool info)
11001100 fb_assert (attachment);
11011101
11021102 WIN window (HEADER_PAGE_NUMBER);
1103- header_page* header = (header_page*) CCH_FETCH (tdbb, &window, LCK_read, pag_header);
1103+ pag* page = CCH_FETCH (tdbb, &window, LCK_read, pag_header);
1104+ header_page* header = (header_page*) page;
11041105
11051106 try {
11061107
@@ -1220,6 +1221,30 @@ void PAG_header(thread_db* tdbb, bool info)
12201221 fb_assert (false );
12211222 }
12221223
1224+ // If database in backup lock state...
1225+ if (!info && dbb->dbb_backup_manager ->getState () != Ods::hdr_nbak_normal)
1226+ {
1227+ // refetch some data from the header, because it could be changed in the delta file
1228+ // (as initially PAG_init2 reads the header from the main file and these values
1229+ // may be outdated there)
1230+ for (const UCHAR* p = header->hdr_data ; *p != HDR_end; p += 2u + p[1 ])
1231+ {
1232+ switch (*p)
1233+ {
1234+ case HDR_sweep_interval:
1235+ fb_assert (p[1 ] == sizeof (SLONG));
1236+ memcpy (&dbb->dbb_sweep_interval , p + 2 , sizeof (SLONG));
1237+ break ;
1238+
1239+ case HDR_repl_seq:
1240+ fb_assert (p[1 ] == sizeof (FB_UINT64));
1241+ memcpy (&dbb->dbb_repl_sequence , p + 2 , sizeof (FB_UINT64));
1242+ break ;
1243+
1244+ }
1245+ }
1246+ }
1247+
12231248 } // try
12241249 catch (const Exception&)
12251250 {
You can’t perform that action at this time.
0 commit comments