Skip to content

Commit 77b4bd3

Browse files
committed
Update some obsolete comments --- code is using t_self now, not t_ctid.
1 parent dfdf07a commit 77b4bd3

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

src/backend/executor/execMain.c

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.252 2005/08/01 20:31:07 tgl Exp $
29+
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.253 2005/08/18 21:34:20 tgl Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -1371,7 +1371,6 @@ ExecInsert(TupleTableSlot *slot,
13711371
HeapTuple tuple;
13721372
ResultRelInfo *resultRelInfo;
13731373
Relation resultRelationDesc;
1374-
int numIndices;
13751374
Oid newId;
13761375

13771376
/*
@@ -1418,6 +1417,9 @@ ExecInsert(TupleTableSlot *slot,
14181417

14191418
/*
14201419
* insert the tuple
1420+
*
1421+
* Note: heap_insert returns the tid (location) of the new tuple
1422+
* in the t_self field.
14211423
*/
14221424
newId = heap_insert(resultRelationDesc, tuple,
14231425
estate->es_snapshot->curcid,
@@ -1429,14 +1431,9 @@ ExecInsert(TupleTableSlot *slot,
14291431
setLastTid(&(tuple->t_self));
14301432

14311433
/*
1432-
* process indices
1433-
*
1434-
* Note: heap_insert adds a new tuple to a relation. As a side effect,
1435-
* the tupleid of the new tuple is placed in the new tuple's t_ctid
1436-
* field.
1434+
* insert index entries for tuple
14371435
*/
1438-
numIndices = resultRelInfo->ri_NumIndices;
1439-
if (numIndices > 0)
1436+
if (resultRelInfo->ri_NumIndices > 0)
14401437
ExecInsertIndexTuples(slot, &(tuple->t_self), estate, false);
14411438

14421439
/* AFTER ROW INSERT Triggers */
@@ -1563,7 +1560,6 @@ ExecUpdate(TupleTableSlot *slot,
15631560
Relation resultRelationDesc;
15641561
ItemPointerData ctid;
15651562
HTSU_Result result;
1566-
int numIndices;
15671563

15681564
/*
15691565
* abort the operation if not running transactions
@@ -1676,23 +1672,18 @@ lreplace:;
16761672
/*
16771673
* Note: instead of having to update the old index tuples associated
16781674
* with the heap tuple, all we do is form and insert new index tuples.
1679-
* This is because UPDATEs are actually DELETEs and INSERTs and index
1675+
* This is because UPDATEs are actually DELETEs and INSERTs, and index
16801676
* tuple deletion is done automagically by the vacuum daemon. All we
16811677
* do is insert new index tuples. -cim 9/27/89
16821678
*/
16831679

16841680
/*
1685-
* process indices
1681+
* insert index entries for tuple
16861682
*
1687-
* heap_update updates a tuple in the base relation by invalidating it
1688-
* and then inserting a new tuple to the relation. As a side effect,
1689-
* the tupleid of the new tuple is placed in the new tuple's t_ctid
1690-
* field. So we now insert index tuples using the new tupleid stored
1691-
* there.
1683+
* Note: heap_update returns the tid (location) of the new tuple
1684+
* in the t_self field.
16921685
*/
1693-
1694-
numIndices = resultRelInfo->ri_NumIndices;
1695-
if (numIndices > 0)
1686+
if (resultRelInfo->ri_NumIndices > 0)
16961687
ExecInsertIndexTuples(slot, &(tuple->t_self), estate, false);
16971688

16981689
/* AFTER ROW UPDATE Triggers */

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