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

Backport fix for bug CORE-1702 : Wrong record number calculation in garbage collector thread

This commit is contained in:
hvlad 2008-01-18 19:00:08 +00:00
parent 1434903d66
commit 038c7962ba

View File

@ -3794,13 +3794,12 @@ static THREAD_ENTRY_DECLARE garbage_collector(THREAD_ENTRY_PARAM arg)
}
++relation->rel_sweep_count;
SLONG dp_sequence = -1;
rpb.rpb_relation = relation;
if (relation->rel_gc_bitmap)
while (relation->rel_gc_bitmap->getFirst())
{
dp_sequence = relation->rel_gc_bitmap->current();
ULONG dp_sequence = relation->rel_gc_bitmap->current();
if (!(dbb->dbb_flags & DBB_garbage_collector)) {
--relation->rel_sweep_count;
@ -3827,7 +3826,7 @@ static THREAD_ENTRY_DECLARE garbage_collector(THREAD_ENTRY_PARAM arg)
}
found = flush = true;
rpb.rpb_number.setValue((dp_sequence * dbb->dbb_max_records) - 1);
rpb.rpb_number.setValue((SINT64(dp_sequence) * dbb->dbb_max_records) - 1);
const RecordNumber last(rpb.rpb_number.getValue() + dbb->dbb_max_records);
/* Attempt to garbage collect all records on the data page. */
@ -3854,8 +3853,6 @@ static THREAD_ENTRY_DECLARE garbage_collector(THREAD_ENTRY_PARAM arg)
}
rel_exit:
dp_sequence = -1;
if (relation->rel_gc_bitmap) {
if (!relation->rel_gc_bitmap->getFirst())
{