Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b1df6b6

Browse filesBrowse 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
Copy full SHA for b1df6b6

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎src/backend/access/heap/heapam.c

Copy file name to clipboardExpand all lines: src/backend/access/heap/heapam.c
+2-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.