Skip to content

LEFT/RIGHT OUTER JOIN failed to detect ambiguous column reference (SQLancer-NoREC)Β #11408

@2010YOUY01

Description

@2010YOUY01

Describe the bug

Table reference in this query is ambiguous, and should be rejected by the planner.
select t1.v1 from t1 left outer join t1 on true;
Now it can be run successfully, see the reproducer:
(It can also be reproduced if 'left outer join' is changed to 'left join' 'right join' 'right outer join')

> create table t1(v1 int);
0 row(s) fetched.
Elapsed 0.068 seconds.

> insert into t1 values (1);
+-------+
| count |
+-------+
| 1     |
+-------+
1 row(s) fetched.
Elapsed 0.054 seconds.

> select t1.v1 from t1 left outer join t1 on true;
+----+
| v1 |
+----+
| 1  |
+----+
1 row(s) fetched.
Elapsed 0.016 seconds.

> select v1 from t1 left outer join t1 on true;
Schema error: Ambiguous reference to unqualified field v1

To Reproduce

No response

Expected behavior

No response

Additional context

found by SQLancer #11030

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions