Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

an outer reference in a subquery doesn't have more scope that if it was at the place of the subquery. #31770

Closed
ChenPeng2013 opened this issue Jan 18, 2022 · 0 comments · Fixed by #33311
Assignees
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
drop table if exists t;
create table t(a int, b int);
insert into t values(1,10),(2,20);
select t1.* from t t0 cross join (t t1 join t t2 on 100=t0.a);

2. What did you expect to see? (Required)

MySQL [test]> select t1.* from t t0 cross join (t t1 join t t2 on 100=t0.a);
ERROR 1054 (42S22): Unknown column 't0.a' in 'on clause'

3. What did you see instead (Required)

MySQL [test]> select t1.* from t t0 cross join (t t1 join t t2 on 100=t0.a);
Empty set (0.00 sec)

4. What is your TiDB version? (Required)

Release Version: v5.4.0-alpha-636-g3a44f6d
Edition: Community
Git Commit Hash: 3a44f6da1c18c55586a1f8453af85452266d7714
Git Branch: release-5.4
UTC Build Time: 2022-01-18 01:01:40
GoVersion: go1.17.6
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants