cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.16k stars 3.82k forks source link

sql: validate sequence references for identity columns #135955

Open fqazi opened 10 hours ago

fqazi commented 10 hours ago

Previously, when creating a table it was possible for identity columns to be missing sequence forward references. This would happen when a CREATE TABLE was used to create the identity columns. To address this, this patch adds validation to confirm that identity columns have sequence references. Additionally, an automated repair via post de-serialization is added to fix missing forward references.

Fixes: #131280

Release note: None

cockroach-teamcity commented 10 hours ago

This change is Reviewable