-
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: avoid Order By
constant expression error when plan cache is enabled (#16261)
#16675
expression: avoid Order By
constant expression error when plan cache is enabled (#16261)
#16675
Conversation
/run-all-tests |
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-sqllogic-test-2 |
/run-integration-common-test |
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
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
/run-all-tests |
@sre-bot merge failed. |
cherry-pick #16261 to release-4.0
What problem does this PR solve?
Issue Number: close #16203
Problem Summary:
Error is reported for
order by rand()
when plan cache is enabled.What is changed and how it works?
What's Changed:
remove
Rand
/Sysdate
/UUID
fromDeferredFunctions
, because they should not be folded into constant according tounFoldableFunctions
, otherwise, they would be converted to aConstant
withDeferredExpr
infuncCallToExpression
. This change makes the behavior regarding these functions consistent when plan cache is enabled / disabled.check if the order by items can be treated as constants during execution using a new function, instead of
IsMutableEffectsExpr
, which is specifically designed for de-duplicating expressions.How it Works:
Related previous PRs for this change:
now()
;order by rand()
when plan cache is disabled by usingConstItem()
;order by
clause #11839: second fix fororder by rand()
when plan cache is disabled by usingIsMutableEffectsExpr()
;Related changes
Check List
Tests
Side effects
N/A
Release note