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: return correct pgerror code for CHECK errors #17630

Merged
merged 1 commit into from Aug 16, 2017
Merged

sql: return correct pgerror code for CHECK errors #17630

merged 1 commit into from Aug 16, 2017

Conversation

xudongzheng
Copy link
Contributor

Same issue as #16836 except for CHECK constraints.

@xudongzheng xudongzheng requested review from a team August 14, 2017 15:31
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

Actually, while this looks perfectly sound, it would be best if you could augment one of the existing tests to ensure that the error code is present. Look in pkg/sql/logictest/testdata/logic_test/check_constraints for the existing logic tests for check constraints. You can augment a logic test with an expected pg error code by adding pgcode XXXX after the statement error - see the fk logic tests for some examples.

@xudongzheng xudongzheng requested a review from a team as a code owner August 16, 2017 11:14
@xudongzheng xudongzheng requested a review from a team August 16, 2017 11:14
@xudongzheng xudongzheng requested a review from a team as a code owner August 16, 2017 11:14
@xudongzheng xudongzheng requested review from a team August 16, 2017 11:14
@xudongzheng
Copy link
Contributor Author

Thank you for your feedback. There were lots of tests with the CHECK constraint statement error and I think I changed most (if not all) of them. Please let me know if there is anything else I should amend.

@jordanlewis jordanlewis merged commit 88e6927 into cockroachdb:master Aug 16, 2017
@jordanlewis
Copy link
Member

Thanks for the contribution @xudongzheng!

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.

None yet

3 participants