mirror of https://github.com/citusdata/citus.git
Only look in top-level rtable in ExtractFirstDistributedTableId
parent
ee6a0b6943
commit
e8152d9b6d
|
@ -1543,16 +1543,18 @@ CreateTask(TaskType taskType)
|
||||||
* ExtractFirstDistributedTableId takes a given query, and finds the relationId
|
* ExtractFirstDistributedTableId takes a given query, and finds the relationId
|
||||||
* for the first distributed table in that query. If the function cannot find a
|
* for the first distributed table in that query. If the function cannot find a
|
||||||
* distributed table, it returns InvalidOid.
|
* distributed table, it returns InvalidOid.
|
||||||
|
*
|
||||||
|
* We only use this function for modifications and fast path queries, which
|
||||||
|
* should have the first distributed table in the top-level rtable.
|
||||||
*/
|
*/
|
||||||
Oid
|
Oid
|
||||||
ExtractFirstDistributedTableId(Query *query)
|
ExtractFirstDistributedTableId(Query *query)
|
||||||
{
|
{
|
||||||
List *rangeTableList = NIL;
|
List *rangeTableList = query->rtable;
|
||||||
ListCell *rangeTableCell = NULL;
|
ListCell *rangeTableCell = NULL;
|
||||||
Oid distributedTableId = InvalidOid;
|
Oid distributedTableId = InvalidOid;
|
||||||
|
|
||||||
/* extract range table entries */
|
Assert(IsModifyCommand(query) || FastPathRouterQuery(query));
|
||||||
ExtractRangeTableEntryWalker((Node *) query, &rangeTableList);
|
|
||||||
|
|
||||||
foreach(rangeTableCell, rangeTableList)
|
foreach(rangeTableCell, rangeTableList)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue