-
Notifications
You must be signed in to change notification settings - Fork 4.1k
schemachanger: ADD COLUMN AS (NULL) virtual not null incorrectly succeeds #87457
Copy link
Copy link
Closed
Closed
Copy link
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.GA-blockerT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)branch-release-22.2Used to mark GA and release blockers, technical advisories, and bugs for 22.2Used to mark GA and release blockers, technical advisories, and bugs for 22.2
Description
In the new schema changer, the following ADD COLUMN incorrectly succeeds:
SET use_declarative_schema_changer = 'unsafe_always';
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;
The expected behavior, as the old schema changer will give us, is
ERROR: validation of NOT NULL constraint failed: validation of CHECK "j IS NOT NULL" failed on row: i=1, j=NULL
SQLSTATE: 23514
Jira issue: CRDB-19354
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.GA-blockerT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)branch-release-22.2Used to mark GA and release blockers, technical advisories, and bugs for 22.2Used to mark GA and release blockers, technical advisories, and bugs for 22.2