Suspicious place in heap_prepare_freeze_tuple()

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Suspicious place in heap_prepare_freeze_tuple()
Date: 2017-07-05 16:29:52
Message-ID: 1a53572f-a489-7cd7-f5bf-4db05102f141@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

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.
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

Attachment Content-Type Size
heap_prepare_freeze_tuple.diff text/x-patch 536 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-07-05 16:36:21 Re: Suspicious place in heap_prepare_freeze_tuple()
Previous Message Dang Minh Huong 2017-07-05 15:45:17 Re: Extra Vietnamese unaccent rules