Content-Length: 262338 | pFad | http://github.com/postgrespro/postgres/commit/b1df6b696b759f00ebbf02e6de64e259d4be5785

ED Fix potential SSI hazard in heap_update(). · postgrespro/postgres@b1df6b6 · GitHub
Skip to content

Commit b1df6b6

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 885a876 commit b1df6b6

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
@@ -3900,7 +3900,8 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
39003900
* will include checking the relation level, there is no benefit to a
39013901
* separate check for the new tuple.
39023902
*/
3903-
CheckForSerializableConflictIn(relation, otid, BufferGetBlockNumber(buffer));
3903+
CheckForSerializableConflictIn(relation, &oldtup.t_self,
3904+
BufferGetBlockNumber(buffer));
39043905

39053906
/*
39063907
* At this point newbuf and buffer are both pinned and locked, and newbuf

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/b1df6b696b759f00ebbf02e6de64e259d4be5785

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy