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

Commit72e3c00

Browse files
committed
Add stub version of parse_partitioning_expression and ExprDoneCond flag as result of ExecEvalExpr for pg10
1 parent3cb69ae commit72e3c00

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

‎src/partition_filter.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,9 @@ partition_filter_exec(CustomScanState *node)
600600
ResultRelInfoHolder*rri_holder;
601601
boolisnull;
602602
Datumvalue;
603+
#ifPG_VERSION_NUM<100000
603604
ExprDoneConditemIsDone;
605+
#endif
604606
TupleTableSlot*tmp_slot;
605607

606608
/* Fetch PartRelationInfo for this partitioned relation */
@@ -628,8 +630,10 @@ partition_filter_exec(CustomScanState *node)
628630
if (isnull)
629631
elog(ERROR,ERR_PART_ATTR_NULL);
630632

633+
#ifPG_VERSION_NUM<100000
631634
if (itemIsDone!=ExprSingleResult)
632635
elog(ERROR,ERR_PART_ATTR_MULTIPLE_RESULTS);
636+
#endif
633637

634638
/* Search for a matching partition */
635639
rri_holder=select_partition_for_insert(value,prel->ev_type,prel,

‎src/pg_pathman.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,7 @@ get_cheapest_parameterized_child_path(PlannerInfo *root, RelOptInfo *rel,
19391939
NIL,
19401940
required_outer,
19411941
TOTAL_COST,
1942-
true);
1942+
false);
19431943
#else
19441944
cheapest=get_cheapest_path_for_pathkeys(rel->pathlist,
19451945
NIL,

‎src/pl_funcs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,9 @@ pathman_update_trigger_func(PG_FUNCTION_ARGS)
11271127
Datumvalue;
11281128
Oidvalue_type;
11291129
boolisnull;
1130+
#ifPG_VERSION_NUM<100000
11301131
ExprDoneConditemIsDone;
1132+
#endif
11311133

11321134
Oid*parts;
11331135
intnparts;
@@ -1182,8 +1184,10 @@ pathman_update_trigger_func(PG_FUNCTION_ARGS)
11821184
if (isnull)
11831185
elog(ERROR,ERR_PART_ATTR_NULL);
11841186

1187+
#ifPG_VERSION_NUM<100000
11851188
if (itemIsDone!=ExprSingleResult)
11861189
elog(ERROR,ERR_PART_ATTR_MULTIPLE_RESULTS);
1190+
#endif
11871191

11881192
/* Search for matching partitions */
11891193
parts=find_partitions_for_value(value,value_type,prel,&nparts);

‎src/relation_info.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,21 @@ parse_partitioning_expression(const Oid relid,
579579
if (list_length(parsetree_list)!=1)
580580
elog(ERROR,"expression \"%s\" produced more than one query",exp_cstr);
581581

582+
#ifPG_VERSION_NUM >=100000
583+
select_stmt= (SelectStmt*) ((RawStmt*)linitial(parsetree_list))->stmt;
584+
#else
582585
select_stmt= (SelectStmt*)linitial(parsetree_list);
586+
#endif
583587

584588
if (query_string_out)
585589
*query_string_out=query_string;
586590

587591
if (parsetree_out)
592+
#ifPG_VERSION_NUM >=100000
593+
*parsetree_out= (Node*)linitial(parsetree_list);
594+
#else
588595
*parsetree_out= (Node*)select_stmt;
596+
#endif
589597

590598
return ((ResTarget*)linitial(select_stmt->targetList))->val;
591599
}
@@ -662,7 +670,7 @@ cook_partitioning_expression(const Oid relid,
662670

663671
/* This will fail with elog in case of wrong expression */
664672
#ifPG_VERSION_NUM >=100000
665-
querytree_list=pg_analyze_and_rewrite(NULL/* stub value */,query_string,NULL,0,NULL);
673+
querytree_list=pg_analyze_and_rewrite((RawStmt*)parsetree/* stub value */,query_string,NULL,0,NULL);
666674
#else
667675
querytree_list=pg_analyze_and_rewrite(parsetree,query_string,NULL,0);
668676
#endif

‎src/utility_stmt_hooking.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,9 @@ PathmanCopyFrom(CopyState cstate, Relation parent_rel,
607607
{
608608
TupleTableSlot*slot,
609609
*tmp_slot;
610+
#ifPG_VERSION_NUM<100000
610611
ExprDoneConditemIsDone;
612+
#endif
611613
boolskip_tuple,
612614
isnull;
613615
Oidtuple_oid=InvalidOid;
@@ -657,8 +659,10 @@ PathmanCopyFrom(CopyState cstate, Relation parent_rel,
657659
if (isnull)
658660
elog(ERROR,ERR_PART_ATTR_NULL);
659661

662+
#ifPG_VERSION_NUM<100000
660663
if (itemIsDone!=ExprSingleResult)
661664
elog(ERROR,ERR_PART_ATTR_MULTIPLE_RESULTS);
665+
#endif
662666

663667
/* Search for a matching partition */
664668
rri_holder=select_partition_for_insert(value,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp