-
Notifications
You must be signed in to change notification settings - Fork 6.1k
parser: add SEM SQL commands for all statements #61402
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
Conversation
|
|
||
| const ( | ||
| // AlterDatabaseCommand represents ALTER DATABASE statement | ||
| AlterDatabaseCommand = "ALTER DATABASE" |
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.
Here are the SQL commands which we can use in the SEM. @songrijie PTAL
4416f66 to
b8992eb
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #61402 +/- ##
================================================
+ Coverage 72.8175% 73.1916% +0.3741%
================================================
Files 1791 1792 +1
Lines 487149 487666 +517
================================================
+ Hits 354730 356931 +2201
+ Misses 110777 109127 -1650
+ Partials 21642 21608 -34
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
b8992eb to
9f59232
Compare
|
/retest |
|
|
||
| // Show Statements | ||
|
|
||
| const ( |
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.
I have some concerns about how can we maintain them...
For example, we support SHOW PROFILE in syntax only(it does nothing), so should we include it in this list?
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.
For example, we support
SHOW PROFILEin syntax only(it does nothing), so should we include it in this list?
I think we should include every syntax supported by the parser. This list is not exposed outside (to the user), so it's fine to have more commands than what TiDB actually supported.
3e051af to
1aeda0e
Compare
bb7133
left a comment
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
[LGTM Timeline notifier]Timeline:
|
fixdb
left a comment
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.
+1
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bb7133, CbcWestwolf, fixdb The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Yang Keao <[email protected]>
1aeda0e to
4ac30d2
Compare
What problem does this PR solve?
Issue Number: close #61397, close #61396
Problem Summary:
CHANGEstatement has been removed. It should be removed everywhere in TiDB.SEMCommandneeded by the SEM feature. The SEM feature will use it to filter out the SQL.For example, the new design of SEM may have the following config to restrict the SQL:
{ "restricted_SQL" : { "SQL": [ "BACKUP", "RESTORE", "ALTER RESOURCE GROUP" ], "rule": [ "select_into_file", "import_from_disk" ], } }This PR implements methods to get "SQL" from a real sql statements. Then we can match them in the sem module.
What changed and how does it work?
SEMCommandmethod toStmtNode, and implement it for allStmtNode.ADMIN,SHOW,BRIEare included.CHANGEstatement.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.