Skip to content
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
52 changes: 52 additions & 0 deletions enginetest/queries/information_schema_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,32 @@ var InfoSchemaQueries = []QueryTest{
Expected: []sql.Row{
{"InnoDB", "DEFAULT", "Supports transactions, row-level locking, and foreign keys", "YES", "YES", "YES"},
},
ExpectedColumns: sql.Schema{
{
Name: "Engine",
Type: types.MustCreateString(sqltypes.VarChar, 64, sql.Collation_Information_Schema_Default),
},
{
Name: "Support",
Type: types.MustCreateString(sqltypes.VarChar, 8, sql.Collation_Information_Schema_Default),
},
{
Name: "Comment",
Type: types.MustCreateString(sqltypes.VarChar, 80, sql.Collation_Information_Schema_Default),
},
{
Name: "Transactions",
Type: types.MustCreateString(sqltypes.VarChar, 3, sql.Collation_Information_Schema_Default),
},
{
Name: "XA",
Type: types.MustCreateString(sqltypes.VarChar, 3, sql.Collation_Information_Schema_Default),
},
{
Name: "Savepoints",
Type: types.MustCreateString(sqltypes.VarChar, 3, sql.Collation_Information_Schema_Default),
},
},
},
{
Query: "SELECT * FROM information_schema.table_constraints ORDER BY table_name, constraint_type;",
Expand Down Expand Up @@ -455,6 +481,32 @@ var InfoSchemaQueries = []QueryTest{
Expected: []sql.Row{
{"InnoDB", "DEFAULT", "Supports transactions, row-level locking, and foreign keys", "YES", "YES", "YES"},
},
ExpectedColumns: sql.Schema{
{
Name: "ENGINE",
Type: types.MustCreateString(sqltypes.VarChar, 64, sql.Collation_Information_Schema_Default),
},
{
Name: "SUPPORT",
Type: types.MustCreateString(sqltypes.VarChar, 8, sql.Collation_Information_Schema_Default),
},
{
Name: "COMMENT",
Type: types.MustCreateString(sqltypes.VarChar, 80, sql.Collation_Information_Schema_Default),
},
{
Name: "TRANSACTIONS",
Type: types.MustCreateString(sqltypes.VarChar, 3, sql.Collation_Information_Schema_Default),
},
{
Name: "XA",
Type: types.MustCreateString(sqltypes.VarChar, 3, sql.Collation_Information_Schema_Default),
},
{
Name: "SAVEPOINTS",
Type: types.MustCreateString(sqltypes.VarChar, 3, sql.Collation_Information_Schema_Default),
},
},
},
{
Query: `SELECT * from information_schema.administrable_role_authorizations`,
Expand Down
11 changes: 10 additions & 1 deletion sql/planbuilder/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,16 @@ func (b *Builder) buildShowCollation(inScope *scope, s *ast.Show) (outScope *sco

func (b *Builder) buildShowEngines(inScope *scope, s *ast.Show) (outScope *scope) {
outScope = inScope.push()
infoSchemaSelect, _, _, err := b.Parse("select * from information_schema.engines", false)
infoSchemaSelect, _, _, err := b.Parse(`
select
ENGINE as Engine,
SUPPORT as Support,
COMMENT as Comment,
TRANSACTIONS as Transactions,
XA as XA,
SAVEPOINTS as Savepoints
from information_schema.engines
`, false)
if err != nil {
b.handleErr(err)
}
Expand Down