mirror of https://github.com/citusdata/citus.git
Merge pull request #544 from citusdata/fix/fix_475_remove_only_clause_from_worker_queries
Remove ONLY clause from worker queriespull/536/head
commit
b9dc906ab5
|
@ -71,6 +71,7 @@ static Const * ExtractInsertPartitionValue(Query *query, Var *partitionColumn);
|
|||
static Task * RouterSelectTask(Query *query);
|
||||
static Job * RouterQueryJob(Query *query, Task *task);
|
||||
static bool ColumnMatchExpressionAtTopLevelConjunction(Node *node, Var *column);
|
||||
static void SetRangeTablesInherited(Query *query);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -424,6 +425,12 @@ RouterModifyTask(Query *query)
|
|||
upsertQuery = false;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We set inh flag of all range tables entries to true so that deparser will not
|
||||
* add ONLY keyword to resulting query string.
|
||||
*/
|
||||
SetRangeTablesInherited(query);
|
||||
|
||||
deparse_shard_query(query, shardInterval->relationId, shardId, queryString);
|
||||
ereport(DEBUG4, (errmsg("distributed statement: %s", queryString->data)));
|
||||
|
||||
|
@ -778,6 +785,12 @@ RouterSelectTask(Query *query)
|
|||
joinTree->quals = whereClause;
|
||||
}
|
||||
|
||||
/*
|
||||
* We set inh flag of all range tables entries to true so that deparser will not
|
||||
* add ONLY keyword to resulting query string.
|
||||
*/
|
||||
SetRangeTablesInherited(query);
|
||||
|
||||
deparse_shard_query(query, shardInterval->relationId, shardId, queryString);
|
||||
ereport(DEBUG4, (errmsg("distributed statement: %s", queryString->data)));
|
||||
|
||||
|
@ -1043,3 +1056,24 @@ ColumnMatchExpressionAtTopLevelConjunction(Node *node, Var *column)
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* RouterSetRangeTablesInherited sets inh flag of all range table entries to true.
|
||||
* We basically iterate over all range table entries and set their inh flag.
|
||||
*/
|
||||
static void
|
||||
SetRangeTablesInherited(Query *query)
|
||||
{
|
||||
List *rangeTableList = query->rtable;
|
||||
ListCell *rangeTableCell = NULL;
|
||||
|
||||
foreach(rangeTableCell, rangeTableList)
|
||||
{
|
||||
RangeTblEntry *rangeTableEntry = (RangeTblEntry *) lfirst(rangeTableCell);
|
||||
if (rangeTableEntry->rtekind == RTE_RELATION)
|
||||
{
|
||||
rangeTableEntry->inh = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue