Skip to content

Delegate Column Availability Checks to MySQL When Possible #17083

@systay

Description

@systay

When a query can be routed to a single shard and sent directly to MySQL, column availability checks should be deferred to MySQL rather than resulting in an error at the vtgate planner.

Example:

select foo, bar 
from user u, user_extra ue 
where u.id = ue.user_id

Problem:

If vtgate is running without schema tracking, it may be unable to determine the tables to which columns like foo and bar belong, resulting in an ambiguous column error. However, because this query can be merged into a single route based on sharding key choices, it is unnecessary to perform these column checks at the vtgate level. Instead, we can rely on MySQL to handle column validation and return a meaningful error if any issues are found.

Proposed Solution:

Skip vtgate column validation for queries routed to a single shard and let MySQL manage column availability checks to avoid redundant errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions