diff --git a/enginetest/queries/information_schema_queries.go b/enginetest/queries/information_schema_queries.go index fbe5e29ac7..7c37d235a5 100644 --- a/enginetest/queries/information_schema_queries.go +++ b/enginetest/queries/information_schema_queries.go @@ -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;", @@ -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`, diff --git a/sql/planbuilder/show.go b/sql/planbuilder/show.go index 4c0e7ad489..4ec6bcc8c8 100644 --- a/sql/planbuilder/show.go +++ b/sql/planbuilder/show.go @@ -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) }