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

server: reset bound arguments when it is executed by execute command #8645

Merged
merged 2 commits into from
Dec 11, 2018

Conversation

jackysp
Copy link
Member

@jackysp jackysp commented Dec 11, 2018

What problem does this PR solve?

comStmtSendLongData will always append values no matter the arguments are used or not. It will cause

insert into t values ("a");
insert into t values ("b");

the second statement will insert "ab" not "b" if the client use comStmtSendLongData.

What is changed and how it works?

Reset the bound arguments when executing.

Check List

Tests

Code changes

  • Has exported function/method change

Related changes

  • Need to cherry-pick to the release branch

PTAL @lysu


This change is Reviewable

@jackysp jackysp added type/bugfix This PR fixes a bug. component/server labels Dec 11, 2018
@jackysp
Copy link
Member Author

jackysp commented Dec 11, 2018

/run-all-tests tidb-test=pr/689

2 similar comments
@jackysp
Copy link
Member Author

jackysp commented Dec 11, 2018

/run-all-tests tidb-test=pr/689

@zhouqiang-cl
Copy link
Contributor

/run-all-tests tidb-test=pr/689

@zhouqiang-cl
Copy link
Contributor

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

@zhouqiang-cl
Copy link
Contributor

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

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.

Could we add a test in the package of server?

@jackysp
Copy link
Member Author

jackysp commented Dec 11, 2018

Hard to do, @zimulala . go-sql-driver doesn't use comStmtSendLongData.

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 zimulala added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 11, 2018
Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

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

LGTM

@lysu lysu added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 11, 2018
@jackysp jackysp merged commit e2b3912 into pingcap:master Dec 11, 2018
@jackysp
Copy link
Member Author

jackysp commented Dec 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/server status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants