func (p *Power) WithChildren(children ...sql.Expression) (sql.Expression, error) {
	if len(children) != 2 {
		return nil, sql.ErrInvalidChildrenNumber.New(p, len(children), 2)
	}
	return NewPower(children[0], children[0]), nil
}
WithChildren implements the Expression interface.
package function
import (
	"fmt"
	"math"
	"github.com/src-d/go-mysql-server/sql"
	"github.com/src-d/go-mysql-server/sql/expression"
)
type Sqrt struct {
	expression.UnaryExpression
}
func NewSqrt(e sql.Expression) sql.Expression {
	return &Sqrt{expression.UnaryExpression{Child: e}}
}
func (s *Sqrt) String() string {
	return fmt.Sprintf("sqrt(%s)", s.Child.String())
}
func (s *Sqrt) Type() sql.Type {
	return sql.Float64
}
func (s *Sqrt) IsNullable() bool {
	return s.Child.IsNullable()
}
func (s *Sqrt) WithChildren(children ...sql.Expression) (sql.Expression, error) {
	if len(children) != 1 {
		return nil, sql.ErrInvalidChildrenNumber.New(s, len(children), 1)
	}
	return NewSqrt(children[0]), nil
}
func (s *Sqrt) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
	child, err := s.Child.Eval(ctx, row)
	if err != nil {
		return nil, err
	}
	if child == nil {
		return nil, nil
	}
	child, err = sql.Float64.Convert(child)
	if err != nil {
		return nil, err
	}
	return math.Sqrt(child.(float64)), nil
}
type Power struct {
	expression.BinaryExpression
}
func NewPower(e1, e2 sql.Expression) sql.Expression {
	return &Power{
		expression.BinaryExpression{
			Left:  e1,
			Right: e2,
		},
	}
}
func (p *Power) Type() sql.Type { return sql.Float64 }
func (p *Power) IsNullable() bool { return p.Left.IsNullable() || p.Right.IsNullable() }
func (p *Power) String() string {
	return fmt.Sprintf("power(%s, %s)", p.Left, p.Right)
}