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

tables: make duplicate error in update clearer #7495

Merged
merged 7 commits into from
Aug 28, 2018
Merged

tables: make duplicate error in update clearer #7495

merged 7 commits into from
Aug 28, 2018

Conversation

winkyao
Copy link
Contributor

@winkyao winkyao commented Aug 27, 2018

What problem does this PR solve?

Before this pr, we return ERROR 1062 (23000): key already exist when update statement meets duplicate key. In MySQL:

MariaDB [wilan]> create table c(i int,j int,k int,primary key(i,j,k));
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [wilan]> insert into c values(1,2,3);
Query OK, 1 row affected (0.00 sec)
 
MariaDB [wilan]> insert into c values(1,2,4);
Query OK, 1 row affected (0.00 sec)
 
MariaDB [wilan]> update c set i=1,j=2,k=4 where i=1 and j=2 and k=3;
ERROR 1062 (23000): Duplicate entry '1-2-4' for key 'PRIMARY'

ERROR 1062 (23000): Duplicate entry '1-2-4' for key 'PRIMARY' is clearer.

Tests

  • Unit test

@jackysp
Copy link
Member

jackysp commented Aug 27, 2018

Please fix CI @winkyao .

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala
Copy link
Contributor

/run-all-tests

@zimulala zimulala added the status/LGT2 Indicates that a PR has LGTM 2. label Aug 27, 2018
@shenli
Copy link
Member

shenli commented Aug 27, 2018

/run-all-tests

@shenli
Copy link
Member

shenli commented Aug 28, 2018

Please fix the CI.

@winkyao
Copy link
Contributor Author

winkyao commented Aug 28, 2018

/run-common-test -tidb-test=pr/612

@winkyao
Copy link
Contributor Author

winkyao commented Aug 28, 2018

/run-integration-common-test -tidb-test=pr/612

@winkyao winkyao merged commit 1255973 into pingcap:master Aug 28, 2018
@winkyao winkyao deleted the clearer_error branch August 28, 2018 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants