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

executor: fix lost insert row when insert multi rows on duplicate key update #7685

Merged
merged 2 commits into from
Sep 20, 2018

Conversation

jackysp
Copy link
Member

@jackysp jackysp commented Sep 13, 2018

What problem does this PR solve?

Fix the same bug on release-2.0 as #7675.
When the table has two or more unique index and its primary key is int type, the statement with three rows, the second and third rows conflict with the first one but with different indices. The second row will update the first row, but it deletes the dupKV map with itself by mistake. It will cause a fake update instead of insert without conflicts. See the test case in this PR as an example.

What is changed and how it works?

Delete the correct keys in dupKV map.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • Increased code complexity

PTAL @coocood

@shenli
Copy link
Member

shenli commented Sep 14, 2018

Could you please paste the original PR link here?

@coocood
Copy link
Member

coocood commented Sep 14, 2018

/run-all-tests tidb-test=release-2.0 tikv=release-2.0 pd=release-2.0

@coocood
Copy link
Member

coocood commented Sep 14, 2018

LGTM

@jackysp
Copy link
Member Author

jackysp commented Sep 14, 2018

Done, @shenli .

@zhexuany
Copy link
Contributor

/run-all-tests tidb-test=release-2.0 tikv=release-2.0 pd=release-2.0

Copy link
Contributor

@zhexuany zhexuany left a comment

Choose a reason for hiding this comment

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

ci is failing. Please fix it.

@coocood
Copy link
Member

coocood commented Sep 20, 2018

/run-all-tests tidb-test=release-2.0 tikv=release-2.0 pd=release-2.0

@coocood coocood added status/LGT2 Indicates that a PR has LGTM 2. status/all tests passed labels Sep 20, 2018
@coocood coocood merged commit 3e9f830 into pingcap:release-2.0 Sep 20, 2018
@jackysp jackysp deleted the fix_insert_bug branch October 8, 2018 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants