func (s *ShowTableStatus) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error) {
	tables, err := s.db.GetTableNames(ctx)
	if err != nil {
		return nil, err
	}
	var rows = make([]sql.Row, len(tables))
	for i, tName := range tables {
		table, _, err := s.Catalog.Table(ctx, s.db.Name(), tName)
		if err != nil {
			return nil, err
		}
		var numRows uint64 = 0
		var dataLength uint64 = 0
		if st, ok := table.(sql.StatisticsTable); ok {
			numRows, err = st.NumRows(ctx)
			if err != nil {
				return nil, err
			}
			dataLength, err = st.DataLength(ctx)
			if err != nil {
				return nil, err
			}
		}
		nextAIVal, err := getAutoIncrementValue(ctx, table)
		if err != nil {
			return nil, err
		}
		rows[i] = tableToStatusRow(tName, numRows, nextAIVal, dataLength)
	}
	return sql.RowsToRowIter(rows...), nil
}
RowIter implements the sql.Node interface.
package plan
import (
	"errors"
	"github.com/dolthub/go-mysql-server/sql"
)
type ShowTableStatus struct {
	db      sql.Database
	Catalog sql.Catalog
}
var _ sql.Databaser = (*ShowTableStatus)(nil)
func NewShowTableStatus(db sql.Database) *ShowTableStatus {
	return &ShowTableStatus{db: db}
}
func (s *ShowTableStatus) Database() sql.Database {
	return s.db
}
func (s *ShowTableStatus) WithDatabase(db sql.Database) (sql.Node, error) {
	ns := *s
	ns.db = db
	return &ns, nil
}
var showTableStatusSchema = sql.Schema{
	{Name: "Name", Type: sql.LongText},
	{Name: "Engine", Type: sql.LongText},
	{Name: "Version", Type: sql.LongText},
	{Name: "Row_format", Type: sql.LongText},
	{Name: "Rows", Type: sql.Uint64},
	{Name: "Avg_row_length", Type: sql.Uint64},
	{Name: "Data_length", Type: sql.Uint64},
	{Name: "Max_data_length", Type: sql.Uint64},
	{Name: "Index_length", Type: sql.Int64},
	{Name: "Data_free", Type: sql.Int64},
	{Name: "Auto_increment", Type: sql.Int64},
	{Name: "Create_time", Type: sql.Datetime, Nullable: true},
	{Name: "Update_time", Type: sql.Datetime, Nullable: true},
	{Name: "Check_time", Type: sql.Datetime, Nullable: true},
	{Name: "Collation", Type: sql.LongText},
	{Name: "Checksum", Type: sql.LongText, Nullable: true},
	{Name: "Create_options", Type: sql.LongText, Nullable: true},
	{Name: "Comments", Type: sql.LongText, 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 }