-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql/schemachanger: column prematurely turns to PUBLIC in ADD COLUMN ... UNIQUE #82953
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
Describe the problem
CREATE TABLE t (i INT PRIMARY KEY);
EXPLAIN (ddl, viz) ALTER TABLE t ADD COLUMN j INT NOT NULL UNIQUE DEFAULT 34;
generates a graph like this one.
This graph is incorrect in that, during Post-Commit phase stage 7 of 13, the newly added column element transition into PUBLIC when the new primary index is ready and we swap it with the old primary index. However, the added unique index (created as a result of adding a unique column) is still in the BACKFILL_ONLY status before/after this stage.
The correct behavior should be that the primary index swap waits until the unique secondary index is also in the VALIDATED status, and then we do the primary index swap as well as making the unique secondary index PUBLIC in one stage.
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