]> granicus.if.org Git - postgresql/commitdiff
Pass QueryEnvironment down to EvalPlanQual's EState.
authorThomas Munro <tmunro@postgresql.org>
Tue, 9 Jul 2019 22:15:32 +0000 (10:15 +1200)
committerThomas Munro <tmunro@postgresql.org>
Tue, 9 Jul 2019 22:15:32 +0000 (10:15 +1200)
Otherwise the executor can't see trigger transition tables during
EPQ evaluation.  Fixes bug #15900 and almost certainly also #15720.
Back-patch to 10, where trigger transition tables landed.

Author: Alex Aktsipetrov
Reviewed-by: Thomas Munro, Tom Lane
Discussion: https://postgr.es/m/15900-bc482754fe8d7415%40postgresql.org
Discussion: https://postgr.es/m/15720-38c2b29e5d720187%40postgresql.org

src/backend/executor/execMain.c

index 27f03455152d60157349ccfb7d56b9882ef1c419..29e2681484c2bf1dbc75cb90cc21de12868bc4f8 100644 (file)
@@ -2793,6 +2793,7 @@ EvalPlanQualStart(EPQState *epqstate, EState *parentestate, Plan *planTree)
        estate->es_range_table_array = parentestate->es_range_table_array;
        estate->es_range_table_size = parentestate->es_range_table_size;
        estate->es_relations = parentestate->es_relations;
+       estate->es_queryEnv = parentestate->es_queryEnv;
        estate->es_rowmarks = parentestate->es_rowmarks;
        estate->es_plannedstmt = parentestate->es_plannedstmt;
        estate->es_junkFilter = parentestate->es_junkFilter;