Re: Suspicious place in heap_prepare_freeze_tuple()

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Suspicious place in heap_prepare_freeze_tuple()
Date: 2017-07-05 16:36:21
Message-ID: 20170705163621.tmcuwj2pgiqc3bzg@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Teodor Sigaev wrote:

> Playing around freezing tuple I found suspicious piece of code:
>
> heap_prepare_freeze_tuple():
> ...
> frz->t_infomask = tuple->t_infomask;
> ...
> frz->t_infomask &= ~HEAP_XMAX_BITS;
> frz->xmax = newxmax;
> if (flags & FRM_MARK_COMMITTED)
> frz->t_infomask &= HEAP_XMAX_COMMITTED;
>
> Seems, in last line it should be a bitwise OR instead of AND. Now this line
> cleans all bits in t_infomask which later will be copied directly in tuple.

I think you're right.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2017-07-05 17:07:37 Re: Multi column range partition table
Previous Message Teodor Sigaev 2017-07-05 16:29:52 Suspicious place in heap_prepare_freeze_tuple()