Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit60d50d5

Browse files
committed
Fix incompatibility with 10 version of Postgres
1 parent85ddcf6 commit60d50d5

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

‎deparse.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ static void deparseExpr(Expr *expr, deparse_expr_cxt *context);
114114
staticvoiddeparseVar(Var*node,deparse_expr_cxt*context);
115115
staticvoiddeparseConst(Const*node,deparse_expr_cxt*context,intshowtype);
116116
staticvoiddeparseParam(Param*node,deparse_expr_cxt*context);
117+
#ifPG_VERSION_NUM>=120000
117118
staticvoiddeparseSubscriptingRef(SubscriptingRef*node,deparse_expr_cxt*context);
119+
#else
120+
staticvoiddeparseArrayRef(ArrayRef*node,deparse_expr_cxt*context);
121+
#endif
118122
staticvoiddeparseFuncExpr(FuncExpr*node,deparse_expr_cxt*context);
119123
staticvoiddeparseOpExpr(OpExpr*node,deparse_expr_cxt*context);
120124
staticvoiddeparseOperatorName(StringInfobuf,Form_pg_operatoropform);
@@ -246,10 +250,15 @@ foreign_expr_walker(Node *node,
246250
caseT_Const:
247251
caseT_Param:
248252
break;
253+
#ifPG_VERSION_NUM>=120000
249254
caseT_SubscriptingRef:
250255
{
251256
SubscriptingRef*ar= (SubscriptingRef*)node;
252-
257+
#else
258+
caseT_ArrayRef:
259+
{
260+
ArrayRef*ar= (ArrayRef*)node;
261+
#endif
253262
/* Assignment should not be in restrictions. */
254263
if (ar->refassgnexpr!=NULL)
255264
return false;
@@ -1490,8 +1499,13 @@ deparseExpr(Expr *node, deparse_expr_cxt *context)
14901499
caseT_Param:
14911500
deparseParam((Param*)node,context);
14921501
break;
1502+
#ifPG_VERSION_NUM>=120000
14931503
caseT_SubscriptingRef:
14941504
deparseSubscriptingRef((SubscriptingRef*)node,context);
1505+
#else
1506+
caseT_ArrayRef:
1507+
deparseArrayRef((ArrayRef*)node,context);
1508+
#endif
14951509
break;
14961510
caseT_FuncExpr:
14971511
deparseFuncExpr((FuncExpr*)node,context);
@@ -1724,8 +1738,13 @@ deparseParam(Param *node, deparse_expr_cxt *context)
17241738
/*
17251739
* Deparse an array subscript expression.
17261740
*/
1741+
#ifPG_VERSION_NUM>=120000
17271742
staticvoid
17281743
deparseSubscriptingRef(SubscriptingRef*node,deparse_expr_cxt*context)
1744+
#else
1745+
staticvoid
1746+
deparseArrayRef(ArrayRef*node,deparse_expr_cxt*context)
1747+
#endif
17291748
{
17301749
StringInfobuf=context->buf;
17311750
ListCell*lowlist_item;

‎vops_fdw.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ estimate_path_cost_size(PlannerInfo *root,
10281028
startup_cost+=aggcosts.transCost.per_tuple*input_rows;
10291029
startup_cost+= (cpu_operator_cost*numGroupCols)*input_rows;
10301030
startup_cost+=ptarget->cost.startup;
1031-
1031+
10321032
/*-----
10331033
* Run time cost includes:
10341034
* 1. Run time cost of underneath input relation
@@ -1037,15 +1037,19 @@ estimate_path_cost_size(PlannerInfo *root,
10371037
*-----
10381038
*/
10391039
run_cost=ofpinfo->rel_total_cost-ofpinfo->rel_startup_cost;
1040+
#ifPG_VERSION_NUM>=120000
10401041
run_cost+=aggcosts.finalCost.per_tuple*numGroups;
1042+
#else
1043+
run_cost+=aggcosts.finalCost*numGroups;
1044+
#endif
10411045
run_cost+=cpu_tuple_cost*numGroups;
10421046
run_cost+=ptarget->cost.per_tuple*numGroups;
10431047
}
10441048
else
10451049
{
10461050
/* Clamp retrieved rows estimates to at most foreignrel->tuples. */
10471051
retrieved_rows=Min(retrieved_rows,foreignrel->tuples);
1048-
1052+
10491053
/*
10501054
* Cost as though this were a seqscan, which is pessimistic. We
10511055
* effectively imagine the local_conds are being evaluated

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp