-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sql-statements: use EBNF to render syntax diagrams - second batch (#5376) #5406
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@CharLotteiu you're already a collaborator in bot's repo. |
DatabaseSym ::= | ||
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.
These lines are newly added. Please take a look~ @kennytm
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.
it should be DatabaseSym ::= 'DATABASE' | 'SCHEMA'
, e.g. CREATE SCHEMA ...
is a valid CreateDatabaseStmt.
CreateIndexStmtUnique ::= | ||
UNIQUE? |
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.
Same as the previous 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.
i guess this should be inlined into IndexType
. BTW 'UNIQUE'
not UNIQUE
.
IndexColNameList ::= | ||
IndexColName (',' IndexColName)* |
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.
Same as the previous 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.
superseded by IndexPartSpecificationList
.
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.
Is it alright to use IndexPartSpecificationList
in docs for release 2.1?
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.
if CREATE INDEX i ON t (col(123));
works on 2.1 then it should be IndexPartSpecificationList.
if not the IndexPartSpecificationList
in CreateIndexStmt
should be replaced by IndexColNameList
.
TableOptionListOpt ::= | ||
'' | TableOption* ( ',' TableOption* )* |
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.
@kennytm Please take a look at these lines as well. Thanks!
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.
lolwut 🤣
TableOptionListOpt ::= | |
'' | TableOption* ( ',' TableOption* )* | |
TableOptionListOpt ::= | |
(TableOption (','? TableOption)*)? |
also CreateTableOptionListOpt
is equivalent to TableOptionListOpt
.
@CharLotteiu, @kennytm, @TomShawn, PTAL. |
1 similar comment
@CharLotteiu, @kennytm, @TomShawn, PTAL. |
Closed as we decided not to maintain the EBNF code of synopsis on the release-2.1 branch. |
cherry-pick #5376 to release-2.1
You can switch your code base to this Pull Request by using git-extras:
# In docs-cn repo: git pr https://github.com/pingcap/docs-cn/pull/5406
After apply modifications, you can push your change to this PR via:
What is changed, added or deleted? (Required)
This PR changes the synopsis sections of BEGIN, CHANGE, COMMIT, CREATE, DEALLOCATE, DELETE, DO, and DROP statements to use the
```ebnf+diagrm
block, replacing the original image-based sqlgrams. It is a follow-up PR to pingcap/docs#4389.To avoid making one single PR too large, I will open 4-5 follow-up PRs to process sql-statements files in batches. And I will delete all image files in the last PR in case of any display issues.
Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?