-
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
parser: fix function as identifier in TiDB is not compatible with Mysql #31803
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/36f602e69b496c3ffe9aa7f3ef12d4ed916f60a5 |
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
PTAL @morgo |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: b0a4be4
|
What problem does this PR solve?
Issue Number: close #30556
Problem Summary:
Although MySQL declares in https://dev.mysql.com/doc/refman/8.0/en/function-resolution.html that the functions are recognized as functions for
create table x()
, 4 of them are still recognized as functions:ADDDATE
andSUBDATE
SESSION_USER
andSYSTEM_USER
Which makes TiDB incompatible with MySQL.
For the case of
select x ()
, it's complicated: TiDB won't report errors for some of them but MySQL does. This incompatibility won't bring any problems. Instead, if we change it, it will break compatibility.What is changed and how it works?
btFuncTokenMap
builtinAddDate
andbuiltinSubDate
Check List
Tests
Side effects
Documentation
Release note