-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: nullability not respected for virtual computed columns #81675
Copy link
Copy link
Closed
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Description
CREATE TABLE t (i INT PRIMARY KEY);
INSERT INTO t VALUES (1);
ALTER TABLE t ADD COLUMN j INT AS (NULL::INT) VIRTUAL NOT NULL;SELECT j FROM t;
j
--------
NULLExpected behavior
I think we should probably validate the column when adding it and then evaluate the expression and enforce the constraint when inserting and updating rows.
Jira issue: CRDB-16023
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)