func (m *Min) NewBuffer() (sql.AggregationBuffer, error) {
	bufferChild, err := expression.Clone(m.UnaryExpression.Child)
	if err != nil {
		return nil, err
	}
	return &minBuffer{nil, bufferChild}, nil
}
NewBuffer creates a new buffer to compute the result.
package aggregation
import (
	"fmt"
	"reflect"
	"github.com/dolthub/go-mysql-server/sql"
	"github.com/dolthub/go-mysql-server/sql/expression"
)
type Min struct {
	expression.UnaryExpression
}
var _ sql.FunctionExpression = (*Min)(nil)
var _ sql.Aggregation = (*Min)(nil)
func NewMin(e sql.Expression) *Min {
	return &Min{expression.UnaryExpression{Child: e}}
}
func (m *Min) FunctionName() string {
	return "min"
}
func (m *Min) Type() sql.Type {
	return m.Child.Type()
}
func (m *Min) String() string {
	return fmt.Sprintf("MIN(%s)", m.Child)
}
func (m *Min) IsNullable() bool {
	return true
}
func (m *Min) WithChildren(children ...sql.Expression) (sql.Expression, error) {
	if len(children) != 1 {
		return nil, sql.ErrInvalidChildrenNumber.New(m, len(children), 1)
	}
	return NewMin(children[0]), nil
}