dolt icon indicating copy to clipboard operation
dolt copied to clipboard

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

Open nicktobey opened this issue 1 year ago • 0 comments

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.

nicktobey avatar Aug 23 '24 23:08 nicktobey