]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix potential data corruption during freeze
authorTeodor Sigaev <teodor@sigaev.ru>
Thu, 6 Jul 2017 14:20:56 +0000 (17:20 +0300)
committerTeodor Sigaev <teodor@sigaev.ru>
Thu, 6 Jul 2017 14:20:56 +0000 (17:20 +0300)
Fix oversight in 3b97e6823b94 bug fix. Bitwise AND is used instead of OR and
it cleans all bits in t_infomask heap tuple field.

Backpatch to 9.3

src/backend/access/heap/heapam.c

index 898950d9a0ce3da6d5e1659134b72c34765ed512..f4d005bcf0e0e7b51ef03bc1b74ea87f0be2e6ac 100644 (file)
@@ -5737,7 +5737,7 @@ heap_prepare_freeze_tuple(HeapTupleHeader tuple, TransactionId cutoff_xid,
                        frz->t_infomask &= ~HEAP_XMAX_BITS;
                        frz->xmax = newxmax;
                        if (flags & FRM_MARK_COMMITTED)
-                               frz->t_infomask &= HEAP_XMAX_COMMITTED;
+                               frz->t_infomask |= HEAP_XMAX_COMMITTED;
                        changed = true;
                }
                else if (flags & FRM_RETURN_IS_MULTI)