func (s *ShowTableStatus) WithChildren(children ...sql.Node) (sql.Node, error) {
	if len(children) != 0 {
		return nil, sql.ErrInvalidChildrenNumber.New(s, len(children), 0)
	}
	return s, nil
}
WithChildren implements the Node interface.
package plan
import (
	"fmt"
	"sort"
	"strings"
	"github.com/src-d/go-mysql-server/sql"
)
type ShowTableStatus struct {
	Databases []string
	Catalog   *sql.Catalog
}
func NewShowTableStatus(dbs ...string) *ShowTableStatus {
	return &ShowTableStatus{Databases: dbs}
}
var showTableStatusSchema = sql.Schema{
	{Name: "Name", Type: sql.Text},
	{Name: "Engine", Type: sql.Text},
	{Name: "Version", Type: sql.Text},
	{Name: "Row_format", Type: sql.Text},
	{Name: "Rows", Type: sql.Int64},
	{Name: "Avg_row_length", Type: sql.Int64},
	{Name: "Data_length", Type: sql.Int64},
	{Name: "Max_data_length", Type: sql.Int64},
	{Name: "Index_length", Type: sql.Int64},
	{Name: "Data_free", Type: sql.Int64},
	{Name: "Auto_increment", Type: sql.Int64},
	{Name: "Create_time", Type: sql.Timestamp, Nullable: true},
	{Name: "Update_time", Type: sql.Timestamp, Nullable: true},
	{Name: "Check_time", Type: sql.Timestamp, Nullable: true},
	{Name: "Collation", Type: sql.Text},
	{Name: "Checksum", Type: sql.Text, Nullable: true},
	{Name: "Create_options", Type: sql.Text, Nullable: true},
	{Name: "Comments", Type: sql.Text, Nullable: true},
}
func (s *ShowTableStatus) Children() []sql.Node { return nil }
func (s *ShowTableStatus) Resolved() bool { return true }
func (s *ShowTableStatus) Schema() sql.Schema { return showTableStatusSchema }
func (s *ShowTableStatus) RowIter(ctx *sql.Context) (sql.RowIter, error) {
	var rows []sql.Row
	var tables []string
	if len(s.Databases) > 0 {
		for _, db := range s.Catalog.AllDatabases() {
			if !stringContains(s.Databases, db.Name()) {
				continue
			}
			for t := range db.Tables() {
				tables = append(tables, t)
			}
		}
	} else {
		db, err := s.Catalog.Database(s.Catalog.CurrentDatabase())
		if err != nil {
			return nil, err
		}
		for t := range db.Tables() {
			tables = append(tables, t)
		}
	}
	sort.Strings(tables)
	for _, t := range tables {
		rows = append(rows, tableToStatusRow(t))
	}
	return sql.RowsToRowIter(rows...), nil
}
func (s *ShowTableStatus) String() string {
	return fmt.Sprintf("ShowTableStatus(%s)", strings.Join(s.Databases, ", "))
}