Skip to content
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

Add SHOW VITESS_REPLICATION_STATUS Query Support #14627

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion go/vt/sqlparser/ast_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,8 @@ func (node *Show) Format(buf *TrackedBuffer) {
func (node *ShowLegacy) Format(buf *TrackedBuffer) {
nodeType := strings.ToLower(node.Type)
if (nodeType == "tables" || nodeType == "columns" || nodeType == "fields" || nodeType == "index" || nodeType == "keys" || nodeType == "indexes" ||
nodeType == "databases" || nodeType == "schemas" || nodeType == "keyspaces" || nodeType == "vitess_keyspaces" || nodeType == "vitess_shards" || nodeType == "vitess_tablets") && node.ShowTablesOpt != nil {
nodeType == "databases" || nodeType == "schemas" || nodeType == "keyspaces" || nodeType == "vitess_keyspaces" || nodeType == "vitess_replication_status" ||
nodeType == "vitess_shards" || nodeType == "vitess_tablets") && node.ShowTablesOpt != nil {
opt := node.ShowTablesOpt
if node.Extended != "" {
buf.astPrintf(node, "show %s%s", node.Extended, nodeType)
Expand Down
3 changes: 2 additions & 1 deletion go/vt/sqlparser/ast_format_fast.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions go/vt/sqlparser/keywords.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,11 @@ var keywords = []keyword{
{"vitess", VITESS},
{"vitess_keyspaces", VITESS_KEYSPACES},
{"vitess_metadata", VITESS_METADATA},
{"vitess_shards", VITESS_SHARDS},
{"vitess_tablets", VITESS_TABLETS},
{"vitess_migration", VITESS_MIGRATION},
{"vitess_migrations", VITESS_MIGRATIONS},
{"vitess_replication_status", VITESS_REPLICATION_STATUS},
{"vitess_shards", VITESS_SHARDS},
{"vitess_tablets", VITESS_TABLETS},
{"vschema", VSCHEMA},
{"warnings", WARNINGS},
{"when", WHEN},
Expand Down
2 changes: 2 additions & 0 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,8 @@ var (
}, {
input: "show vitess_keyspaces like '%'",
output: "show keyspaces like '%'",
}, {
input: "show vitess_replication_status",
}, {
input: "show vitess_shards",
}, {
Expand Down
Loading
Loading