Documentation ¶
Index ¶
- Variables
- func Add(v1, v2 sqltypes.Value) (sqltypes.Value, error)
- func AggregateTypes(types []sqltypes.Type) sqltypes.Type
- func CoerceTo(value sqltypes.Value, typ sqltypes.Type, sqlmode SQLMode) (sqltypes.Value, error)
- func Divide(v1, v2 sqltypes.Value) (sqltypes.Value, error)
- func Multiply(v1, v2 sqltypes.Value) (sqltypes.Value, error)
- func NullSafeAdd(v1, v2 sqltypes.Value, resultType sqltypes.Type) (sqltypes.Value, error)
- func NullsafeCompare(v1, v2 sqltypes.Value, collationEnv *collations.Environment, ...) (int, error)
- func NullsafeHashcode128(hash *vthash.Hasher, v sqltypes.Value, collation collations.ID, ...) error
- func PanicHandler(err *error)
- func Subtract(v1, v2 sqltypes.Value) (sqltypes.Value, error)
- func TinyWeighter(f *querypb.Field, collation collations.ID) func(v *sqltypes.Value)
- func WeightString(dst []byte, v sqltypes.Value, coerceTo sqltypes.Type, col collations.ID, ...) ([]byte, bool, error)
- type Arena
- type ArithmeticExpr
- type BinaryExpr
- type BindVariable
- type BitwiseExpr
- type BitwiseNotExpr
- type CallExpr
- type CaseExpr
- type CollateExpr
- type Column
- type ColumnResolver
- type Comparison
- func (cmp Comparison) ApplyTinyWeights(out *sqltypes.Result)
- func (cmp Comparison) Compare(a, b sqltypes.Row) int
- func (cmp Comparison) Less(a, b sqltypes.Row) bool
- func (cmp Comparison) More(a, b sqltypes.Row) bool
- func (cmp Comparison) Sort(out []sqltypes.Row)
- func (cmp Comparison) SortResult(out *sqltypes.Result) (err error)
- type ComparisonExpr
- type ComparisonOp
- type CompiledExpr
- type CompilerLog
- type Config
- type ConvertExpr
- type ConvertUsingExpr
- type EvalResult
- func (er EvalResult) Collation() collations.ID
- func (er EvalResult) MustBoolean() bool
- func (er EvalResult) String() string
- func (er EvalResult) ToBoolean() bool
- func (er EvalResult) ToBooleanStrict() (bool, error)
- func (er EvalResult) TupleValues() []sqltypes.Value
- func (er EvalResult) Value(id collations.ID) sqltypes.Value
- type Expr
- type ExpressionEnv
- func (env *ExpressionEnv) Evaluate(expr Expr) (EvalResult, error)
- func (env *ExpressionEnv) EvaluateAST(expr Expr) (EvalResult, error)
- func (env *ExpressionEnv) EvaluateVM(p *CompiledExpr) (EvalResult, error)
- func (env *ExpressionEnv) SetTime(now time.Time)
- func (env *ExpressionEnv) TypeOf(expr Expr) (Type, error)
- func (env *ExpressionEnv) VCursor() VCursor
- type FieldResolver
- type FilterExpr
- type HashCode
- type IR
- type InExpr
- type IntervalExpr
- type IntroducerExpr
- type IsExpr
- type LikeExpr
- type Literal
- func NewLiteralBinary(val []byte) *Literal
- func NewLiteralBinaryFromBit(val []byte) (*Literal, error)
- func NewLiteralBinaryFromHex(val []byte) (*Literal, error)
- func NewLiteralBinaryFromHexNum(val []byte) (*Literal, error)
- func NewLiteralBool(b bool) *Literal
- func NewLiteralDateFromBytes(val []byte) (*Literal, error)
- func NewLiteralDatetimeFromBytes(val []byte) (*Literal, error)
- func NewLiteralDecimalFromBytes(val []byte) (*Literal, error)
- func NewLiteralFloat(val float64) *Literal
- func NewLiteralFloatFromBytes(val []byte) (*Literal, error)
- func NewLiteralInt(i int64) *Literal
- func NewLiteralIntegralFromBytes(val []byte) (*Literal, error)
- func NewLiteralString(val []byte, collation collations.TypedCollation) *Literal
- func NewLiteralTimeFromBytes(val []byte) (*Literal, error)
- func NewLiteralUint(i uint64) *Literal
- type LogicalExpr
- type Merger
- type MinMax
- type NegateExpr
- type NotExpr
- type OrderByParams
- type SQLMode
- type Sorter
- type Sum
- type TupleBindVariable
- type TupleExpr
- type Type
- func AggregateEvalTypes(types []Type, env *collations.Environment) (Type, error)
- func CoerceTypes(v1, v2 Type, collationEnv *collations.Environment) (out Type, err error)
- func NewType(t sqltypes.Type, collation collations.ID) Type
- func NewTypeEx(t sqltypes.Type, collation collations.ID, nullable bool, size, scale int32) Type
- type TypeResolver
- type UnaryExpr
- type UnsupportedCollationError
- type UntypedExpr
- func (cached *UntypedExpr) CachedSize(alloc bool) int64
- func (u *UntypedExpr) Compile(env *ExpressionEnv) (*CompiledExpr, error)
- func (u *UntypedExpr) Format(buf *sqlparser.TrackedBuffer)
- func (u *UntypedExpr) FormatFast(buf *sqlparser.TrackedBuffer)
- func (u *UntypedExpr) IR() IR
- func (u *UntypedExpr) IsExpr()
- type VCursor
- type WhenThen
Constants ¶
This section is empty.
Variables ¶
var ErrEvaluatedExprNotSupported = "expr cannot be evaluated, not supported"
var ErrHashCoercionIsNotExact = vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "cannot coerce into target type without losing precision")
var ErrTranslateExprNotSupported = "expr cannot be translated, not supported"
var NullExpr = &Literal{}
NullExpr is just what you are lead to believe
var SystemTime = time.Now
var UnsupportedCollationHashError = vterrors.Errorf(vtrpcpb.Code_INTERNAL, "text type with an unknown/unsupported collation cannot be hashed")
UnsupportedCollationHashError is returned when we try to get the hash value and are missing the collation to use
Functions ¶
func NullSafeAdd ¶ added in v0.13.0
NullSafeAdd adds two Values in a null-safe manner. A null value is treated as 0. If both values are null, then a null is returned. If both values are not null, a numeric value is built from each input: Signed->int64, Unsigned->uint64, Float->float64. Otherwise the 'best type fit' is chosen for the number: int64 or float64. opArithAdd is performed by upgrading types as needed, or in case of overflow: int64->uint64, int64->float64, uint64->float64. Unsigned ints can only be added to positive ints. After the addition, if one of the input types was Decimal, then a Decimal is built. Otherwise, the final type of the result is preserved.
func NullsafeCompare ¶
func NullsafeCompare(v1, v2 sqltypes.Value, collationEnv *collations.Environment, collationID collations.ID) (int, error)
NullsafeCompare returns 0 if v1==v2, -1 if v1<v2, and 1 if v1>v2. NULL is the lowest value. If any value is numeric, then a numeric comparison is performed after necessary conversions. If none are numeric, then it's a simple binary comparison. Uncomparable values return an error.
func NullsafeHashcode128 ¶ added in v0.17.0
func NullsafeHashcode128(hash *vthash.Hasher, v sqltypes.Value, collation collations.ID, coerceTo sqltypes.Type, sqlmode SQLMode) error
NullsafeHashcode128 returns a 128-bit hashcode that is guaranteed to be the same for two values that are considered equal by `NullsafeCompare`. This can be used to avoid having to do comparison checks after a hash, since we consider the 128 bits of entropy enough to guarantee uniqueness.
func PanicHandler ¶ added in v0.19.0
func PanicHandler(err *error)
func TinyWeighter ¶ added in v0.19.0
TinyWeighter returns a callback to apply a Tiny Weight string to a sqltypes.Value. A tiny weight string is a compressed 4-byte representation of the value's full weight string that sorts identically to its full weight. Obviously, the tiny weight string can collide because it's represented in fewer bytes than the full one. Hence, for any 2 instances of sqltypes.Value: if both instances have a Tiny Weight string, and the weight strings are **different**, the two values will sort accordingly to the 32-bit numerical sort of their tiny weight strings. Otherwise, the relative sorting of the two values will not be known, and they will require a full sort using e.g. NullsafeCompare.
func WeightString ¶ added in v0.18.0
func WeightString(dst []byte, v sqltypes.Value, coerceTo sqltypes.Type, col collations.ID, length, precision int, sqlmode SQLMode) ([]byte, bool, error)
WeightString returns the weight string for a value. It appends to dst if an existing slice is given, otherwise it returns a new one. The returned boolean indicates whether the weight string is a fixed-width weight string, such as for fixed size integer values. Our WeightString implementation supports more types that MySQL externally communicates with the `WEIGHT_STRING` function, so that we can also use this to order / sort other types like Float and Decimal as well.
Types ¶
type Arena ¶ added in v0.17.0
type Arena struct {
// contains filtered or unexported fields
}
Arena is an arena memory allocator for eval types. It allocates the types from reusable slices to prevent heap allocations. After each evaluation execution, (*Arena).reset() should be called to reset the arena.
type ArithmeticExpr ¶ added in v0.13.0
type ArithmeticExpr struct { BinaryExpr Op opArith }
func (*ArithmeticExpr) CachedSize ¶ added in v0.13.0
func (cached *ArithmeticExpr) CachedSize(alloc bool) int64
type BinaryExpr ¶
type BinaryExpr struct {
Left, Right IR
}
func (*BinaryExpr) CachedSize ¶ added in v0.13.0
func (cached *BinaryExpr) CachedSize(alloc bool) int64
type BindVariable ¶
type BindVariable struct { Key string Type sqltypes.Type Collation collations.ID // contains filtered or unexported fields }
func NewBindVar ¶ added in v0.8.0
func NewBindVar(key string, typ Type) *BindVariable
NewBindVar returns a bind variable
func NewBindVarTuple ¶ added in v0.17.0
func NewBindVarTuple(key string, coll collations.ID) *BindVariable
NewBindVarTuple returns a bind variable containing a tuple
func (*BindVariable) CachedSize ¶ added in v0.10.0
func (cached *BindVariable) CachedSize(alloc bool) int64
func (*BindVariable) Format ¶ added in v0.19.0
func (bv *BindVariable) Format(buf *sqlparser.TrackedBuffer)
func (*BindVariable) FormatFast ¶ added in v0.19.0
func (bv *BindVariable) FormatFast(buf *sqlparser.TrackedBuffer)
func (*BindVariable) IR ¶ added in v0.19.0
func (bv *BindVariable) IR() IR
func (*BindVariable) IsExpr ¶ added in v0.19.0
func (bv *BindVariable) IsExpr()
type BitwiseExpr ¶ added in v0.14.0
type BitwiseExpr struct { BinaryExpr Op opBit }
func (*BitwiseExpr) CachedSize ¶ added in v0.14.0
func (cached *BitwiseExpr) CachedSize(alloc bool) int64
type BitwiseNotExpr ¶ added in v0.14.0
type BitwiseNotExpr struct {
UnaryExpr
}
func (*BitwiseNotExpr) CachedSize ¶ added in v0.14.0
func (cached *BitwiseNotExpr) CachedSize(alloc bool) int64
type CallExpr ¶ added in v0.13.0
func (*CallExpr) CachedSize ¶ added in v0.13.0
type CaseExpr ¶ added in v0.14.0
type CaseExpr struct { Else IR // contains filtered or unexported fields }
func (*CaseExpr) CachedSize ¶ added in v0.14.0
type CollateExpr ¶ added in v0.13.0
type CollateExpr struct { UnaryExpr TypedCollation collations.TypedCollation CollationEnv *collations.Environment }
func (*CollateExpr) CachedSize ¶ added in v0.13.0
func (cached *CollateExpr) CachedSize(alloc bool) int64
type Column ¶
type Column struct { Offset int Type sqltypes.Type Size int32 Scale int32 Collation collations.TypedCollation Original sqlparser.Expr Nullable bool // contains filtered or unexported fields }
func (*Column) CachedSize ¶ added in v0.10.0
func (*Column) Format ¶ added in v0.19.0
func (c *Column) Format(buf *sqlparser.TrackedBuffer)
func (*Column) FormatFast ¶ added in v0.19.0
func (c *Column) FormatFast(buf *sqlparser.TrackedBuffer)
type ColumnResolver ¶ added in v0.17.0
type Comparison ¶ added in v0.19.0
type Comparison []OrderByParams
OrderByParams specifies the parameters for ordering. This is used for merge-sorting scatter queries.
func (Comparison) ApplyTinyWeights ¶ added in v0.19.0
func (cmp Comparison) ApplyTinyWeights(out *sqltypes.Result)
func (Comparison) Sort ¶ added in v0.19.0
func (cmp Comparison) Sort(out []sqltypes.Row)
func (Comparison) SortResult ¶ added in v0.19.0
func (cmp Comparison) SortResult(out *sqltypes.Result) (err error)
type ComparisonExpr ¶ added in v0.13.0
type ComparisonExpr struct { BinaryExpr Op ComparisonOp }
func (*ComparisonExpr) CachedSize ¶ added in v0.13.0
func (cached *ComparisonExpr) CachedSize(alloc bool) int64
type ComparisonOp ¶ added in v0.13.0
type ComparisonOp interface { String() string // contains filtered or unexported methods }
type CompiledExpr ¶ added in v0.17.0
type CompiledExpr struct {
// contains filtered or unexported fields
}
func (*CompiledExpr) CachedSize ¶ added in v0.17.0
func (cached *CompiledExpr) CachedSize(alloc bool) int64
func (*CompiledExpr) Format ¶ added in v0.19.0
func (p *CompiledExpr) Format(buf *sqlparser.TrackedBuffer)
func (*CompiledExpr) FormatFast ¶ added in v0.19.0
func (p *CompiledExpr) FormatFast(buf *sqlparser.TrackedBuffer)
func (*CompiledExpr) IR ¶ added in v0.19.0
func (c *CompiledExpr) IR() IR
func (*CompiledExpr) IsExpr ¶ added in v0.19.0
func (c *CompiledExpr) IsExpr()
type CompilerLog ¶ added in v0.17.0
type Config ¶ added in v0.17.0
type Config struct { ResolveColumn ColumnResolver ResolveType TypeResolver Collation collations.ID NoConstantFolding bool NoCompilation bool SQLMode SQLMode Environment *vtenv.Environment }
type ConvertExpr ¶ added in v0.14.0
type ConvertExpr struct { UnaryExpr Type string Length, Scale *int Collation collations.ID CollationEnv *collations.Environment }
func (*ConvertExpr) CachedSize ¶ added in v0.14.0
func (cached *ConvertExpr) CachedSize(alloc bool) int64
type ConvertUsingExpr ¶ added in v0.14.0
type ConvertUsingExpr struct { UnaryExpr Collation collations.ID CollationEnv *collations.Environment }
func (*ConvertUsingExpr) CachedSize ¶ added in v0.14.0
func (cached *ConvertUsingExpr) CachedSize(alloc bool) int64
type EvalResult ¶
type EvalResult struct {
// contains filtered or unexported fields
}
func (EvalResult) Collation ¶ added in v0.14.0
func (er EvalResult) Collation() collations.ID
func (EvalResult) MustBoolean ¶ added in v0.15.0
func (er EvalResult) MustBoolean() bool
func (EvalResult) String ¶ added in v0.14.0
func (er EvalResult) String() string
func (EvalResult) ToBoolean ¶ added in v0.15.5
func (er EvalResult) ToBoolean() bool
func (EvalResult) ToBooleanStrict ¶ added in v0.8.0
func (er EvalResult) ToBooleanStrict() (bool, error)
ToBooleanStrict is used when the casting to a boolean has to be minimally forgiving, such as when assigning to a system variable that is expected to be a boolean
func (EvalResult) TupleValues ¶ added in v0.13.0
func (er EvalResult) TupleValues() []sqltypes.Value
TupleValues allows for retrieval of the value we expose for public consumption
func (EvalResult) Value ¶
func (er EvalResult) Value(id collations.ID) sqltypes.Value
Value allows for retrieval of the value we expose for public consumption. It will be converted to the passed in collation which is the connection collation and what the client expects the result to be in.
type ExpressionEnv ¶
type ExpressionEnv struct { BindVars map[string]*querypb.BindVariable Row []sqltypes.Value Fields []*querypb.Field // contains filtered or unexported fields }
ExpressionEnv contains the environment that the expression evaluates in, such as the current row and bindvars
func EmptyExpressionEnv ¶ added in v0.13.0
func EmptyExpressionEnv(env *vtenv.Environment) *ExpressionEnv
EmptyExpressionEnv returns a new ExpressionEnv with no bind vars or row
func NewExpressionEnv ¶ added in v0.17.0
func NewExpressionEnv(ctx context.Context, bindVars map[string]*querypb.BindVariable, vc VCursor) *ExpressionEnv
NewExpressionEnv returns an expression environment with no current row, but with bindvars
func (*ExpressionEnv) Evaluate ¶ added in v0.13.0
func (env *ExpressionEnv) Evaluate(expr Expr) (EvalResult, error)
func (*ExpressionEnv) EvaluateAST ¶ added in v0.19.0
func (env *ExpressionEnv) EvaluateAST(expr Expr) (EvalResult, error)
func (*ExpressionEnv) EvaluateVM ¶ added in v0.17.0
func (env *ExpressionEnv) EvaluateVM(p *CompiledExpr) (EvalResult, error)
func (*ExpressionEnv) SetTime ¶ added in v0.19.0
func (env *ExpressionEnv) SetTime(now time.Time)
func (*ExpressionEnv) TypeOf ¶ added in v0.13.0
func (env *ExpressionEnv) TypeOf(expr Expr) (Type, error)
func (*ExpressionEnv) VCursor ¶ added in v0.19.0
func (env *ExpressionEnv) VCursor() VCursor
type FieldResolver ¶ added in v0.17.0
type FilterExpr ¶ added in v0.17.0
type FilterExpr interface { BinaryExpr // contains filtered or unexported methods }
type HashCode ¶ added in v0.13.0
type HashCode = uint64
HashCode is a type alias to the code easier to read
func NullsafeHashcode ¶ added in v0.9.0
func NullsafeHashcode(v sqltypes.Value, collation collations.ID, coerceType sqltypes.Type, sqlmode SQLMode) (HashCode, error)
NullsafeHashcode returns an int64 hashcode that is guaranteed to be the same for two values that are considered equal by `NullsafeCompare`.
type IR ¶ added in v0.19.0
type IR interface {
// contains filtered or unexported methods
}
IR is the interface that all evaluation nodes must implement. It can only be used to match the AST of the compiled expression for planning purposes. IR objects cannot be evaluated directly.
type InExpr ¶ added in v0.13.0
type InExpr struct { BinaryExpr Negate bool }
func (*InExpr) CachedSize ¶ added in v0.13.0
type IntervalExpr ¶ added in v0.17.0
type IntervalExpr struct {
CallExpr
}
func (*IntervalExpr) CachedSize ¶ added in v0.17.0
func (cached *IntervalExpr) CachedSize(alloc bool) int64
type IntroducerExpr ¶ added in v0.17.2
type IntroducerExpr struct { UnaryExpr TypedCollation collations.TypedCollation CollationEnv *collations.Environment }
func (*IntroducerExpr) CachedSize ¶ added in v0.17.2
func (cached *IntroducerExpr) CachedSize(alloc bool) int64
type IsExpr ¶ added in v0.13.0
type IsExpr struct { UnaryExpr Op sqlparser.IsExprOperator Check func(eval) bool }
IsExpr represents the IS expression in MySQL. boolean_primary IS [NOT] {TRUE | FALSE | NULL}
func (*IsExpr) CachedSize ¶ added in v0.13.0
type LikeExpr ¶ added in v0.13.0
type LikeExpr struct { BinaryExpr Negate bool Match colldata.WildcardPattern MatchCollation collations.ID }
func (*LikeExpr) CachedSize ¶ added in v0.13.0
type Literal ¶
type Literal struct {
// contains filtered or unexported fields
}
func NewLiteralBinary ¶ added in v0.14.0
func NewLiteralBinaryFromBit ¶ added in v0.17.0
func NewLiteralBinaryFromHex ¶ added in v0.13.0
func NewLiteralBinaryFromHexNum ¶ added in v0.13.0
func NewLiteralBool ¶ added in v0.17.0
func NewLiteralDateFromBytes ¶ added in v0.15.0
NewLiteralDateFromBytes returns a literal expression.
func NewLiteralDatetimeFromBytes ¶ added in v0.15.0
NewLiteralDatetimeFromBytes returns a literal expression. it validates the datetime by parsing it and checking the error.
func NewLiteralDecimalFromBytes ¶ added in v0.13.0
func NewLiteralFloat ¶
NewLiteralFloat returns a literal expression
func NewLiteralFloatFromBytes ¶ added in v0.13.0
NewLiteralFloatFromBytes returns a float literal expression from a slice of bytes
func NewLiteralInt ¶
NewLiteralInt returns a literal expression
func NewLiteralIntegralFromBytes ¶ added in v0.13.0
NewLiteralIntegralFromBytes returns a literal expression. It tries to return an int64, but if the value is too large, it tries with an uint64
func NewLiteralString ¶
func NewLiteralString(val []byte, collation collations.TypedCollation) *Literal
NewLiteralString returns a literal expression
func NewLiteralTimeFromBytes ¶ added in v0.15.0
NewLiteralTimeFromBytes returns a literal expression. it validates the time by parsing it and checking the error.
func NewLiteralUint ¶ added in v0.13.0
NewLiteralUint returns a literal expression
func (*Literal) CachedSize ¶ added in v0.10.0
func (*Literal) Format ¶ added in v0.19.0
func (l *Literal) Format(buf *sqlparser.TrackedBuffer)
func (*Literal) FormatFast ¶ added in v0.19.0
func (l *Literal) FormatFast(buf *sqlparser.TrackedBuffer)
type LogicalExpr ¶ added in v0.13.0
type LogicalExpr struct { BinaryExpr // contains filtered or unexported fields }
func (*LogicalExpr) CachedSize ¶ added in v0.13.0
func (cached *LogicalExpr) CachedSize(alloc bool) int64
type Merger ¶ added in v0.19.0
type Merger struct { Compare Comparison // contains filtered or unexported fields }
type MinMax ¶ added in v0.18.0
type MinMax interface { Min(value sqltypes.Value) error Max(value sqltypes.Value) error Result() sqltypes.Value Reset() }
MinMax implements a MIN() or MAX() aggregation
func NewAggregationMinMax ¶ added in v0.18.0
func NewAggregationMinMax(typ sqltypes.Type, collationEnv *collations.Environment, collation collations.ID) MinMax
type NegateExpr ¶ added in v0.13.0
type NegateExpr struct {
UnaryExpr
}
func (*NegateExpr) CachedSize ¶ added in v0.13.1
func (cached *NegateExpr) CachedSize(alloc bool) int64
type NotExpr ¶ added in v0.13.0
type NotExpr struct {
UnaryExpr
}
func (*NotExpr) CachedSize ¶ added in v0.13.0
type OrderByParams ¶ added in v0.19.0
type OrderByParams struct { Col int // WeightStringCol is the weight_string column that will be used for sorting. // It is set to -1 if such a column is not added to the query WeightStringCol int Desc bool // Type for knowing if the collation is relevant Type Type CollationEnv *collations.Environment }
OrderByParams specifies the parameters for ordering. This is used for merge-sorting scatter queries.
func (*OrderByParams) CachedSize ¶ added in v0.19.0
func (cached *OrderByParams) CachedSize(alloc bool) int64
func (*OrderByParams) Compare ¶ added in v0.19.0
func (obp *OrderByParams) Compare(r1, r2 []sqltypes.Value) int
func (*OrderByParams) String ¶ added in v0.19.0
func (obp *OrderByParams) String() string
String returns a string. Used for plan descriptions
type SQLMode ¶ added in v0.19.0
type SQLMode uint32
func ParseSQLMode ¶ added in v0.19.0
func (SQLMode) AllowZeroDate ¶ added in v0.19.0
type Sorter ¶ added in v0.19.0
type Sorter struct { Compare Comparison Limit int // contains filtered or unexported fields }
type Sum ¶ added in v0.18.0
Sum implements a SUM() aggregation
func NewAggregationSum ¶ added in v0.18.0
func NewSumOfCounts ¶ added in v0.18.0
func NewSumOfCounts() Sum
type TupleBindVariable ¶ added in v0.19.0
type TupleBindVariable struct { Key string Index int Type sqltypes.Type Collation collations.ID // contains filtered or unexported fields }
func (*TupleBindVariable) CachedSize ¶ added in v0.19.0
func (cached *TupleBindVariable) CachedSize(alloc bool) int64
func (*TupleBindVariable) Format ¶ added in v0.19.0
func (bv *TupleBindVariable) Format(buf *sqlparser.TrackedBuffer)
func (*TupleBindVariable) FormatFast ¶ added in v0.19.0
func (bv *TupleBindVariable) FormatFast(buf *sqlparser.TrackedBuffer)
func (*TupleBindVariable) IR ¶ added in v0.19.0
func (bv *TupleBindVariable) IR() IR
func (*TupleBindVariable) IsExpr ¶ added in v0.19.0
func (bv *TupleBindVariable) IsExpr()
type TupleExpr ¶ added in v0.13.0
type TupleExpr []IR
func NewTupleExpr ¶ added in v0.13.0
NewTupleExpr returns a tuple expression
func (TupleExpr) Format ¶ added in v0.19.0
func (tuple TupleExpr) Format(buf *sqlparser.TrackedBuffer)
func (TupleExpr) FormatFast ¶ added in v0.19.0
func (tuple TupleExpr) FormatFast(buf *sqlparser.TrackedBuffer)
type Type ¶ added in v0.19.0
type Type struct {
// contains filtered or unexported fields
}
func AggregateEvalTypes ¶ added in v0.19.0
func AggregateEvalTypes(types []Type, env *collations.Environment) (Type, error)
func CoerceTypes ¶ added in v0.19.0
func CoerceTypes(v1, v2 Type, collationEnv *collations.Environment) (out Type, err error)
CoerceTypes takes two input types, and decides how they should be coerced before compared
func (*Type) Collation ¶ added in v0.19.0
func (t *Type) Collation() collations.ID
type UnaryExpr ¶ added in v0.13.0
type UnaryExpr struct {
Inner IR
}
func (*UnaryExpr) CachedSize ¶ added in v0.13.0
type UnsupportedCollationError ¶ added in v0.13.0
type UnsupportedCollationError struct {
ID collations.ID
}
UnsupportedCollationError represents the error where the comparison using provided collation is unsupported on vitess
func (UnsupportedCollationError) Error ¶ added in v0.13.0
func (err UnsupportedCollationError) Error() string
Error function implements the error interface
type UntypedExpr ¶ added in v0.19.0
type UntypedExpr struct {
// contains filtered or unexported fields
}
UntypedExpr is a translated expression that cannot be compiled ahead of time because it contains dynamic types.
func (*UntypedExpr) CachedSize ¶ added in v0.19.0
func (cached *UntypedExpr) CachedSize(alloc bool) int64
func (*UntypedExpr) Compile ¶ added in v0.19.0
func (u *UntypedExpr) Compile(env *ExpressionEnv) (*CompiledExpr, error)
func (*UntypedExpr) Format ¶ added in v0.19.0
func (u *UntypedExpr) Format(buf *sqlparser.TrackedBuffer)
func (*UntypedExpr) FormatFast ¶ added in v0.19.0
func (u *UntypedExpr) FormatFast(buf *sqlparser.TrackedBuffer)
func (*UntypedExpr) IR ¶ added in v0.19.0
func (u *UntypedExpr) IR() IR
func (*UntypedExpr) IsExpr ¶ added in v0.19.0
func (u *UntypedExpr) IsExpr()
type VCursor ¶ added in v0.17.0
type VCursor interface { TimeZone() *time.Location GetKeyspace() string SQLMode() string Environment() *vtenv.Environment }
func NewEmptyVCursor ¶ added in v0.19.0
func NewEmptyVCursor(env *vtenv.Environment, tz *time.Location) VCursor
Source Files ¶
- api_aggregation.go
- api_arithmetic.go
- api_coerce.go
- api_compare.go
- api_hash.go
- api_literal.go
- api_type_aggregation.go
- arena.go
- arithmetic.go
- cached_size.go
- collation.go
- compare.go
- compiler.go
- compiler_asm.go
- compiler_asm_push.go
- compiler_fn.go
- eval.go
- eval_bytes.go
- eval_json.go
- eval_numeric.go
- eval_result.go
- eval_temporal.go
- eval_tuple.go
- expr.go
- expr_arithmetic.go
- expr_bit.go
- expr_bvar.go
- expr_call.go
- expr_collate.go
- expr_column.go
- expr_compare.go
- expr_convert.go
- expr_env.go
- expr_literal.go
- expr_logical.go
- expr_tuple.go
- expr_tuple_bvar.go
- fn_base64.go
- fn_bit.go
- fn_compare.go
- fn_crypto.go
- fn_hex.go
- fn_info.go
- fn_json.go
- fn_misc.go
- fn_numeric.go
- fn_regexp.go
- fn_string.go
- fn_time.go
- format.go
- translate.go
- translate_builtin.go
- translate_card.go
- translate_convert.go
- translate_simplify.go
- vm.go
- weights.go