Rename ContainsOnlyLocalTables to ContainsOnlyLocalOrReferenceTables for clarity and update related documentation

pull/7897/head
Mehmet Yilmaz 2025-02-12 15:19:01 +00:00 committed by Mehmet YILMAZ
parent 6c03d1b82b
commit 27fc62787f
4 changed files with 9 additions and 7 deletions

View File

@ -1583,7 +1583,7 @@ IsLocalTableModification(Oid targetRelationId, Query *query, uint64 shardId,
return true; return true;
} }
if (shardId == INVALID_SHARD_ID && ContainsOnlyLocalTables(rteProperties)) if (shardId == INVALID_SHARD_ID && ContainsOnlyLocalOrReferenceTables(rteProperties))
{ {
return true; return true;
} }

View File

@ -2556,13 +2556,15 @@ AllShardsColocated(List *relationShardList)
/* /*
* ContainsOnlyLocalTables returns true if there is only * ContainsOnlyLocalOrReferenceTables returns true if there are no distributed
* local tables and not any distributed or reference table. * tables in the query. In other words, the query might reference only local
* tables and/or reference tables, but no fully distributed tables.
*/ */
bool bool
ContainsOnlyLocalTables(RTEListProperties *rteProperties) ContainsOnlyLocalOrReferenceTables(RTEListProperties *rteProperties)
{ {
return !rteProperties->hasDistributedTable; // If hasDistributedTable is false, then all tables are either local or reference.
return !rteProperties->hasDistributedTable;
} }

View File

@ -118,7 +118,7 @@ extern bool HasDangerousJoinUsing(List *rtableList, Node *jtnode);
extern Job * RouterJob(Query *originalQuery, extern Job * RouterJob(Query *originalQuery,
PlannerRestrictionContext *plannerRestrictionContext, PlannerRestrictionContext *plannerRestrictionContext,
DeferredErrorMessage **planningError); DeferredErrorMessage **planningError);
extern bool ContainsOnlyLocalTables(RTEListProperties *rteProperties); extern bool ContainsOnlyLocalOrReferenceTables(RTEListProperties *rteProperties);
extern RangeTblEntry * ExtractSourceResultRangeTableEntry(Query *query); extern RangeTblEntry * ExtractSourceResultRangeTableEntry(Query *query);
#endif /* MULTI_ROUTER_PLANNER_H */ #endif /* MULTI_ROUTER_PLANNER_H */

View File

@ -103,7 +103,7 @@ test: multi_dropped_column_aliases foreign_key_restriction_enforcement
test: binary_protocol test: binary_protocol
test: alter_table_set_access_method test: alter_table_set_access_method
test: alter_distributed_table test: alter_distributed_table
test: issue_5248 issue_5099 issue_5763 issue_6543 issue_6758 issue_7477 test: issue_5248 issue_5099 issue_5763 issue_6543 issue_6758 issue_7477 issue_7891
test: object_propagation_debug test: object_propagation_debug
test: undistribute_table test: undistribute_table
test: run_command_on_all_nodes test: run_command_on_all_nodes