diff options
author | Andres Freund <andres@anarazel.de> | 2018-03-05 17:49:59 -0800 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2018-03-05 17:49:59 -0800 |
commit | d06aba240d24c499cdd5e77695b3cd28a094e648 (patch) | |
tree | 54d5fc0c2be2370d8c72ae69de0cae348bb91f9d /src/backend/executor | |
parent | 854dd8cff523bc17972d34772b0e39ad3d6d46a4 (diff) | |
download | postgresql-d06aba240d24c499cdd5e77695b3cd28a094e648.tar.gz postgresql-d06aba240d24c499cdd5e77695b3cd28a094e648.zip |
Fix parent node of WCO expressions in partitioned tables.
Since edd44738bc8814 WCO expressions of partitioned tables are
initialized with the first subplan as parent. That's not correct, as
the correct context is the ModifyTableState node. That's also what is
used for RETURNING processing, initialized nearby.
This appears not to cause any visible problems for in core code, but
is problematic for in development patch.
Discussion: https://postgr.es/m/20180303043818.tnvlo243bgy7una3@alap3.anarazel.de
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/execPartition.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c index 54efc9e5452..f6fe7cd61d9 100644 --- a/src/backend/executor/execPartition.c +++ b/src/backend/executor/execPartition.c @@ -413,7 +413,7 @@ ExecInitPartitionInfo(ModifyTableState *mtstate, { WithCheckOption *wco = castNode(WithCheckOption, lfirst(ll)); ExprState *wcoExpr = ExecInitQual(castNode(List, wco->qual), - mtstate->mt_plans[0]); + &mtstate->ps); wcoExprs = lappend(wcoExprs, wcoExpr); } |