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: fix the panic when we use unix_time ... (#17855) #18002

Merged
merged 6 commits into from
Jun 19, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Jun 15, 2020

cherry-pick #17855 to release-4.0


What problem does this PR solve?

Issue Number: close #17727

Problem Summary:
When we set prepare-plan-cache = true and use prepare && execute statement. Some time-related expression such as now() will be wrapped into constant.deferredExpr for delayed calculation. But the expression unix_timestamp is special. When there is no parameter, it should be placed in constant.deferredExpr for delay calculation. If there is a parameter, it should not be put into constant.deferredExpr, otherwise, it will cause access to nil pointer

What is changed and how it works?

Special handling of the case of the expression unix_timestamp for funcCallToExpression.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test

Release note

  • [Bug-fix] Fix the panic when we use unix_time expression in prepare and execute statement.

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 15, 2020

/run-all-tests

@Reminiscent
Copy link
Contributor

@zz-jason @winoros PTAL

@Reminiscent
Copy link
Contributor

@zz-jason @winoros PTAL

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 19, 2020
@Reminiscent
Copy link
Contributor

/run-all-tests

@Reminiscent
Copy link
Contributor

/run-all-tests

1 similar comment
@Reminiscent
Copy link
Contributor

/run-all-tests

@Reminiscent
Copy link
Contributor

/run-check_dev

@zz-jason zz-jason added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Jun 19, 2020
@Reminiscent
Copy link
Contributor

/run-integration-br-test

@zz-jason zz-jason added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 19, 2020
@zz-jason zz-jason changed the title expression: fix the panic when we use unix_time expression in prepare and execute statement. (#17855) expression: fix the panic when we use unix_time ... (#17855) Jun 19, 2020
@zz-jason zz-jason merged commit 2b6b92a into pingcap:release-4.0 Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression priority/release-blocker This issue blocks a release. Please solve it ASAP. sig/planner SIG: Planner status/LGT2 Indicates that a PR has LGTM 2. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants