@@ -417,7 +417,7 @@ select_partition_for_insert(Datum value, Oid value_type,
417417 ResultPartsStorage * parts_storage ,
418418 EState * estate )
419419{
420- MemoryContext old_cxt ;
420+ MemoryContext old_mcxt ;
421421 ResultRelInfoHolder * rri_holder ;
422422 Oid selected_partid = InvalidOid ;
423423 Oid * parts ;
@@ -439,9 +439,9 @@ select_partition_for_insert(Datum value, Oid value_type,
439439 else selected_partid = parts [0 ];
440440
441441 /* Replace parent table with a suitable partition */
442- old_cxt = MemoryContextSwitchTo (estate -> es_query_cxt );
442+ old_mcxt = MemoryContextSwitchTo (estate -> es_query_cxt );
443443 rri_holder = scan_result_parts_storage (selected_partid , parts_storage );
444- MemoryContextSwitchTo (old_cxt );
444+ MemoryContextSwitchTo (old_mcxt );
445445
446446 /* Could not find suitable partition */
447447 if (rri_holder == NULL )
@@ -531,12 +531,12 @@ partition_filter_create_scan_state(CustomScan *node)
531531void
532532partition_filter_begin (CustomScanState * node , EState * estate , int eflags )
533533{
534- Index varno = 1 ;
535- Node * expr ;
536- MemoryContext old_cxt ;
537- PartitionFilterState * state = (PartitionFilterState * ) node ;
538- const PartRelationInfo * prel ;
539- ListCell * lc ;
534+ Index varno = 1 ;
535+ Node * expr ;
536+ MemoryContext old_mcxt ;
537+ PartitionFilterState * state = (PartitionFilterState * ) node ;
538+ const PartRelationInfo * prel ;
539+ ListCell * lc ;
540540
541541 /* It's convenient to store PlanState in 'custom_ps' */
542542 node -> custom_ps = list_make1 (ExecInitNode (state -> subplan , estate , eflags ));
@@ -562,9 +562,9 @@ partition_filter_begin(CustomScanState *node, EState *estate, int eflags)
562562 }
563563
564564 /* Prepare state for expression execution */
565- old_cxt = MemoryContextSwitchTo (estate -> es_query_cxt );
565+ old_mcxt = MemoryContextSwitchTo (estate -> es_query_cxt );
566566 state -> expr_state = ExecInitExpr ((Expr * ) expr , NULL );
567- MemoryContextSwitchTo (old_cxt );
567+ MemoryContextSwitchTo (old_mcxt );
568568 }
569569
570570 /* Init ResultRelInfo cache */
@@ -595,13 +595,13 @@ partition_filter_exec(CustomScanState *node)
595595
596596 if (!TupIsNull (slot ))
597597 {
598- MemoryContext old_cxt ;
599- const PartRelationInfo * prel ;
600- ResultRelInfoHolder * rri_holder ;
601- bool isnull ;
602- Datum value ;
603- ExprDoneCond itemIsDone ;
604- TupleTableSlot * tmp_slot ;
598+ MemoryContext old_mcxt ;
599+ const PartRelationInfo * prel ;
600+ ResultRelInfoHolder * rri_holder ;
601+ bool isnull ;
602+ Datum value ;
603+ ExprDoneCond itemIsDone ;
604+ TupleTableSlot * tmp_slot ;
605605
606606 /* Fetch PartRelationInfo for this partitioned relation */
607607 prel = get_pathman_relation_info (state -> partitioned_table );
@@ -616,7 +616,7 @@ partition_filter_exec(CustomScanState *node)
616616 }
617617
618618 /* Switch to per-tuple context */
619- old_cxt = MemoryContextSwitchTo (GetPerTupleMemoryContext (estate ));
619+ old_mcxt = MemoryContextSwitchTo (GetPerTupleMemoryContext (estate ));
620620
621621 /* Execute expression */
622622 tmp_slot = econtext -> ecxt_scantuple ;
@@ -635,7 +635,7 @@ partition_filter_exec(CustomScanState *node)
635635 & state -> result_parts , estate );
636636
637637 /* Switch back and clean up per-tuple context */
638- MemoryContextSwitchTo (old_cxt );
638+ MemoryContextSwitchTo (old_mcxt );
639639 ResetExprContext (econtext );
640640
641641 /* Magic: replace parent's ResultRelInfo with ours */
0 commit comments