-
Notifications
You must be signed in to change notification settings - Fork 26
add support for parsing CREATE TABLE #486
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* origin/main: (66 commits) fix spelling continue for watermark not ready cases. remove unneeded files Improve table notified panic handling, and can't write checkpoint handling fix other test Return error when using non alter statements in mutli change Fix flush correctness issue fix: minor typo fix race fix NULL returning skip new test fix races Add boundary checking, improve buffered copier Add tests fix comments - removing force-inplace add drop index to safe operations category - removing force-inplace reword usage docs - removing force-inplace Update pkg/migration/runner_test.go remove force-inplace - since we don't want to be in the business of doing things that are not safe Add support for resume from checksum in multi chunker ...
morgo
approved these changes
Oct 15, 2025
Collaborator
morgo
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
Kiran01bm
reviewed
Oct 15, 2025
Kiran01bm
reviewed
Oct 15, 2025
Kiran01bm
approved these changes
Oct 15, 2025
Merged
kolbe
added a commit
that referenced
this pull request
Oct 17, 2025
* origin/main: add support for parsing CREATE TABLE (#486) remove checksum option
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the first step toward implementing #446
This PR adds support for parsing CREATE TABLE statements using the TiDB parser. This support is primarily targeted toward parsing "canonical" CREATE TABLE statements, the ones returned by
SHOW CREATE TABLE. The new support is not currently used, but will form the basis for future work that implements native linting.It should be possible to parse any legal MySQL CREATE TABLE statement using this functionality, but it's also possible to parse many invalid statements (multiple primary keys, non-unique column names, indexes on columns that don't exist, etc.).
Many column/index/constraint attributes are expressed as pointers, following the general pattern in go structs when it should be possible to determine whether a field has any value set rather than just some default value.
This library provides convenient access to most aspects of a table, as well as access to the "raw" AST that comes back from the TiDB parser for more in-depth analysis depending on the situation.