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: improve error message while adding column with REFERENCE #35697

Merged
merged 1 commit into from
Mar 13, 2019

Conversation

vivekmenezes
Copy link
Contributor

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

@vivekmenezes vivekmenezes requested review from thoszhang and a team March 13, 2019 17:37
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@thoszhang thoszhang left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: 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?

Copy link
Contributor Author

@vivekmenezes vivekmenezes left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: 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.

Copy link
Contributor Author

@vivekmenezes vivekmenezes left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: 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.

Copy link
Contributor

@thoszhang thoszhang left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: 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).

@vivekmenezes
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 13, 2019

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
@vivekmenezes
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Mar 13, 2019
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]>
@craig
Copy link
Contributor

craig bot commented Mar 13, 2019

Build succeeded

@craig craig bot merged commit 639e713 into cockroachdb:master Mar 13, 2019
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