Skip to content

Commit

Permalink
add support for show slave hosts and show replicas
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Jan 27, 2025
1 parent b7b04ff commit 8966190
Show file tree
Hide file tree
Showing 5 changed files with 8,674 additions and 8,611 deletions.
4 changes: 4 additions & 0 deletions go/vt/sqlparser/ast_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2216,8 +2216,12 @@ func (ty ShowCommandType) ToString() string {
return KeyspaceStr
case ReplicaStatus:
return ReplicaStatusStr
case Replicas:
return ReplicasStr
case SlaveStatus:
return SlaveStatusStr
case SlaveHosts:
return SlaveHostsStr
default:
return "" +
"Unknown ShowCommandType"
Expand Down
8 changes: 6 additions & 2 deletions go/vt/sqlparser/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,11 @@ const (
ProcedureCStr = " procedure code"
ProcedureStr = " procedure status"
SlaveStatusStr = " slave status"
SlaveHostsStr = " slave hosts"
StatusGlobalStr = " global status"
StatusSessionStr = " status"
ReplicaStatusStr = " replica status"
ReplicasStr = " replicas"
TablesStr = " tables"
TableStatusStr = " table status"
TriggerStr = " triggers"
Expand Down Expand Up @@ -865,8 +867,12 @@ const (
Procedure
StatusGlobal
StatusSession
SlaveStatus
SlaveHosts
Table
TableStatus
Replicas
ReplicaStatus
Trigger
VariableGlobal
VariableSession
Expand All @@ -882,8 +888,6 @@ const (
VschemaVindexes
Warnings
Keyspace
ReplicaStatus
SlaveStatus
)

// DropKeyType constants
Expand Down
11 changes: 5 additions & 6 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2307,14 +2307,13 @@ var (
input: "show relaylog events",
output: "show relaylog",
}, {
input: "show slave hosts",
output: "show slave",
input: "show slave hosts",
}, {
input: "show slave status",
output: "show slave status",
input: "show slave status",
}, {
input: "show replica status",
output: "show replica status",
input: "show replica status",
}, {
input: "show replicas",
}, {
input: "show status",
output: "show status",
Expand Down
Loading

0 comments on commit 8966190

Please sign in to comment.