mirror of https://github.com/citusdata/citus.git
Fix some bugs
parent
cf2239f9cd
commit
7de878f0ca
|
@ -89,6 +89,7 @@ extract_equality_filters_from_query(PG_FUNCTION_ARGS)
|
|||
char *queryString = text_to_cstring(PG_GETARG_TEXT_P(0));
|
||||
|
||||
MemoryContext oldContext = CurrentMemoryContext;
|
||||
ResourceOwner oldOwner = CurrentResourceOwner;
|
||||
|
||||
/* capture filters via hooks */
|
||||
PlannerRestrictionContext *plannerRestrictionContext =
|
||||
|
@ -153,6 +154,12 @@ extract_equality_filters_from_query(PG_FUNCTION_ARGS)
|
|||
Var *leftVar = NULL;
|
||||
Const *rightConst = NULL;
|
||||
|
||||
if (!NodeIsEqualsOpExpr((Node *) clause))
|
||||
{
|
||||
/* not an equals expression */
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!VarConstOpExprClause((OpExpr *) clause, &leftVar, &rightConst) &&
|
||||
!VarNullWrapperOpExprClause(clause, wrapperFunctionId, &leftVar))
|
||||
{
|
||||
|
@ -273,6 +280,8 @@ extract_equality_filters_from_query(PG_FUNCTION_ARGS)
|
|||
|
||||
FlushErrorState();
|
||||
RollbackAndReleaseCurrentSubTransaction();
|
||||
MemoryContextSwitchTo(oldContext);
|
||||
CurrentResourceOwner = oldOwner;
|
||||
}
|
||||
PG_END_TRY();
|
||||
|
||||
|
|
Loading…
Reference in New Issue