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/schemachanger: Ensure column alterations check for dropped status #135840

Closed spilchen closed 8 hours ago

spilchen commented 1 day ago

In the Declarative Schema Changer (DSC), three operations—ALTER COLUMN TYPE, SET NULLABILITY, and SET DEFAULT—did not verify whether a column had already been marked for drop. This could lead to issues if a DROP COLUMN and one of these operations were executed within the same transaction.

This update ensures that when these operations look up a column element, they also check its target status to confirm it has not been dropped.

Epic: CRDB-25314 Closes: #134008 Release note: None

cockroach-teamcity commented 1 day ago

This change is Reviewable

spilchen commented 9 hours ago

TFTR!

bors r+

craig[bot] commented 8 hours ago

Build succeeded: