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

Include table name in the error message of 1062: duplicate entry #38242

Closed
ekexium opened this issue Sep 29, 2022 · 0 comments · Fixed by #38243
Closed

Include table name in the error message of 1062: duplicate entry #38242

ekexium opened this issue Sep 29, 2022 · 0 comments · Fixed by #38243
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@ekexium
Copy link
Contributor

ekexium commented Sep 29, 2022

Enhancement

Currently the error message looks like

[kv:1062]Duplicate entry '1' for key 'PRIMARY'

It can be hard to tell the exact column in the error message if multiple table has columns with same names, especially when @@tidb_constraint_check_in_place_pessimistic = off.

We can print the table name with the column name to make it clearer, like

[kv:1062]Duplicate entry '1' for key 't.PRIMARY'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant