Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 16175e2

Browse files
committed
Fix potential SSI hazard in heap_update().
Commit 6f38d4d failed to heed a warning about the stability of the value pointed to by "otid". The caller is allowed to pass in a pointer to newtup->t_self, which will be updated during the execution of the function. Instead, the SSI check should use the value we copy into oldtup.t_self near the top of the function. Not a live bug, because newtup->t_self doesn't really get updated until a bit later, but it was confusing and broke the rule established by the comment. Back-patch to 13. Reported-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/2689164.1618160085%40sss.pgh.pa.us
1 parent 8a7bd1e commit 16175e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/access/heap/heapam.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3561,7 +3561,8 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
35613561
* will include checking the relation level, there is no benefit to a
35623562
* separate check for the new tuple.
35633563
*/
3564-
CheckForSerializableConflictIn(relation, otid, BufferGetBlockNumber(buffer));
3564+
CheckForSerializableConflictIn(relation, &oldtup.t_self,
3565+
BufferGetBlockNumber(buffer));
35653566

35663567
/*
35673568
* At this point newbuf and buffer are both pinned and locked, and newbuf

0 commit comments

Comments
 (0)