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

sql: fix assertion failure for CREATE TABLE with duplicate index names #58433

Merged
merged 1 commit into from
Jan 5, 2021

Conversation

postamar
Copy link
Contributor

@postamar postamar commented Jan 4, 2021

Previously, since version 20.2, executing a statement such as

CREATE TABLE t (a INT, b INT, INDEX idx (a), INDEX idx (b))

yields an assertion failure during the validation of the table descriptor.
This is a regression from version 20.1 which yields a proper error:

ERROR: duplicate index name: "idx"

This patch fixes this regression and restores the original behaviour.

Fixes #57630.

Release note (bug fix): A CREATE TABLE statement with indexes with
duplicate names will no longer result in an assertion failure. This bug
was present since version 20.2.

Previously, since version 20.2, executing a statement such as
```
CREATE TABLE t (a INT, b INT, INDEX idx (a), INDEX idx (b))
```
yields an assertion failure during the validation of the table descriptor.
This is a regression from version 20.1 which yields a proper error:
```
ERROR: duplicate index name: "idx"
```
This patch fixes this regression and restores the original behaviour.

Fixes cockroachdb#57630.

Release note (bug fix): A CREATE TABLE statement with indexes with
duplicate names will no longer result in an assertion failure. This bug
was present since version 20.2.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@postamar postamar requested a review from a team January 4, 2021 21:36
Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 3 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@postamar
Copy link
Contributor Author

postamar commented Jan 5, 2021

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 5, 2021

Build succeeded:

@craig craig bot merged commit d887df7 into cockroachdb:master Jan 5, 2021
@postamar postamar deleted the 57630 branch January 5, 2021 14:51
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.

sql: v20.2.0: assertion failed: duplicate index name
3 participants