Skip to content

sql: add spaces to delimiter in uniqueness violation error#96914

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
michae2:spaces
Feb 22, 2023
Merged

sql: add spaces to delimiter in uniqueness violation error#96914
craig[bot] merged 1 commit intocockroachdb:masterfrom
michae2:spaces

Conversation

@michae2
Copy link
Copy Markdown
Collaborator

@michae2 michae2 commented Feb 10, 2023

Whenever a mutation statement violates a uniqueness constraint we return a specific error which shows the affected row. This error is formatted to match the corresponding error in Postgres.

We create this error in two places. In one place (pkg/sql/opt/exec/execbuilder/mutation.go) we were using ", " as the delimter between values, which matches Postgres. But in the other place (pkg/sql/row/errors.go) we were using "," (without a space).

This patch adds the space.

Epic: None

Release note (bug fix): Fix formatting of uniqueness violation errors to match the corresponding errors from PostgreSQL.

@blathers-crl

This comment was marked as outdated.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Whenever a mutation statement violates a uniqueness constraint we return
a specific error which shows the affected row. This error is formatted
to match the corresponding error in Postgres.

We create this error in two places. In one place
(`pkg/sql/opt/exec/execbuilder/mutation.go`) we were using ", " as the
delimter between values, which matches Postgres. But in the other place
(`pkg/sql/row/errors.go`) we were using "," (without a space).

This patch adds the space.

Epic: None

Release note (bug fix): Fix formatting of uniqueness violation errors to
match the corresponding errors from PostgreSQL.
@michae2 michae2 marked this pull request as ready for review February 18, 2023 15:40
@michae2 michae2 requested a review from a team as a code owner February 18, 2023 15:40
@michae2 michae2 requested a review from rharding6373 February 18, 2023 15:40
Copy link
Copy Markdown
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@michae2
Copy link
Copy Markdown
Collaborator Author

michae2 commented Feb 22, 2023

Thanks!

bors r=rharding6373

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 22, 2023

Build succeeded:

@craig craig bot merged commit b3231c0 into cockroachdb:master Feb 22, 2023
@michae2 michae2 deleted the spaces branch February 23, 2023 04:34
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