Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ac5f05a

Browse files
committed
[PGPRO-8370] Fix build with vanilla at f5c446e336
Tags: pg_pathman
1 parent 6a9c7d3 commit ac5f05a

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

src/include/compat/pg_compat.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,11 +1208,12 @@ void set_append_rel_size_compat(PlannerInfo *root, RelOptInfo *rel, Index rti);
12081208

12091209
/*
12101210
* make_restrictinfo()
1211+
* In >=16 4th, 5th and 9th arguments were added (991a3df227e)
12111212
* In >=16 3th and 9th arguments were removed (b448f1c8d83)
12121213
* In >=14 new argument was added (55dc86eca70)
12131214
*/
12141215
#if PG_VERSION_NUM >= 160000
1215-
#define make_restrictinfo_compat(r, c, ipd, od, p, sl, rr, or, nr) make_restrictinfo((r), (c), (ipd), (p), (sl), (rr), (or))
1216+
#define make_restrictinfo_compat(r, c, ipd, od, p, sl, rr, or, nr) make_restrictinfo((r), (c), (ipd), false, false, (p), (sl), (rr), NULL, (or))
12161217
#else
12171218
#if PG_VERSION_NUM >= 140000
12181219
#define make_restrictinfo_compat(r, c, ipd, od, p, sl, rr, or, nr) make_restrictinfo((r), (c), (ipd), (od), (p), (sl), (rr), (or), (nr))
@@ -1241,4 +1242,14 @@ void set_append_rel_size_compat(PlannerInfo *root, RelOptInfo *rel, Index rti);
12411242
#define build_expression_pathkey_compat(root, expr, nullable_relids, opno, rel, create_it) build_expression_pathkey(root, expr, nullable_relids, opno, rel, create_it)
12421243
#endif
12431244

1245+
/*
1246+
* EvalPlanQualInit()
1247+
* In >=16 argument was added (70b42f27902)
1248+
*/
1249+
#if PG_VERSION_NUM >= 160000
1250+
#define EvalPlanQualInit_compat(epqstate, parentestate, subplan, auxrowmarks, epqParam) EvalPlanQualInit(epqstate, parentestate, subplan, auxrowmarks, epqParam, NIL)
1251+
#else
1252+
#define EvalPlanQualInit_compat(epqstate, parentestate, subplan, auxrowmarks, epqParam) EvalPlanQualInit(epqstate, parentestate, subplan, auxrowmarks, epqParam)
1253+
#endif
1254+
12441255
#endif /* PG_COMPAT_H */

src/partition_filter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ scan_result_parts_storage(EState *estate, ResultPartsStorage *parts_storage,
345345
child_perminfo->updatedCols = translate_col_privs(parent_perminfo->updatedCols,
346346
translated_vars);
347347

348-
/* Check permissions for partition */
349-
ExecCheckPermissions(list_make1(child_rte), list_make1(child_perminfo), true);
348+
/* Check permissions for one partition */
349+
ExecCheckOneRtePermissions(child_rte, child_perminfo, true);
350350
#else
351351
/* Build Var translation list for 'inserted_cols' */
352352
make_inh_translation_list(base_rel, child_rel, 0, &translated_vars, NULL);

src/partition_router.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ partition_router_begin(CustomScanState *node, EState *estate, int eflags)
170170
/* Remember current relation we're going to delete from */
171171
state->current_rri = estate->es_result_relation_info;
172172

173-
EvalPlanQualInit(&state->epqstate, estate,
174-
state->subplan, NIL,
175-
state->epqparam);
173+
EvalPlanQualInit_compat(&state->epqstate, estate,
174+
state->subplan, NIL,
175+
state->epqparam);
176176

177177
/* It's convenient to store PlanState in 'custom_ps' */
178178
node->custom_ps = list_make1(ExecInitNode(state->subplan, estate, eflags));

src/utility_stmt_hooking.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,14 @@ PathmanDoCopy(const CopyStmt *stmt,
517517
}
518518
else
519519
{
520+
#if PG_VERSION_NUM >= 160000 /* for commit f75cec4fff87 */
521+
/*
522+
* Forget current RangeTblEntries and RTEPermissionInfos.
523+
* Standard DoCopy will create new ones.
524+
*/
525+
pstate->p_rtable = NULL;
526+
pstate->p_rteperminfos = NULL;
527+
#endif
520528
/* Call standard DoCopy using a new CopyStmt */
521529
DoCopyCompat(pstate, stmt, stmt_location, stmt_len, processed);
522530
}

0 commit comments

Comments
 (0)