Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitee0b827

Browse files
committed
PartitionRouter: call before row update triggers
1 parentc907d6e commitee0b827

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

‎src/partition_router.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ CustomScanMethodspartition_router_plan_methods;
2929
CustomExecMethodspartition_router_exec_methods;
3030

3131
staticTupleTableSlot*router_delete_tuple(TupleTableSlot*slot,
32-
ItemPointertupleid,
33-
EPQState*epqstate,
34-
EState*estate);
32+
ItemPointertupleid,
33+
EPQState*epqstate,
34+
EState*estate);
3535

3636
void
3737
init_partition_router_static_data(void)
@@ -232,32 +232,34 @@ partition_router_explain(CustomScanState *node, List *ancestors, ExplainState *e
232232
/*
233233
* ----------------------------------------------------------------
234234
* ExecDeleteInternal
235-
*Basicly is a copy of ExecDelete from executor/nodeModifyTable.c
235+
*This is a modified copy of ExecDelete from executor/nodeModifyTable.c
236236
* ----------------------------------------------------------------
237237
*/
238238

239239
staticTupleTableSlot*
240240
router_delete_tuple(TupleTableSlot*slot,
241-
ItemPointertupleid,
242-
EPQState*epqstate,
243-
EState*estate)
241+
ItemPointertupleid,
242+
EPQState*epqstate,
243+
EState*estate)
244244
{
245245
ResultRelInfo*rri;
246246
Relationrel;
247247
HTSU_Resultresult;
248248
HeapUpdateFailureDatahufd;
249249

250-
/*
251-
* get information on the (current) result relation
252-
*/
250+
EvalPlanQualSetSlot(epqstate,slot);
251+
252+
/* Get information on the (current) result relation */
253253
rri=estate->es_result_relation_info;
254254
rel=rri->ri_RelationDesc;
255255

256256
/* BEFORE ROW UPDATE triggers */
257257
if (rri->ri_TrigDesc&&
258258
rri->ri_TrigDesc->trig_update_before_row)
259259
{
260-
elog(INFO,"kek!");
260+
slot=ExecBRUpdateTriggers(estate,epqstate,rri,tupleid,NULL,slot);
261+
if (TupIsNull(slot))
262+
returnNULL;
261263
}
262264

263265
/* BEFORE ROW DELETE triggers */
@@ -270,10 +272,8 @@ router_delete_tuple(TupleTableSlot *slot,
270272

271273
if (tupleid!=NULL)
272274
{
273-
EvalPlanQualSetSlot(epqstate,slot);
274-
275275
ldelete:
276-
/*delete the tuple */
276+
/*Delete the tuple */
277277
result=heap_delete_compat(rel,tupleid,
278278
estate->es_output_cid,
279279
estate->es_crosscheck_snapshot,
@@ -328,8 +328,7 @@ router_delete_tuple(TupleTableSlot *slot,
328328
elog(ERROR,"unrecognized heap_delete status: %u",result);
329329
}
330330
}
331-
else
332-
elog(ERROR,"tupleid should be specified for deletion");
331+
elseelog(ERROR,"tupleid should be specified for deletion");
333332

334333
/* AFTER ROW DELETE triggers */
335334
ExecARDeleteTriggersCompat(estate,rri,tupleid,NULL,NULL);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp