-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: improve error message while adding column with REFERENCE #35697
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @lucy-zhang and @vivekmenezes)
pkg/sql/alter_table.go, line 231 at r1 (raw file):
if _, dropped, inactiveErr := n.tableDesc.FindColumnByName(colName); inactiveErr == nil && !dropped { return pgerror.UnimplementedWithIssueError(32917, "adding a REFERENCES constraint while adding the column in the same transaction not supported")
Is it also possible to get this error when we attempt to add the constraint in a different transaction and see the column in the mutations list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @lucy-zhang)
pkg/sql/alter_table.go, line 231 at r1 (raw file):
Previously, lucy-zhang (Lucy Zhang) wrote…
Is it also possible to get this error when we attempt to add the constraint in a different transaction and see the column in the mutations list?
yes! I should change this error to column still in the process of being backfilled.
02e061b
to
6852f10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @lucy-zhang)
pkg/sql/alter_table.go, line 231 at r1 (raw file):
Previously, vivekmenezes wrote…
yes! I should change this error to column still in the process of being backfilled.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @vivekmenezes)
pkg/sql/alter_table.go, line 231 at r1 (raw file):
Previously, vivekmenezes wrote…
Done.
We might want to say while the column is being added
to match the other errors (and also because the backfill might not have started).
6852f10
to
e8e59f7
Compare
bors r+ |
Build failed |
This will eventually be fixed through cockroachdb#32917 Also added a unittest to check that this fails specifically for a column needing a backfill. Release note: None
e8e59f7
to
639e713
Compare
bors r+ |
35697: sql: improve error message while adding column with REFERENCE r=vivekmenezes a=vivekmenezes This will eventually be fixed through #32917 Also added a unittest to check that this fails specifically for a column needing a backfill. Release note: None Co-authored-by: Vivek Menezes <[email protected]>
Build succeeded |
This will eventually be fixed through #32917
Also added a unittest to check that this fails specifically for
a column needing a backfill.
Release note: None