func (t systemUintType) Promote() Type {
	return t
}
Promote implements the Type interface.
package sql
import (
	"strconv"
	"github.com/dolthub/vitess/go/sqltypes"
	"github.com/dolthub/vitess/go/vt/proto/query"
)
type systemUintType struct {
	varName    string
	lowerbound uint64
	upperbound uint64
}
var _ SystemVariableType = systemUintType{}
func NewSystemUintType(varName string, lowerbound, upperbound uint64) SystemVariableType {
	return systemUintType{varName, lowerbound, upperbound}
}
func (t systemUintType) Compare(a interface{}, b interface{}) (int, error) {
	as, err := t.Convert(a)
	if err != nil {
		return 0, err
	}
	bs, err := t.Convert(b)
	if err != nil {
		return 0, err
	}
	ai := as.(uint64)
	bi := bs.(uint64)
	if ai == bi {
		return 0, nil
	}
	if ai < bi {
		return -1, nil
	}
	return 1, nil
}
func (t systemUintType) Convert(v interface{}) (interface{}, error) {
	switch value := v.(type) {
	case int:
		return t.Convert(uint64(value))
	case uint:
		return t.Convert(uint64(value))
	case int8:
		return t.Convert(uint64(value))
	case uint8:
		return t.Convert(uint64(value))
	case int16:
		return t.Convert(uint64(value))
	case uint16:
		return t.Convert(uint64(value))
	case int32:
		return t.Convert(uint64(value))
	case uint32:
		return t.Convert(uint64(value))
	case int64:
		return t.Convert(uint64(value))
	case uint64:
		if value >= t.lowerbound && value <= t.upperbound {
			return value, nil
		}
	case float32:
		return t.Convert(float64(value))
	case float64:
		if value == float64(uint64(value)) {
			return t.Convert(uint64(value))
		}
	}
	return nil, ErrInvalidSystemVariableValue.New(t.varName, v)
}
func (t systemUintType) MustConvert(v interface{}) interface{} {
	value, err := t.Convert(v)
	if err != nil {
		panic(err)
	}
	return value
}