|
26 | 26 | *
|
27 | 27 | *
|
28 | 28 | * IDENTIFICATION
|
29 |
| - * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.66 1999/01/29 09:22:57 vadim Exp $ |
| 29 | + * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.67 1999/01/29 10:15:09 vadim Exp $ |
30 | 30 | *
|
31 | 31 | *-------------------------------------------------------------------------
|
32 | 32 | */
|
@@ -65,7 +65,7 @@ static TupleDesc InitPlan(CmdType operation, Query *parseTree,
|
65 | 65 | static void EndPlan(Plan *plan, EState *estate);
|
66 | 66 | static TupleTableSlot *ExecutePlan(EState *estate, Plan *plan,
|
67 | 67 | CmdType operation, int numberTuples, ScanDirection direction,
|
68 |
| - void (*printfunc) ()); |
| 68 | + DestReceiver *destfunc); |
69 | 69 | static void ExecRetrieve(TupleTableSlot *slot,
|
70 | 70 | DestReceiver *destfunc,
|
71 | 71 | EState *estate);
|
@@ -756,7 +756,7 @@ ExecutePlan(EState *estate,
|
756 | 756 | CmdType operation,
|
757 | 757 | int numberTuples,
|
758 | 758 | ScanDirection direction,
|
759 |
| - void (*printfunc) ()) |
| 759 | + DestReceiver *destfunc) |
760 | 760 | {
|
761 | 761 | JunkFilter *junkfilter;
|
762 | 762 |
|
@@ -941,7 +941,7 @@ lmark:;
|
941 | 941 | {
|
942 | 942 | case CMD_SELECT:
|
943 | 943 | ExecRetrieve(slot, /* slot containing tuple */
|
944 |
| - printfunc, /* print function */ |
| 944 | + destfunc, /* print function */ |
945 | 945 | estate); /* */
|
946 | 946 | result = slot;
|
947 | 947 | break;
|
@@ -997,7 +997,7 @@ lmark:;
|
997 | 997 | */
|
998 | 998 | static void
|
999 | 999 | ExecRetrieve(TupleTableSlot *slot,
|
1000 |
| - void (*printfunc) (), |
| 1000 | + DestReceiver *destfunc, |
1001 | 1001 | EState *estate)
|
1002 | 1002 | {
|
1003 | 1003 | HeapTuple tuple;
|
@@ -1139,8 +1139,7 @@ ExecDelete(TupleTableSlot *slot,
|
1139 | 1139 | {
|
1140 | 1140 | RelationInfo *resultRelationInfo;
|
1141 | 1141 | Relation resultRelationDesc;
|
1142 |
| - ItemPointerData ctid, |
1143 |
| - oldtid; |
| 1142 | + ItemPointerData ctid; |
1144 | 1143 | int result;
|
1145 | 1144 |
|
1146 | 1145 | /******************
|
@@ -1180,12 +1179,11 @@ ldelete:;
|
1180 | 1179 | elog(ERROR, "Can't serialize access due to concurrent update");
|
1181 | 1180 | else if (!(ItemPointerEquals(tupleid, &ctid)))
|
1182 | 1181 | {
|
1183 |
| - TupleTableSlot *slot = EvalPlanQual(estate, |
| 1182 | + TupleTableSlot *epqslot = EvalPlanQual(estate, |
1184 | 1183 | resultRelationInfo->ri_RangeTableIndex, &ctid);
|
1185 | 1184 |
|
1186 |
| - if (!TupIsNull(slot)) |
| 1185 | + if (!TupIsNull(epqslot)) |
1187 | 1186 | {
|
1188 |
| - tupleid = &oldtid; |
1189 | 1187 | *tupleid = ctid;
|
1190 | 1188 | goto ldelete;
|
1191 | 1189 | }
|
@@ -1238,8 +1236,7 @@ ExecReplace(TupleTableSlot *slot,
|
1238 | 1236 | HeapTuple tuple;
|
1239 | 1237 | RelationInfo *resultRelationInfo;
|
1240 | 1238 | Relation resultRelationDesc;
|
1241 |
| - ItemPointerData ctid, |
1242 |
| - oldtid; |
| 1239 | + ItemPointerData ctid; |
1243 | 1240 | int result;
|
1244 | 1241 | int numIndices;
|
1245 | 1242 |
|
@@ -1321,13 +1318,14 @@ lreplace:;
|
1321 | 1318 | elog(ERROR, "Can't serialize access due to concurrent update");
|
1322 | 1319 | else if (!(ItemPointerEquals(tupleid, &ctid)))
|
1323 | 1320 | {
|
1324 |
| - TupleTableSlot *slot = EvalPlanQual(estate, |
| 1321 | + TupleTableSlot *epqslot = EvalPlanQual(estate, |
1325 | 1322 | resultRelationInfo->ri_RangeTableIndex, &ctid);
|
1326 | 1323 |
|
1327 |
| - if (!TupIsNull(slot)) |
| 1324 | + if (!TupIsNull(epqslot)) |
1328 | 1325 | {
|
1329 |
| - tupleid = &oldtid; |
1330 | 1326 | *tupleid = ctid;
|
| 1327 | + tuple = ExecRemoveJunk(estate->es_junkFilter, epqslot); |
| 1328 | + slot = ExecStoreTuple(tuple, slot, InvalidBuffer, true); |
1331 | 1329 | goto lreplace;
|
1332 | 1330 | }
|
1333 | 1331 | }
|
|
0 commit comments