Mercurial > hg > MonetDB
changeset 86163:45a83ef60c1a smart-merge-jan22
Reformat code a bit.
| author | Aris Koning <aris.koning@monetdbsolutions.com> |
|---|---|
| date | Tue, 26 Jul 2022 13:27:14 +0200 |
| parents | 8a99ba477d34 |
| children | 52cba3e788de |
| files | sql/storage/bat/bat_storage.c |
| diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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;
