Skip to content

Internal subquery table names should not be visible to the user #3620

@LeMikaelF

Description

@LeMikaelF

Internal names for subqueries, like subquery_0 and subquery_1, should not be accessible to the user. Currently, they are explicitly shown when using VALUES clauses in subqueries:

turso> select * from (values (1));
┌───────────────┐
│ subquery_0.c0 │
├───────────────┤
│             1 │
└───────────────┘

Which can lead to erroneous disambiguation when there are name collisions with user-defined table aliases. For example, the query below returns the wrong column:

turso> select subquery_0.* from (values (1)) inner join (values (2)) subquery_0;
┌───────────────┐
│ subquery_0.c0 │
├───────────────┤
│             1 │
└───────────────┘

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions