mirror of https://github.com/citusdata/citus.git
Add RangeTableEntryFromNSItem macro
addRangeTableEntryXXX methods return a ParseNamespaceItem with pg >= 13. RangeTableEntryFromNSItem macro is added so that we return the range table entry from the ParseNamespaceItem in pg>=13 and for pg < 13 rte would already be returned with addRangeTableEntryXXX methods. Commit on Postgres side: 5815696bc66b3092f6361f53e0394909647042c8pull/3900/head
parent
4ed30a0824
commit
1a7ccac6ef
|
@ -346,9 +346,8 @@ WrapSubquery(Query *subquery)
|
|||
|
||||
/* create range table entries */
|
||||
Alias *selectAlias = makeAlias("citus_insert_select_subquery", NIL);
|
||||
RangeTblEntry *newRangeTableEntry = addRangeTableEntryForSubquery(pstate, subquery,
|
||||
selectAlias, false,
|
||||
true);
|
||||
RangeTblEntry *newRangeTableEntry = RangeTableEntryFromNSItem(addRangeTableEntryForSubquery(
|
||||
pstate, subquery, selectAlias, false, true));
|
||||
outerQuery->rtable = list_make1(newRangeTableEntry);
|
||||
|
||||
/* set the FROM expression to the subquery */
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#define varoattno varattnosyn
|
||||
#define varnoold varnosyn
|
||||
#define Set_ptr_value(a,b) a->ptr_value = b
|
||||
#define RangeTableEntryFromNSItem(a) a->p_rte
|
||||
#else /* pre PG13 */
|
||||
#define lnext_compat(l, r) lnext(r)
|
||||
#define list_delete_cell_compat(l,c,p) list_delete_cell(l,c,p)
|
||||
|
@ -50,6 +51,7 @@
|
|||
#define getOwnedSequencesCompat(a,b) getOwnedSequences(a,b)
|
||||
#define ExplainOnePlanCompat(a,b,c,d,e,f,g,h) ExplainOnePlan(a,b,c,d,e,f,g)
|
||||
#define Set_ptr_value(a,b) a->data.ptr_value = b
|
||||
#define RangeTableEntryFromNSItem(a) a
|
||||
#endif
|
||||
#if PG_VERSION_NUM >= PG_VERSION_12
|
||||
|
||||
|
|
Loading…
Reference in New Issue