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

Revert "expression: fix a bug that DML using caseWhen may cause schema change" #21243

Closed
wants to merge 1 commit into from

Conversation

wjhuang2016
Copy link
Member

@wjhuang2016 wjhuang2016 commented Nov 24, 2020

Reverts #19857

Signed-off-by: wjhuang2016 huangwenjun1997@gmail.com

What problem does this PR solve?

Issue Number: close #19387

Problem Summary:

  1. BuildCastFunction(expr.GetCtx(), foldedExpr, foldedExpr.GetType()) in constant_fold.go in wrong and needless.
    foldedExpr.GetType() should be expr.GetType().
  2. In WrapCastForAggArgs, we change the pointer to fieldType. It's very dangerous.

What is changed and how it works?

  1. Remove BuildCastFunction(expr.GetCtx(), foldedExpr, foldedExpr.GetType()).
  2. Use a safe way to change FieldType.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

Release note

  • No release note

@wjhuang2016 wjhuang2016 requested a review from a team as a code owner November 24, 2020 06:39
@wjhuang2016 wjhuang2016 requested review from XuHuaiyu and removed request for a team November 24, 2020 06:39
@sre-bot
Copy link
Contributor

sre-bot commented Nov 24, 2020

@XuHuaiyu
Copy link
Contributor

/run-all-test

@wjhuang2016
Copy link
Member Author

/run-all-tests

@XuHuaiyu
Copy link
Contributor

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 24, 2020
@ti-challenge-bot
Copy link

There is no reward for this challenge pull request, so you can request a reward from @SunRunAway.

Details

Tip : About reward you can refs to reward-command.

Warning: None

@wjhuang2016
Copy link
Member Author

/run-check_dev_2

@zhouqiang-cl zhouqiang-cl deleted the revert-19857-fix_19387 branch December 24, 2020 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

select sum(case when 1 then a end) from t group by a causes schema change
4 participants