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 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

This comment has been minimized.

Copy link
Member

shenli commented Sep 14, 2018

Could you please paste the original PR link here?

@coocood

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

coocood commented Sep 14, 2018

LGTM

@jackysp

This comment has been minimized.

Copy link
Member Author

jackysp commented Sep 14, 2018

Done, @shenli .

@zhexuany

This comment has been minimized.

Copy link
Member

zhexuany commented Sep 14, 2018

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

Copy link
Member

zhexuany left a comment

ci is failing. Please fix it.

@coocood

This comment has been minimized.

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 merged commit 3e9f830 into pingcap:release-2.0 Sep 20, 2018
11 checks passed
11 checks passed
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
jenkins-ci-tidb/common-test Jenkins job succeeded.
Details
jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
jenkins-ci-tidb/integration-compatibility-test Jenkins job succeeded.
Details
jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
jenkins-ci-tidb/mybatis-test Jenkins job succeeded.
Details
jenkins-ci-tidb/sqllogic-test Jenkins job succeeded.
Details
jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
@jackysp jackysp deleted the jackysp:fix_insert_bug branch Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.