forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a significant, but not complete expansion of the ALTER support in sqlparser. It adds support for these ALTER commands: * `ADD COLUMN` * `DROP COLUMN` * `ADD INDEX` * `DROP INDEX` * `DROP FOREIGN KEY` * `DROP PRIMARY KEY` * `ADD PARTITION` * `DROP PARTITION` * `ADD CHECK` (as a no-op; it's parsed but never executed by mysql servers) The main addition with this API is an additional field on `DDL` that is a slice of newly created `AlterSpecs`. An `AlterSpec` represents one of the commands that can occur in the same `ALTER` statement with other commands. This differentiates them from the `ALTER` statement parse states already in `sql.y` which are concerned with `ALTER` commands that must be the sole commands in the statement. The `ADD PARTITION` and `DROP PARTITION` states are the exception and are new singleton commands that `sql.y` now supports. This patch also includes some incidental updates to `go.mod` because of tooling issues (described in vitessio#5755) and are duplicated in vitessio#5766 Updates vitessio#5705 Signed-off-by: Jeff Hodges <jeff@somethingsimilar.com>
- Loading branch information
Showing
6 changed files
with
3,801 additions
and
3,456 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.