func (l *Length) FunctionName() string {
	if l.CountType == NumChars {
		return "character_length"
	} else if l.CountType == NumBytes {
		return "length"
	} else {
		panic("unknown name for length count type")
	}
}
FunctionName implements sql.FunctionExpression
package function
import (
	"fmt"
	"unicode/utf8"
	"github.com/dolthub/go-mysql-server/sql"
	"github.com/dolthub/go-mysql-server/sql/expression"
)
type Length struct {
	expression.UnaryExpression
	CountType CountType
}
var _ sql.FunctionExpression = (*Length)(nil)
type CountType bool
const (
	NumBytes = CountType(false)
	NumChars = CountType(true)
)
func NewLength(e sql.Expression) sql.Expression {
	return &Length{expression.UnaryExpression{Child: e}, NumBytes}
}
func NewCharLength(e sql.Expression) sql.Expression {
	return &Length{expression.UnaryExpression{Child: e}, NumChars}
}