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 PLUGINS #2161

Merged
merged 1 commit into from
Nov 27, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions enginetest/queries/information_schema_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import (
)

var InfoSchemaQueries = []QueryTest{
{
Query: "SHOW PLUGINS",
Expected: []sql.Row{},
},
{
Query: "SHOW KEYS FROM `columns` FROM `information_schema`;",
Expected: []sql.Row{},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e
github.com/dolthub/jsonpath v0.0.2-0.20230525180605-8dc13778fd72
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81
github.com/dolthub/vitess v0.0.0-20231109003730-c0fa018b5ef6
github.com/dolthub/vitess v0.0.0-20231127171856-2466012fb61f
github.com/go-kit/kit v0.10.0
github.com/go-sql-driver/mysql v1.7.1
github.com/gocraft/dbr/v2 v2.7.2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ github.com/dolthub/vitess v0.0.0-20231106195946-51b76945ad0c h1:dZ95h8OHK/L4nLUU
github.com/dolthub/vitess v0.0.0-20231106195946-51b76945ad0c/go.mod h1:IwjNXSQPymrja5pVqmfnYdcy7Uv7eNJNBPK/MEh9OOw=
github.com/dolthub/vitess v0.0.0-20231109003730-c0fa018b5ef6 h1:/GOBV8ceNCMuyS9/sdjqfmgti6OSibUKDTop9YbowzM=
github.com/dolthub/vitess v0.0.0-20231109003730-c0fa018b5ef6/go.mod h1:IwjNXSQPymrja5pVqmfnYdcy7Uv7eNJNBPK/MEh9OOw=
github.com/dolthub/vitess v0.0.0-20231127171856-2466012fb61f h1:I480LKHhb4usnF3dYhp6J4ORKMrncNKaWYZvIZwlK+U=
github.com/dolthub/vitess v0.0.0-20231127171856-2466012fb61f/go.mod h1:IwjNXSQPymrja5pVqmfnYdcy7Uv7eNJNBPK/MEh9OOw=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
Expand Down
13 changes: 13 additions & 0 deletions sql/planbuilder/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ func (b *Builder) buildShow(inScope *scope, s *ast.Show, query string) (outScope
return b.buildShowEngines(inScope, s)
case ast.KeywordString(ast.STATUS):
return b.buildShowStatus(inScope, s)
case ast.KeywordString(ast.PLUGINS):
return b.buildShowPlugins(inScope, s)
case "replica status":
outScope = inScope.push()
showRep := plan.NewShowReplicaStatus()
Expand Down Expand Up @@ -801,6 +803,17 @@ func (b *Builder) buildShowEngines(inScope *scope, s *ast.Show) (outScope *scope
return
}

func (b *Builder) buildShowPlugins(inScope *scope, s *ast.Show) (outScope *scope) {
outScope = inScope.push()
infoSchemaSelect, _, _, err := b.Parse("select * from information_schema.plugins", false)
if err != nil {
b.handleErr(err)
}

outScope.node = infoSchemaSelect
return
}

func (b *Builder) buildShowStatus(inScope *scope, s *ast.Show) (outScope *scope) {
outScope = inScope.push()
var node sql.Node
Expand Down