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

Multi-part ALTER TABLE statements can't reference columns added in the same statement. #8293

Open
nicktobey opened this issue Aug 23, 2024 · 0 comments
Labels
correctness We don't return the same result as MySQL enhancement New feature or request sql Issue with SQL

Comments

@nicktobey
Copy link
Contributor

This works in MySQL (and in the GMS in-memory DB):

create table t1(pk int primary key);
alter table t1 add column b int, add column c int as (b+1);

But trying it in Dolt results in an error:

column "b" could not be found in any table in scope

Most likely this happens because we attempt to resolve all parts of the statement before any of the new columns are added.

@timsehn timsehn added enhancement New feature or request sql Issue with SQL correctness We don't return the same result as MySQL labels Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
correctness We don't return the same result as MySQL enhancement New feature or request sql Issue with SQL
Projects
None yet
Development

No branches or pull requests

2 participants