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

Unexpected syntax error: Unknown column 'ref_0.c1' in 'where clause' #57594

Open
r33s3n6 opened this issue Nov 21, 2024 · 0 comments
Open

Unexpected syntax error: Unknown column 'ref_0.c1' in 'where clause' #57594

r33s3n6 opened this issue Nov 21, 2024 · 0 comments
Labels
sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@r33s3n6
Copy link

r33s3n6 commented Nov 21, 2024

Bug Report

1. Minimal reproduce step (Required)

create table t1 (c1 text);

-- good
select case when (EXISTS (select 1)) 
      then count(*) over (partition by 1) else 1 end from t1 as ref_0;
-- good
select case when (EXISTS (select 1 where ref_0.c1)) 
      then 1 else 1 end from t1 as ref_0;
-- bad
select case when (EXISTS (select 1 where ref_0.c1)) 
      then count(*) over (partition by 1) else 1 end from t1 as ref_0;

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

empty set.

3. What did you see instead (Required)

ERROR 1054 (42S22): Unknown column 'ref_0.c1' in 'where clause'

4. What is your TiDB version? (Required)

Release Version: v8.5.0-alpha-184-g1c059a1216
Edition: Community
Git Commit Hash: 1c059a1216db711e2cb56ea9f3d1ad8c23db6327
Git Branch: HEAD
UTC Build Time: 2024-11-21 04:56:22
GoVersion: go1.23.3
Race Enabled: false
Check Table Before Drop: false
Store: tikv
@r33s3n6 r33s3n6 added the type/bug The issue is confirmed as a bug. label Nov 21, 2024
@jebter jebter added the sig/sql-infra SIG: SQL Infra label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants