func (s *ShowProcedureStatus) WithDatabase(db sql.Database) (sql.Node, error) {
	ns := *s
	ns.db = db
	return &ns, nil
}
WithDatabase implements the sql.Databaser interface.
package plan
import (
	"github.com/dolthub/go-mysql-server/sql"
)
type ShowProcedureStatus struct {
	db         sql.Database
	Procedures []*Procedure
}
var _ sql.Databaser = (*ShowProcedureStatus)(nil)
var _ sql.Node = (*ShowProcedureStatus)(nil)
var showProcedureStatusSchema = sql.Schema{
	&sql.Column{Name: "Db", Type: sql.LongText, Nullable: false},
	&sql.Column{Name: "Name", Type: sql.LongText, Nullable: false},
	&sql.Column{Name: "Type", Type: sql.LongText, Nullable: false},
	&sql.Column{Name: "Definer", Type: sql.LongText, Nullable: false},
	&sql.Column{Name: "Modified", Type: sql.Datetime, Nullable: false},
	&sql.Column{Name: "Created", Type: sql.Datetime, Nullable: false},
	&sql.Column{Name: "Security_type", Type: sql.LongText, Nullable: false},
	&sql.Column{Name: "Comment", Type: sql.LongText, Nullable: false},
	&sql.Column{Name: "character_set_client", Type: sql.LongText, Nullable: false},
	&sql.Column{Name: "collation_connection", Type: sql.LongText, Nullable: false},
	&sql.Column{Name: "Database Collation", Type: sql.LongText, Nullable: false},
}
func NewShowProcedureStatus(db sql.Database) *ShowProcedureStatus {
	return &ShowProcedureStatus{
		db: db,
	}
}
func (s *ShowProcedureStatus) String() string {
	return "SHOW PROCEDURE STATUS"
}
func (s *ShowProcedureStatus) Resolved() bool {
	_, ok := s.db.(sql.UnresolvedDatabase)
	return !ok
}
func (s *ShowProcedureStatus) Children() []sql.Node {
	return nil
}
func (s *ShowProcedureStatus) Schema() sql.Schema {
	return showProcedureStatusSchema
}
func (s *ShowProcedureStatus) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error) {
	var rows []sql.Row
	for _, procedure := range s.Procedures {
		securityType := "DEFINER"
		if procedure.SecurityContext == ProcedureSecurityContext_Invoker {
			securityType = "INVOKER"
		}
		characterSetClient, err := ctx.GetSessionVariable(ctx, "character_set_client")
		if err != nil {
			return nil, err
		}
		collationConnection, err := ctx.GetSessionVariable(ctx, "collation_connection")
		if err != nil {
			return nil, err
		}
		collationServer, err := ctx.GetSessionVariable(ctx, "collation_server")
		if err != nil {
			return nil, err
		}
		rows = append(rows, sql.Row{
			s.db.Name(),                 
			procedure.Name,              
			"PROCEDURE",                 
			procedure.Definer,           
			procedure.ModifiedAt.UTC(),  
			procedure.CreatedAt.UTC(),   
			securityType,                
			procedure.Comment,           
			characterSetClient,          
			collationConnection,         
			collationServer,             
		})
	}
	return sql.RowsToRowIter(rows...), nil
}
func (s *ShowProcedureStatus) WithChildren(children ...sql.Node) (sql.Node, error) {
	return NillaryWithChildren(s, children...)
}
func (s *ShowProcedureStatus) Database() sql.Database {
	return s.db
}