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

Fix: Vitess show character set where #5710

Merged
merged 12 commits into from
Feb 6, 2020
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ require (
github.com/mattn/go-runewidth v0.0.1 // indirect
github.com/minio/minio-go v0.0.0-20190131015406-c8a261de75c1
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/olekukonko/tablewriter v0.0.0-20160115111002-cca8bbc07984
github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02
github.com/opentracing/opentracing-go v1.1.0
Expand Down
3 changes: 3 additions & 0 deletions go/vt/sqlparser/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,9 @@ func (node *Show) Format(buf *TrackedBuffer) {
if node.Type == "collation" && node.ShowCollationFilterOpt != nil {
buf.Myprintf(" where %v", *node.ShowCollationFilterOpt)
}
if node.Type == "charset" && node.ShowTablesOpt != nil {
buf.Myprintf("%v", node.ShowTablesOpt.Filter)
}
if node.HasTable() {
buf.Myprintf(" %v", node.Table)
}
Expand Down
10 changes: 8 additions & 2 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1138,13 +1138,19 @@ var (
output: "show charset",
}, {
input: "show character set like '%foo'",
output: "show charset",
output: "show charset like '%foo'",
}, {
input: "show charset",
output: "show charset",
}, {
input: "show charset like '%foo'",
output: "show charset",
output: "show charset like '%foo'",
Ronihe marked this conversation as resolved.
Show resolved Hide resolved
}, {
input: "show charset where 'charset' = 'utf8'",
output: "show charset where 'charset' = 'utf8'",
}, {
input: "show charset where 'charset' = '%foo'",
output: "show charset where 'charset' = '%foo'",
}, {
input: "show collation",
output: "show collation",
Expand Down
Loading