Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport 2.0: sql: Fix panic adding unique, non-indexable column #26728

Merged
merged 1 commit into from
Jun 14, 2018
Merged

backport 2.0: sql: Fix panic adding unique, non-indexable column #26728

merged 1 commit into from
Jun 14, 2018

Conversation

bobvawter
Copy link
Contributor

This change updates the checkColumnsFor...Index functions to use
allNonDropColumns() to validate against any proposed mutations. Otherwise, a
ColumnMutation that adds a non-indexable column followed by an
IndexMutation creating an index on that column would would be incorrectly
accepted, leading to a panic.

Fixes #26483

Release note (sql change): Return an error to the user instead of panicing when
trying to add a column with a unique constraint when that column's type is not
indexable.

This change updates the `checkColumnsFor...Index` functions to use
`allNonDropColumns()` to validate against any proposed mutations.  Otherwise, a
`ColumnMutation` that adds a non-indexable column followed by an
`IndexMutation` creating an index on that column would would be incorrectly
accepted, leading to a panic.

Fixes #26483

Release note (sql change): Return an error to the user instead of panicing when
trying to add a column with a unique constraint when that column's type is not
indexable.
@bobvawter bobvawter requested review from maddyblue, knz and a team June 14, 2018 16:21
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@bobvawter
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Jun 14, 2018
26728: backport 2.0: sql: Fix panic adding unique, non-indexable column r=bobvawter a=bobvawter

This change updates the `checkColumnsFor...Index` functions to use
`allNonDropColumns()` to validate against any proposed mutations.  Otherwise, a
`ColumnMutation` that adds a non-indexable column followed by an
`IndexMutation` creating an index on that column would would be incorrectly
accepted, leading to a panic.

Fixes #26483

Release note (sql change): Return an error to the user instead of panicing when
trying to add a column with a unique constraint when that column's type is not
indexable.

Co-authored-by: Bob Vawter <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jun 14, 2018

Build succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants