mirror of https://github.com/citusdata/citus.git
Fix merge tests
parent
90feda69dc
commit
dbcf217050
|
@ -723,7 +723,7 @@ ErrorIfRepartitionMergeNotSupported(Oid targetRelationId, Query *mergeQuery,
|
||||||
/*
|
/*
|
||||||
* Sub-queries and CTEs are not allowed in actions and ON clause
|
* Sub-queries and CTEs are not allowed in actions and ON clause
|
||||||
*/
|
*/
|
||||||
if (FindNodeMatchingCheckFunction((Node *) mergeQuery->jointree->quals,
|
if (FindNodeMatchingCheckFunction((Node *) mergeQuery->mergeJoinCondition,
|
||||||
IsNodeSubquery))
|
IsNodeSubquery))
|
||||||
{
|
{
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
|
@ -1225,11 +1225,12 @@ ErrorIfMergeQueryQualAndTargetListNotSupported(Oid targetRelationId, Query *orig
|
||||||
}
|
}
|
||||||
|
|
||||||
DeferredErrorMessage *deferredError =
|
DeferredErrorMessage *deferredError =
|
||||||
MergeQualAndTargetListFunctionsSupported(targetRelationId,
|
MergeQualAndTargetListFunctionsSupported(
|
||||||
originalQuery,
|
targetRelationId,
|
||||||
originalQuery->jointree->quals,
|
originalQuery,
|
||||||
originalQuery->targetList,
|
originalQuery->jointree->mergeConditions,
|
||||||
originalQuery->commandType);
|
originalQuery->targetList,
|
||||||
|
originalQuery->commandType);
|
||||||
|
|
||||||
if (deferredError)
|
if (deferredError)
|
||||||
{
|
{
|
||||||
|
@ -1304,7 +1305,19 @@ SourceResultPartitionColumnIndex(Query *mergeQuery, List *sourceTargetList,
|
||||||
CitusTableCacheEntry *targetRelation)
|
CitusTableCacheEntry *targetRelation)
|
||||||
{
|
{
|
||||||
/* Get all the Join conditions from the ON clause */
|
/* Get all the Join conditions from the ON clause */
|
||||||
List *mergeJoinConditionList = WhereClauseList(mergeQuery->jointree);
|
List *mergeJoinConditionList = NIL;
|
||||||
|
if (IsA(mergeQuery->mergeJoinCondition, List))
|
||||||
|
{
|
||||||
|
mergeJoinConditionList = (List *) mergeQuery->mergeJoinCondition;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Node *joinClause =
|
||||||
|
eval_const_expressions(NULL, mergeQuery->mergeJoinCondition);
|
||||||
|
joinClause = (Node *) canonicalize_qual((Expr *) joinClause, false);
|
||||||
|
mergeJoinConditionList = make_ands_implicit((Expr *) joinClause);
|
||||||
|
}
|
||||||
|
|
||||||
Var *targetColumn = targetRelation->partitionColumn;
|
Var *targetColumn = targetRelation->partitionColumn;
|
||||||
Var *sourceRepartitionVar = NULL;
|
Var *sourceRepartitionVar = NULL;
|
||||||
bool foundTypeMismatch = false;
|
bool foundTypeMismatch = false;
|
||||||
|
|
Loading…
Reference in New Issue