Skip to content

ALTER TABLE ADD COLUMN should default to NULL (instead of NOT NULL)

Currently, the following sequence results in an error:

create table foo(id int primary key);
insert into foo values (1);
alter table foo add column val int;
ddl operation was aborted: [instance name:default_1_1] FieldMissing: box error: FieldMissing: Tuple field 3 (val) required by space format is missing

This is due to alter table foo add column val int; being interpreted as alter table foo add column val int NOT NULL;. However, this is different from postgres or mysql and works worse with concurrent DML.

We should reverse the default to NULL instead.

Edited by Dmitry Ivanov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information