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

Fix #7627: The size of the database with big records becomes bigger after backup/restore
All checks were successful
continuous-integration/drone/push Build is passing

The problem appears when bulk inserts are used (currently during restore). Without the fix the primary data page is released if it has the dpg_large flag, and the new record is inserted on the next empty page. As a result, each primary page has only one record. Generally the fix solves an issue where per-relation cache of data page numbers is not working for tables with big records.
This commit is contained in:
Ilya Eremin 2023-06-14 13:08:09 +03:00 committed by Vlad Khorsun
parent 4386a0b4c9
commit daaf0930e5

View File

@ -1473,7 +1473,7 @@ bool DPM_get(thread_db* tdbb, record_param* rpb, SSHORT lock_type)
const bool pageOk =
dpage->dpg_header.pag_type == pag_data &&
!(dpage->dpg_header.pag_flags & (dpg_secondary | dpg_large | dpg_orphan)) &&
!(dpage->dpg_header.pag_flags & (dpg_secondary | dpg_orphan)) &&
dpage->dpg_relation == rpb->rpb_relation->rel_id &&
dpage->dpg_sequence == dpSequence &&
(dpage->dpg_count > 0);
@ -1732,7 +1732,7 @@ bool DPM_next(thread_db* tdbb, record_param* rpb, USHORT lock_type, bool onepage
const bool pageOk =
dpage->dpg_header.pag_type == pag_data &&
!(dpage->dpg_header.pag_flags & (dpg_secondary | dpg_large | dpg_orphan)) &&
!(dpage->dpg_header.pag_flags & (dpg_secondary | dpg_orphan)) &&
dpage->dpg_relation == rpb->rpb_relation->rel_id &&
dpage->dpg_sequence == dpSequence &&
(dpage->dpg_count > 0);
@ -3321,7 +3321,7 @@ static rhd* locate_space(thread_db* tdbb,
const bool pageOk =
dpage->dpg_header.pag_type == pag_data &&
!(dpage->dpg_header.pag_flags & (dpg_secondary | dpg_large | dpg_orphan)) &&
!(dpage->dpg_header.pag_flags & (dpg_secondary | dpg_orphan)) &&
dpage->dpg_relation == rpb->rpb_relation->rel_id &&
//dpage->dpg_sequence == dpSequence &&
(dpage->dpg_count > 0);