func (a *Asin) WithChildren(children ...sql.Expression) (sql.Expression, error) {
	if len(children) != 1 {
		return nil, sql.ErrInvalidChildrenNumber.New(a, len(children), 1)
	}
	return NewAsin(children[0]), nil
}
WithChildren implements sql.Expression
package function
import (
	"fmt"
	"hash/crc32"
	"math"
	"math/rand"
	"regexp"
	"strconv"
	"strings"
	"time"
	"github.com/shopspring/decimal"
	"github.com/dolthub/go-mysql-server/sql"
)
type Rand struct {
	Child sql.Expression
}
var _ sql.Expression = (*Rand)(nil)
var _ sql.NonDeterministicExpression = (*Rand)(nil)
var _ sql.FunctionExpression = (*Rand)(nil)
func NewRand(exprs ...sql.Expression) (sql.Expression, error) {
	if len(exprs) > 1 {
		return nil, sql.ErrInvalidArgumentNumber.New("rand", "0 or 1", len(exprs))
	}
	if len(exprs) > 0 {
		return &Rand{Child: exprs[0]}, nil
	}
	return &Rand{}, nil
}
func (r *Rand) FunctionName() string {
	return "rand"
}
func (r *Rand) Type() sql.Type {
	return sql.Float64
}
func (r *Rand) IsNonDeterministic() bool {
	return r.Child == nil
}
func (r *Rand) IsNullable() bool {
	return false
}
func (r *Rand) Resolved() bool {
	return r.Child == nil || r.Child.Resolved()
}
func (r *Rand) String() string {
	if r.Child != nil {
		return fmt.Sprintf("RAND(%s)", r.Child)
	}
	return fmt.Sprintf("RAND()")
}
func (r *Rand) WithChildren(children ...sql.Expression) (sql.Expression, error) {
	if len(children) > 1 {
		return nil, sql.ErrInvalidChildrenNumber.New(r, len(children), 1)
	}
	if len(children) == 0 {
		return r, nil
	}
	return NewRand(children[0])
}
func (r *Rand) Children() []sql.Expression {
	if r.Child == nil {
		return nil
	}
	return []sql.Expression{r.Child}
}
func (r *Rand) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
	if r.Child == nil {
		return rand.Float64(), nil
	}
	e, err := r.Child.Eval(ctx, row)
	if err != nil {
		return nil, err
	}
	var seed int64
	if sql.IsNumber(r.Child.Type()) {
		e, err = sql.Int64.Convert(e)
		if err == nil {
			seed = e.(int64)
		}
	}
	return rand.New(rand.NewSource(seed)).Float64(), nil
}
type Sin struct {
	*UnaryFunc
}
var _ sql.FunctionExpression = (*Sin)(nil)
func NewSin(arg sql.Expression) sql.Expression {
	return &Sin{NewUnaryFunc(arg, "SIN", sql.Float64)}
}
func (s *Sin) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
	val, err := s.EvalChild(ctx, row)
	if err != nil {
		return nil, err
	}
	if val == nil {
		return nil, nil
	}
	n, err := sql.Float64.Convert(val)
	if err != nil {
		return nil, err
	}
	return math.Sin(n.(float64)), nil
}
func (s *Sin) WithChildren(children ...sql.Expression) (sql.Expression, error) {
	if len(children) != 1 {
		return nil, sql.ErrInvalidChildrenNumber.New(s, len(children), 1)
	}
	return NewSin(children[0]), nil
}
type Cos struct {
	*UnaryFunc
}
var _ sql.FunctionExpression = (*Cos)(nil)
func NewCos(arg sql.Expression) sql.Expression {
	return &Cos{NewUnaryFunc(arg, "COS", sql.Float64)}
}
func (s *Cos) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
	val, err := s.EvalChild(ctx, row)
	if err != nil {
		return nil, err
	}
	if val == nil {
		return nil, nil
	}
	n, err := sql.Float64.Convert(val)
	if err != nil {
		return nil, err
	}
	return math.Cos(n.(float64)), nil
}
func (c *Cos) WithChildren(children ...sql.Expression) (sql.Expression, error) {
	if len(children) != 1 {
		return nil, sql.ErrInvalidChildrenNumber.New(c, len(children), 1)
	}
	return NewCos(children[0]), nil
}
type Tan struct {
	*UnaryFunc
}
var _ sql.FunctionExpression = (*Tan)(nil)
func NewTan(arg sql.Expression) sql.Expression {
	return &Tan{NewUnaryFunc(arg, "TAN", sql.Float64)}
}
func (t *Tan) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
	val, err := t.EvalChild(ctx, row)
	if err != nil {
		return nil, err
	}
	if val == nil {
		return nil, nil
	}
	n, err := sql.Float64.Convert(val)
	if err != nil {
		return nil, err
	}
	return math.Tan(n.(float64)), nil
}
func (t *Tan) WithChildren(children ...sql.Expression) (sql.Expression, error) {
	if len(children) != 1 {
		return nil, sql.ErrInvalidChildrenNumber.New(t, len(children), 1)
	}
	return NewTan(children[0]), nil
}
type Asin struct {
	*UnaryFunc
}
var _ sql.FunctionExpression = (*Asin)(nil)
func NewAsin(arg sql.Expression) sql.Expression {
	return &Asin{NewUnaryFunc(arg, "ASIN", sql.Float64)}
}
func (a *Asin) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
	val, err := a.EvalChild(ctx, row)
	if err != nil {
		return nil, err
	}
	if val == nil {
		return nil, nil
	}
	n, err := sql.Float64.Convert(val)
	if err != nil {
		return nil, err
	}
	return math.Asin(n.(float64)), nil
}