cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

sql/catalog/tabledesc: fixed a bug in `maybeAddConstraintIDs`

Open Xiang-Gu opened this issue 3 years ago • 5 comments

Previously, when we RunPostDeserializationChanges, one of the step is to fill in constraint IDs if they are not already set, which is done in function maybeAddConstraintIDs. That function however is buggy in that, if there is constraint mutation on the table descriptor, we directly go assign a constraint ID (from tbl.nextConstraintID) to it, without checking whether it already has a non-zero constraint ID or not. This PR fixes that.

Release note: None

Xiang-Gu avatar Aug 08 '22 22:08 Xiang-Gu

This change is Reviewable

cockroach-teamcity avatar Aug 08 '22 22:08 cockroach-teamcity

TFTR!

bors r+

Xiang-Gu avatar Aug 10 '22 21:08 Xiang-Gu

Build failed (retrying...):

craig[bot] avatar Aug 10 '22 23:08 craig[bot]

Build failed (retrying...):

craig[bot] avatar Aug 11 '22 01:08 craig[bot]

Build failed:

craig[bot] avatar Aug 11 '22 09:08 craig[bot]

The merge failed due to a flaky test, retrying

bors r+

Xiang-Gu avatar Aug 11 '22 14:08 Xiang-Gu

Build failed (retrying...):

craig[bot] avatar Aug 11 '22 16:08 craig[bot]

Build failed:

craig[bot] avatar Aug 11 '22 17:08 craig[bot]

It's sad to see merge failure again but it seems unrelated to this change, retrying again, bors r+

Xiang-Gu avatar Aug 11 '22 17:08 Xiang-Gu

Build succeeded:

craig[bot] avatar Aug 11 '22 19:08 craig[bot]