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

Unable to resolve alias in subquery in projection #6174

Closed
fulghum opened this issue Jun 16, 2023 · 1 comment
Closed

Unable to resolve alias in subquery in projection #6174

fulghum opened this issue Jun 16, 2023 · 1 comment
Assignees
Labels
analyzer bug Something isn't working customer issue sql Issue with SQL

Comments

@fulghum
Copy link
Contributor

fulghum commented Jun 16, 2023

A customer getting their schema to run on Dolt has a select statement that MySQL can process, but Dolt cannot. It simplifies this this (MySQL repro):

mysql> select if (1 is not null, 1, 0) as foo, if ((select foo), 1, 0) as foo2;
+-----+------+
| foo | foo2 |
+-----+------+
|   1 |    1 |
+-----+------+

On Dolt, it errors:

dolt> select if (1 is not null, 1, 0) as foo, if ((select foo), 1, 0) as foo2;
column "foo" could not be found in any table in scope```
@jycor
Copy link
Contributor

jycor commented Jun 21, 2023

Fix is in GMS main, and will make it to dolt main eventually.

@jycor jycor closed this as completed Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer bug Something isn't working customer issue sql Issue with SQL
Projects
None yet
Development

No branches or pull requests

2 participants