-
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
planner: reimplement DEFAULT function to make the behavior consistent with MySQL when looking up the corresponding column #19709
Conversation
… with MySQL when looking up the corresponding column
/label component/planner |
These labels are not found |
/label sig/planner |
/run-all-tests |
/run-all-tests parser=pr/1007 |
/run-all-tests parser=pr/1007 |
/run-unit-test parser=pr/1007 |
1 similar comment
/run-unit-test parser=pr/1007 |
Please fix conflicts @rebelice . |
/run-all-tests |
/run-all-tests |
/run-sqllogic-test-2 |
/run-common-test |
/merge |
/run-all-tests |
/run-check_dev |
/label needs-cherry-pick-4.0 |
/run-cherry-picker |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #21316 |
What problem does this PR solve?
Issue Number: close #17807
Problem Summary:
The previous Default function parsed to generate ast.ColumnName, and then further parsed the corresponding column. But in fact, the Default function does not need to obtain the value of the corresponding column from the storage, so it should not be further parsed by ast.ColumnName.
The previous implementation produced many incompatibility issues with MySQL, such as:
select b from t order by default(a)
will return Unknown columna
, even ift
has columna
.Have to merge pingcap/parser#1027 first.
What is changed and how it works?
Proposal: xxx
What's Changed:
allNames
forPlanBuilder
andexpressionRewriter
to record the set of columns that can be used to find inevalDefaultExpr
.evalDefaultExpr
. And frist, it will look forallNames
. If it is not found, it will search inexpressionRewrite.names
.Check List
Tests
Side effects
Release note