Skip to content

Commit 4b25894

Browse files
author
Marina Polyakova
committed
Merge remote-tracking branch 'origin/PGPRO-9977'
2 parents 0111830 + f03128e commit 4b25894

File tree

1 file changed

+44
-51
lines changed

1 file changed

+44
-51
lines changed

src/include/compat/pg_compat.h

+44-51
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@
6565
*/
6666
#if PG_VERSION_NUM >= 110000
6767
#define calc_nestloop_required_outer_compat(outer, inner) \
68-
calc_nestloop_required_outer((outer)->parent->relids, PATH_REQ_OUTER(outer), \
68+
calc_nestloop_required_outer((outer)->parent->relids, PATH_REQ_OUTER(outer), \
6969
(inner)->parent->relids, PATH_REQ_OUTER(inner))
7070
#else
7171
#define calc_nestloop_required_outer_compat(outer, inner) \
72-
calc_nestloop_required_outer((outer), (inner))
72+
calc_nestloop_required_outer((outer), (inner))
7373
#endif
7474

7575

@@ -119,12 +119,15 @@
119119
/*
120120
* CheckValidResultRel()
121121
*/
122-
#if PG_VERSION_NUM >= 100000
123-
#define CheckValidResultRelCompat(rri, cmd) \
124-
CheckValidResultRel((rri), (cmd))
122+
#if PG_VERSION_NUM >= 170000
123+
#define CheckValidResultRelCompat(rri, cmd) \
124+
CheckValidResultRel((rri), (cmd), NIL)
125+
#elif PG_VERSION_NUM >= 100000
126+
#define CheckValidResultRelCompat(rri, cmd) \
127+
CheckValidResultRel((rri), (cmd))
125128
#elif PG_VERSION_NUM >= 90500
126-
#define CheckValidResultRelCompat(rri, cmd) \
127-
CheckValidResultRel((rri)->ri_RelationDesc, (cmd))
129+
#define CheckValidResultRelCompat(rri, cmd) \
130+
CheckValidResultRel((rri)->ri_RelationDesc, (cmd))
128131
#endif
129132

130133
/*
@@ -237,18 +240,6 @@
237240
#endif
238241

239242

240-
/*
241-
* CheckValidResultRel()
242-
*/
243-
#if PG_VERSION_NUM >= 100000
244-
#define CheckValidResultRelCompat(rri, cmd) \
245-
CheckValidResultRel((rri), (cmd))
246-
#elif PG_VERSION_NUM >= 90500
247-
#define CheckValidResultRelCompat(rri, cmd) \
248-
CheckValidResultRel((rri)->ri_RelationDesc, (cmd))
249-
#endif
250-
251-
252243
/*
253244
* create_append_path()
254245
*/
@@ -274,7 +265,7 @@
274265
#define create_append_path_compat(rel, subpaths, required_outer, parallel_workers) \
275266
create_append_path(NULL, (rel), (subpaths), NIL, NIL, (required_outer), \
276267
(parallel_workers), false, NIL, -1, false)
277-
#endif /* PGPRO_VERSION */
268+
#endif /* PGPRO_VERSION */
278269

279270
#elif PG_VERSION_NUM >= 110000
280271

@@ -286,7 +277,7 @@
286277
#define create_append_path_compat(rel, subpaths, required_outer, parallel_workers) \
287278
create_append_path(NULL, (rel), (subpaths), NIL, (required_outer), \
288279
(parallel_workers), false, NIL, -1, false, NIL)
289-
#endif /* PGPRO_VERSION */
280+
#endif /* PGPRO_VERSION */
290281

291282
#elif PG_VERSION_NUM >= 100000
292283

@@ -297,7 +288,7 @@
297288
#define create_append_path_compat(rel, subpaths, required_outer, parallel_workers) \
298289
create_append_path((rel), (subpaths), (required_outer), (parallel_workers), NIL, \
299290
false, NIL)
300-
#endif /* PGPRO_VERSION */
291+
#endif /* PGPRO_VERSION */
301292

302293
#elif PG_VERSION_NUM >= 90600
303294

@@ -308,12 +299,12 @@
308299
#define create_append_path_compat(rel, subpaths, required_outer, parallel_workers) \
309300
create_append_path((rel), (subpaths), (required_outer), \
310301
false, NIL, (parallel_workers))
311-
#endif /* PGPRO_VERSION */
302+
#endif /* PGPRO_VERSION */
312303

313304
#elif PG_VERSION_NUM >= 90500
314305
#define create_append_path_compat(rel, subpaths, required_outer, parallel_workers) \
315306
create_append_path((rel), (subpaths), (required_outer))
316-
#endif /* PG_VERSION_NUM */
307+
#endif /* PG_VERSION_NUM */
317308

318309

319310
/*
@@ -423,8 +414,8 @@ extern void create_plain_partial_paths(PlannerInfo *root,
423414
static inline Datum
424415
ExecEvalExprCompat(ExprState *expr, ExprContext *econtext, bool *isnull)
425416
{
426-
ExprDoneCond isdone;
427-
Datum result = ExecEvalExpr(expr, econtext, isnull, &isdone);
417+
ExprDoneCond isdone;
418+
Datum result = ExecEvalExpr(expr, econtext, isnull, &isdone);
428419

429420
if (isdone != ExprSingleResult)
430421
elog(ERROR, "expression should return single value");
@@ -441,9 +432,9 @@ ExecEvalExprCompat(ExprState *expr, ExprContext *econtext, bool *isnull)
441432
static inline bool
442433
ExecCheck(ExprState *state, ExprContext *econtext)
443434
{
444-
Datum ret;
445-
bool isnull;
446-
MemoryContext old_mcxt;
435+
Datum ret;
436+
bool isnull;
437+
MemoryContext old_mcxt;
447438

448439
/* short-circuit (here and in ExecInitCheck) for empty restriction list */
449440
if (state == NULL)
@@ -539,7 +530,7 @@ extern List *get_all_actual_clauses(List *restrictinfo_list);
539530
* get_rel_persistence()
540531
*/
541532
#if PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90600
542-
char get_rel_persistence(Oid relid);
533+
char get_rel_persistence(Oid relid);
543534
#endif
544535

545536

@@ -592,8 +583,8 @@ char get_rel_persistence(Oid relid);
592583
* make_restrictinfo()
593584
*/
594585
#if PG_VERSION_NUM >= 100000
595-
extern List * make_restrictinfos_from_actual_clauses(PlannerInfo *root,
596-
List *clause_list);
586+
extern List *make_restrictinfos_from_actual_clauses(PlannerInfo *root,
587+
List *clause_list);
597588
#endif
598589

599590

@@ -616,17 +607,17 @@ extern Result *make_result(List *tlist,
616607
* McxtStatsInternal()
617608
*/
618609
#if PG_VERSION_NUM >= 90600
619-
void McxtStatsInternal(MemoryContext context, int level,
620-
bool examine_children,
621-
MemoryContextCounters *totals);
610+
void McxtStatsInternal(MemoryContext context, int level,
611+
bool examine_children,
612+
MemoryContextCounters *totals);
622613
#endif
623614

624615

625616
/*
626617
* oid_cmp()
627618
*/
628619
#if PG_VERSION_NUM >=90500 && PG_VERSION_NUM < 100000
629-
extern int oid_cmp(const void *p1, const void *p2);
620+
extern int oid_cmp(const void *p1, const void *p2);
630621
#endif
631622

632623

@@ -635,7 +626,7 @@ extern int oid_cmp(const void *p1, const void *p2);
635626
*
636627
* for v10 cast first arg to RawStmt type
637628
*/
638-
#if PG_VERSION_NUM >= 150000 /* for commit 791b1b71da35 */
629+
#if PG_VERSION_NUM >= 150000 /* for commit 791b1b71da35 */
639630
#define parse_analyze_compat(parse_tree, query_string, param_types, nparams, \
640631
query_env) \
641632
parse_analyze_fixedparams((RawStmt *) (parse_tree), (query_string), (param_types), \
@@ -658,7 +649,7 @@ extern int oid_cmp(const void *p1, const void *p2);
658649
*
659650
* for v10 cast first arg to RawStmt type
660651
*/
661-
#if PG_VERSION_NUM >= 150000 /* for commit 791b1b71da35 */
652+
#if PG_VERSION_NUM >= 150000 /* for commit 791b1b71da35 */
662653
#define pg_analyze_and_rewrite_compat(parsetree, query_string, param_types, \
663654
nparams, query_env) \
664655
pg_analyze_and_rewrite_fixedparams((RawStmt *) (parsetree), (query_string), \
@@ -731,7 +722,7 @@ extern int oid_cmp(const void *p1, const void *p2);
731722
* set_dummy_rel_pathlist()
732723
*/
733724
#if PG_VERSION_NUM >= 90500 && PG_VERSION_NUM < 90600
734-
void set_dummy_rel_pathlist(RelOptInfo *rel);
725+
void set_dummy_rel_pathlist(RelOptInfo *rel);
735726
#endif
736727

737728

@@ -753,8 +744,9 @@ extern void set_rel_consider_parallel(PlannerInfo *root,
753744
* in compat version the type of first argument is (Expr *)
754745
*/
755746
#if PG_VERSION_NUM >= 100000
756-
#if PG_VERSION_NUM >= 140000 /* function removed in 375398244168add84a884347625d14581a421e71 */
757-
extern TargetEntry *tlist_member_ignore_relabel(Expr * node, List * targetlist);
747+
#if PG_VERSION_NUM >= 140000 /* function removed in
748+
* 375398244168add84a884347625d14581a421e71 */
749+
extern TargetEntry *tlist_member_ignore_relabel(Expr *node, List *targetlist);
758750
#endif
759751
#define tlist_member_ignore_relabel_compat(expr, targetlist) \
760752
tlist_member_ignore_relabel((expr), (targetlist))
@@ -784,7 +776,7 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
784776
tupleid, fdw_trigtuple, newslot) \
785777
ExecBRUpdateTriggers((estate), (epqstate), (relinfo), (tupleid), \
786778
(fdw_trigtuple), (newslot), NULL, NULL)
787-
#elif PG_VERSION_NUM >= 150000 /* for commit 7103ebb7aae8 */
779+
#elif PG_VERSION_NUM >= 150000 /* for commit 7103ebb7aae8 */
788780
#define ExecBRUpdateTriggersCompat(estate, epqstate, relinfo, \
789781
tupleid, fdw_trigtuple, newslot) \
790782
ExecBRUpdateTriggers((estate), (epqstate), (relinfo), (tupleid), \
@@ -835,7 +827,7 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
835827
/*
836828
* ExecARDeleteTriggers()
837829
*/
838-
#if PG_VERSION_NUM >= 150000 /* for commit ba9a7e392171 */
830+
#if PG_VERSION_NUM >= 150000 /* for commit ba9a7e392171 */
839831
#define ExecARDeleteTriggersCompat(estate, relinfo, tupleid, \
840832
fdw_trigtuple, transition_capture) \
841833
ExecARDeleteTriggers((estate), (relinfo), (tupleid), \
@@ -979,9 +971,9 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
979971
* we need access to entire tuple, not just its header.
980972
*/
981973
#ifdef XID_IS_64BIT
982-
# define HeapTupleGetXminCompat(htup) HeapTupleGetXmin(htup)
974+
#define HeapTupleGetXminCompat(htup) HeapTupleGetXmin(htup)
983975
#else
984-
# define HeapTupleGetXminCompat(htup) HeapTupleHeaderGetXmin((htup)->t_data)
976+
#define HeapTupleGetXminCompat(htup) HeapTupleHeaderGetXmin((htup)->t_data)
985977
#endif
986978

987979
/*
@@ -1124,9 +1116,10 @@ static inline TupleTableSlot *
11241116
ExecInitExtraTupleSlotCompatHorse(EState *s, TupleDesc t)
11251117
{
11261118
#if PG_VERSION_NUM >= 110000
1127-
return ExecInitExtraTupleSlot(s,t);
1119+
return ExecInitExtraTupleSlot(s, t);
11281120
#else
1129-
TupleTableSlot *res = ExecInitExtraTupleSlot(s);
1121+
TupleTableSlot *res = ExecInitExtraTupleSlot(s);
1122+
11301123
if (t)
11311124
ExecSetSlotDescriptor(res, t);
11321125

@@ -1158,7 +1151,7 @@ CustomEvalParamExternCompat(Param *param,
11581151
return prm;
11591152
}
11601153

1161-
void set_append_rel_size_compat(PlannerInfo *root, RelOptInfo *rel, Index rti);
1154+
void set_append_rel_size_compat(PlannerInfo *root, RelOptInfo *rel, Index rti);
11621155

11631156
/*
11641157
* lnext()
@@ -1219,8 +1212,8 @@ void set_append_rel_size_compat(PlannerInfo *root, RelOptInfo *rel, Index rti);
12191212
#define make_restrictinfo_compat(r, c, ipd, od, p, sl, rr, or, nr) make_restrictinfo((r), (c), (ipd), (od), (p), (sl), (rr), (or), (nr))
12201213
#else
12211214
#define make_restrictinfo_compat(r, c, ipd, od, p, sl, rr, or, nr) make_restrictinfo((c), (ipd), (od), (p), (sl), (rr), (or), (nr))
1222-
#endif /* #if PG_VERSION_NUM >= 140000 */
1223-
#endif /* #if PG_VERSION_NUM >= 160000 */
1215+
#endif /* #if PG_VERSION_NUM >= 140000 */
1216+
#endif /* #if PG_VERSION_NUM >= 160000 */
12241217

12251218
/*
12261219
* pull_varnos()
@@ -1252,4 +1245,4 @@ void set_append_rel_size_compat(PlannerInfo *root, RelOptInfo *rel, Index rti);
12521245
#define EvalPlanQualInit_compat(epqstate, parentestate, subplan, auxrowmarks, epqParam) EvalPlanQualInit(epqstate, parentestate, subplan, auxrowmarks, epqParam)
12531246
#endif
12541247

1255-
#endif /* PG_COMPAT_H */
1248+
#endif /* PG_COMPAT_H */

0 commit comments

Comments
 (0)