Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 45e040a

Browse files
committed
fix memory issues found by Valgrind (reset state after each subplan)
1 parent 801f2ae commit 45e040a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/partition_router.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
/* Highlight hacks with ModifyTable's fields */
3030
#define MTHackField(mt_state, field) ( (mt_state)->field )
3131

32-
/* Is current plan the last one? */
33-
#define MTIsLastPlan(mt_state) ( (mt_state)->mt_whichplan == (mt_state)->mt_nplans - 1 )
34-
3532

3633
#define MTDisableStmtTriggers(mt_state, pr_state) \
3734
do { \
@@ -402,7 +399,7 @@ router_get_slot(PartitionRouterState *state,
402399
slot = ExecProcNode((PlanState *) linitial(state->css.custom_ps));
403400

404401
/* Restore operation type for AFTER STATEMENT triggers */
405-
if (TupIsNull(slot) && MTIsLastPlan(state->mt_state))
402+
if (TupIsNull(slot))
406403
slot = router_set_slot(state, NULL, CMD_UPDATE);
407404

408405
/* But we have to process non-empty slot */

0 commit comments

Comments
 (0)