aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execUtils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-03-06 13:10:57 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2023-03-06 13:10:57 -0500
commitb803b7d132e3505ab77c29acf91f3d1caa298f95 (patch)
treed93cd1634ecf89e8388ebc424c8b9ca25280cbb9 /src/backend/executor/execUtils.c
parente76cbb6cd64d9c9cdf76a56318ba5249bf694b69 (diff)
downloadpostgresql-b803b7d132e3505ab77c29acf91f3d1caa298f95.tar.gz
postgresql-b803b7d132e3505ab77c29acf91f3d1caa298f95.zip
Fill EState.es_rteperminfos more systematically.
While testing a fix for bug #17823, I discovered that EvalPlanQualStart failed to copy es_rteperminfos from the parent EState, resulting in failure if anything in EPQ execution wanted to consult that information. This led me to conclude that commit a61b1f748 had been too haphazard about where to fill es_rteperminfos, and that we need to be sure that that happens exactly where es_range_table gets filled. So I changed the signature of ExecInitRangeTable to help ensure that this new requirement doesn't get missed. (Indeed, pgoutput.c was also failing to fill it. Maybe we don't ever need it there, but I wouldn't bet on that.) No test case yet; one will arrive with the fix for #17823. But that needs to be back-patched, while this fix is HEAD-only. Discussion: https://postgr.es/m/17823-b64909cf7d63de84@postgresql.org
Diffstat (limited to 'src/backend/executor/execUtils.c')
-rw-r--r--src/backend/executor/execUtils.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index cfa95a07e40..6eac5f354c3 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -121,6 +121,7 @@ CreateExecutorState(void)
estate->es_range_table_size = 0;
estate->es_relations = NULL;
estate->es_rowmarks = NULL;
+ estate->es_rteperminfos = NIL;
estate->es_plannedstmt = NULL;
estate->es_part_prune_infos = NIL;
@@ -755,11 +756,14 @@ ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
* indexed by rangetable index.
*/
void
-ExecInitRangeTable(EState *estate, List *rangeTable)
+ExecInitRangeTable(EState *estate, List *rangeTable, List *permInfos)
{
/* Remember the range table List as-is */
estate->es_range_table = rangeTable;
+ /* ... and the RTEPermissionInfo List too */
+ estate->es_rteperminfos = permInfos;
+
/* Set size of associated arrays */
estate->es_range_table_size = list_length(rangeTable);