Skip to content

Commit aa4b8c6

Browse files
committed
Handle table_complete_speculative's succeeded argument as documented.
For some reason both callsite and the implementation for heapam had the meaning inverted (i.e. succeeded == true was passed in case of conflict). That's confusing. I (Andres) briefly pondered whether it'd be better to rename table_complete_speculative's argument to 'bool specConflict' or such, but decided not to. The 'complete' in the function name for me makes `succeeded` sound a bit better. Reported-By: Ashwin Agrawal, Melanie Plageman, Heikki Linnakangas Discussion: https://postgr.es/m/CALfoeitk7-TACwYv3hCw45FNPjkA86RfXg4iQ5kAOPhR+F1Y4w@mail.gmail.com https://postgr.es/m/97673451-339f-b21e-a781-998d06b1067c@iki.fi
1 parent 08e2edc commit aa4b8c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/access/heap/heapam_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ heapam_tuple_complete_speculative(Relation relation, TupleTableSlot *slot,
282282
HeapTuple tuple = ExecFetchSlotHeapTuple(slot, true, &shouldFree);
283283

284284
/* adjust the tuple's state accordingly */
285-
if (!succeeded)
285+
if (succeeded)
286286
heap_finish_speculative(relation, &slot->tts_tid);
287287
else
288288
heap_abort_speculative(relation, &slot->tts_tid);

src/backend/executor/nodeModifyTable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ ExecInsert(ModifyTableState *mtstate,
556556

557557
/* adjust the tuple's state accordingly */
558558
table_complete_speculative(resultRelationDesc, slot,
559-
specToken, specConflict);
559+
specToken, !specConflict);
560560

561561
/*
562562
* Wake up anyone waiting for our decision. They will re-check

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy