# HG changeset patch # User Aris Koning # Date 1658834834 -7200 # Node ID 45a83ef60c1a04934b4cbe2734e01b6dcbc28fcc # Parent 8a99ba477d3494f46ee4a8a4ed243547c5edf729 Reformat code a bit. diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c --- a/sql/storage/bat/bat_storage.c +++ b/sql/storage/bat/bat_storage.c @@ -407,9 +407,10 @@ merge_segments(storage *s, sql_trans *tr if (seg->deleted == cur->deleted && cur->ts < TRANSACTION_ID_BASE) { int merge = 1; for (int i = 0; active[i] != 0; i++) { - if (active[i] != tr->ts /* the transaction can ignore its own active timestamp since it's committing */ - && ((active[i] >= seg->ts && active[i] <= cur->ts) - || (active[i] <= seg->ts && active[i] >= cur->ts))) { + assert(active[i] != seg->ts && active[i] != cur->ts); + if (active[i] != tr->ts) /* the transaction can ignore its own active timestamp since it's committing */ + if ((active[i] > seg->ts && active[i] < cur->ts) || + (active[i] < seg->ts && active[i] > cur->ts)) { /* cannot safely merge since there is an active transaction between the segments */ merge = 0; break;