Skip to content

Commit 58ef2a5

Browse files
committed
Copy and calculate in per tuple memory context
1 parent e37bec3 commit 58ef2a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/partition_filter.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,15 +632,15 @@ partition_filter_exec(CustomScanState *node)
632632
return slot;
633633
}
634634

635+
/* Switch to per-tuple context */
636+
old_cxt = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
637+
635638
/* Prepare walker context */
636-
expr_walker_context.prel = prel; /* maybe slot will be enough */
639+
expr_walker_context.prel = prel;
637640
expr_walker_context.slot = slot;
638641
expr_walker_context.tup = ExecCopySlotTuple(slot);
639642
expr_walker_context.clear = false;
640643

641-
/* Switch to per-tuple context */
642-
old_cxt = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
643-
644644
/* Fetch values from slot for expression */
645645
adapt_values((Node *)prel->expr, (void *) &expr_walker_context);
646646

0 commit comments

Comments
 (0)