mirror of https://github.com/citusdata/citus.git
Backport get_all_actual_clauses
This is the sole PostgreSQL 10 change that "breaks" Citus; we use this function and no alternative is available. Fortunately, it's small enough to copy-paste.pull/1439/head
parent
59a4fb596c
commit
6c48c93b6a
|
@ -134,6 +134,9 @@ static DeferredErrorMessage * InsertPartitionColumnMatchesSelect(Query *query,
|
||||||
Oid *
|
Oid *
|
||||||
selectPartitionColumnTableId);
|
selectPartitionColumnTableId);
|
||||||
static DeferredErrorMessage * ErrorIfQueryHasModifyingCTE(Query *queryTree);
|
static DeferredErrorMessage * ErrorIfQueryHasModifyingCTE(Query *queryTree);
|
||||||
|
#if (PG_VERSION_NUM >= 100000)
|
||||||
|
static List * get_all_actual_clauses(List *restrictinfo_list);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3026,3 +3029,34 @@ ErrorIfQueryHasModifyingCTE(Query *queryTree)
|
||||||
/* everything OK */
|
/* everything OK */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if (PG_VERSION_NUM >= 100000)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* get_all_actual_clauses
|
||||||
|
*
|
||||||
|
* Returns a list containing the bare clauses from 'restrictinfo_list'.
|
||||||
|
*
|
||||||
|
* This loses the distinction between regular and pseudoconstant clauses,
|
||||||
|
* so be careful what you use it for.
|
||||||
|
*/
|
||||||
|
static List *
|
||||||
|
get_all_actual_clauses(List *restrictinfo_list)
|
||||||
|
{
|
||||||
|
List *result = NIL;
|
||||||
|
ListCell *l;
|
||||||
|
|
||||||
|
foreach(l, restrictinfo_list)
|
||||||
|
{
|
||||||
|
RestrictInfo *rinfo = (RestrictInfo *) lfirst(l);
|
||||||
|
|
||||||
|
Assert(IsA(rinfo, RestrictInfo));
|
||||||
|
|
||||||
|
result = lappend(result, rinfo->clause);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue