Skip to content

A join SQL query with ambiguous table reference executes without error (SQLancer-NoREC) #12337

@2010YOUY01

Description

@2010YOUY01

Describe the bug

The t1.v1 inside query's on clause is ambiguous, it's not clear which t1 it's referring to, such query should be rejected by the planner

See reproducer in datafusion-cli (Compilred from latest main with cargo run, commit hash d6f3f73)

DataFusion CLI v41.0.0
> create table t1(v1 int);

0 row(s) fetched.
Elapsed 0.070 seconds.

> select count(*)
from t1
right outer join t1
on t1.v1 > 0;
+----------+
| count(*) |
+----------+
| 0        |
+----------+
1 row(s) fetched.
Elapsed 0.075 seconds.

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