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: ensure SQLSTATE 42710 on secondary errors #51406

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

knz
Copy link
Contributor

@knz knz commented Jul 14, 2020

Amends #51260

When creating an object that collides with another, we have to perform
another lookup to get the kind of object that it collided with.

If an error occurs during this second stage, we want the error to
propose SQLSTATE "Duplicate object" (42710) to the client if there is
no pgcode in the error object already.

Release note: None

When creating an object that collides with another, we have to perform
another lookup to get the kind of object that it collided with.

If an error occurs during this second stage, we want the error to
propose SQLSTATE "Duplicate object" (42710) to the client if there is
no pgcode in the error object already.

Release note: None
@knz knz requested review from otan and rohany July 14, 2020 09:02
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz
Copy link
Contributor Author

knz commented Jul 14, 2020

@rohany maybe add to your checklist for SQL error handling to verify pg codes are added where relevant?

@rohany
Copy link
Contributor

rohany commented Jul 14, 2020

Good catch. Sorry, I wasn't aware that there was an equivalent wrap function for pgerrors

LGTM

@knz
Copy link
Contributor Author

knz commented Jul 15, 2020

bors r=rohany

@craig
Copy link
Contributor

craig bot commented Jul 15, 2020

Build succeeded

@craig craig bot merged commit 8c01a02 into cockroachdb:master Jul 15, 2020
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