-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
expression in prepare and execute
statement.
#17855
Conversation
unix_time
expression in prepare and execute
statement.
@lysu PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current impl is not the same thing as your PR's description.
Why just take the UNIX_TIMESTAMP
into special consideration?
@Reminiscent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@winoros It's my mistake, I have updated the PR description. |
� Conflicts: � expression/integration_test.go
Codecov Report
@@ Coverage Diff @@
## master #17855 +/- ##
===========================================
Coverage 79.4785% 79.4785%
===========================================
Files 524 524
Lines 142168 142168
===========================================
Hits 112993 112993
Misses 20033 20033
Partials 9142 9142 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
/run-all-tests |
@Reminiscent merge failed. |
/merge |
/run-all-tests |
@Reminiscent merge failed. |
/merge |
/run-all-tests |
@Reminiscent merge failed. |
/merge |
/run-all-tests |
Signed-off-by: sre-bot <sre-bot@pingcap.com>
cherry pick to release-4.0 in PR #18002 |
What problem does this PR solve?
Issue Number: close #17727
Problem Summary:
When we set
prepare-plan-cache = true
and useprepare && execute
statement. Some time-related expression such asnow()
will be wrapped intoconstant.deferredExpr
for delayed calculation. But the expressionunix_timestamp
is special. When there is no parameter, it should be placed inconstant.deferredExpr
for delay calculation. If there is a parameter, it should not be put intoconstant.deferredExpr
, otherwise, it will cause access tonil
pointerWhat is changed and how it works?
Special handling of the case of the expression
unix_timestamp
forfuncCallToExpression
.Related changes
Check List
Tests
Release note
unix_time
expression inprepare and execute
statement.