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

Show privilege support #7194

Merged
merged 3 commits into from
Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions go/vt/sqlparser/ast_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,8 @@ func (ty ShowCommandType) ToString() string {
return DatabaseStr
case Function:
return FunctionStr
case Privilege:
return PrivilegeStr
case Procedure:
return ProcedureStr
case StatusGlobal:
Expand Down
2 changes: 2 additions & 0 deletions go/vt/sqlparser/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const (
CollationStr = " collation"
DatabaseStr = " databases"
FunctionStr = " function status"
PrivilegeStr = " privileges"
ProcedureStr = " procedure status"
StatusGlobalStr = " global status"
StatusSessionStr = " status"
Expand Down Expand Up @@ -413,6 +414,7 @@ const (
Collation
Database
Function
Privilege
Procedure
StatusGlobal
StatusSession
Expand Down
18 changes: 6 additions & 12 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1272,8 +1272,7 @@ var (
input: "show create event e",
output: "show create event",
}, {
input: "show create function f",
output: "show create function",
input: "show create function f",
}, {
input: "show create procedure p",
output: "show create procedure",
Expand Down Expand Up @@ -1305,23 +1304,18 @@ var (
input: "show engine INNODB",
output: "show engine",
}, {
input: "show engines",
output: "show engines",
input: "show engines",
}, {
input: "show storage engines",
output: "show storage",
}, {
input: "show errors",
output: "show errors",
input: "show errors",
}, {
input: "show events",
output: "show events",
input: "show events",
}, {
input: "show function code func",
output: "show function",
input: "show function code func",
}, {
input: "show function status",
output: "show function",
input: "show function status",
}, {
input: "show grants for 'root@localhost'",
output: "show grants",
Expand Down