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

expression: deep copy the string when assigning it to a user variable #11041

Merged
merged 2 commits into from Jul 3, 2019

Conversation

@zz-jason
Copy link
Member

commented Jul 2, 2019

Signed-off-by: Zhang Jian zjsariel@gmail.com

What problem does this PR solve?

At present, the builtin SetVar function might refer to the content of an underlying Chunk. The problem is, when the content of that Chunk is changed, the value of the corresponding user variable is changed as well.

What is changed and how it works?

To address this issue, we should make a deep copy of that string value before assigning it to a user variable.

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch
  • Need to be included in the release note
expression: deep copy the string when setting user variable from Chunk
Signed-off-by: Zhang Jian <zjsariel@gmail.com>

@zz-jason zz-jason changed the title expression: deep copy the string when setting user variable from Chunk expression: deep copy the string when assigning it to a user variable Jul 2, 2019

@zz-jason

This comment has been minimized.

Copy link
Member Author

commented Jul 2, 2019

/run-all-tests

@zz-jason zz-jason requested review from XuHuaiyu and qw4990 Jul 2, 2019

@codecov

This comment has been minimized.

Copy link

commented Jul 2, 2019

Codecov Report

Merging #11041 into master will decrease coverage by 0.0217%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #11041        +/-   ##
================================================
- Coverage   80.9612%   80.9394%   -0.0218%     
================================================
  Files           419        419                
  Lines         89302      89305         +3     
================================================
- Hits          72300      72283        -17     
- Misses        11769      11784        +15     
- Partials       5233       5238         +5
@XuHuaiyu
Copy link
Contributor

left a comment

LGTM

@qw4990

qw4990 approved these changes Jul 3, 2019

Copy link
Contributor

left a comment

LGTM

@qw4990 qw4990 merged commit e217962 into pingcap:master Jul 3, 2019

6 checks passed

ci/circleci Your tests passed on CircleCI!
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/build_check_race Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev_2 Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@zz-jason zz-jason deleted the zz-jason:bugfix/deepcopy-for-setvar branch Jul 3, 2019

zz-jason added a commit to zz-jason/tidb that referenced this pull request Jul 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.