Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeArithmetic(sc *variable.StatementContext, op tipb.ExprType, left types.Datum, ...) (types.Datum, error)
- func ComputeBit(sc *variable.StatementContext, op tipb.ExprType, left, right types.Datum) (types.Datum, error)
- func FlagsToStatementContext(flags uint64) *variable.StatementContext
- type Evaluator
Constants ¶
View Source
const ( // FlagIgnoreTruncate indicates if truncate error should be ignored. // Read-only statements should ignore truncate error, write statements should not ignore truncate error. FlagIgnoreTruncate uint64 = 1 // FlagTruncateAsWarning indicates if truncate error should be returned as warning. // This flag only matters if FlagIgnoreTruncate is not set, in strict sql mode, truncate error should // be returned as error, in non-strict sql mode, truncate error should be saved as warning. FlagTruncateAsWarning uint64 = 1 << 1 )
Flags are used by tipb.SelectRequest.Flags to handle execution mode, like how to handle truncate error.
View Source
const (
CodeInvalid = 3
)
Error codes.
Variables ¶
View Source
var (
ErrInvalid = terror.ClassXEval.New(CodeInvalid, "invalid operation")
)
Error instances.
Functions ¶
func ComputeArithmetic ¶
func ComputeArithmetic(sc *variable.StatementContext, op tipb.ExprType, left types.Datum, right types.Datum) (types.Datum, error)
ComputeArithmetic computes the arithmetic operation on two datums.
func ComputeBit ¶
func ComputeBit(sc *variable.StatementContext, op tipb.ExprType, left, right types.Datum) (types.Datum, error)
ComputeBit computes the bitwise operation on two datums.
func FlagsToStatementContext ¶
func FlagsToStatementContext(flags uint64) *variable.StatementContext
FlagsToStatementContext creates a StatementContext from a `tipb.SelectRequest.Flags`.
Types ¶
type Evaluator ¶
type Evaluator struct { Row map[int64]types.Datum // column values. // contains filtered or unexported fields }
Evaluator evaluates tipb.Expr.
func NewEvaluator ¶
func NewEvaluator(sc *variable.StatementContext) *Evaluator
NewEvaluator creates a new Evaluator instance.
Click to show internal directories.
Click to hide internal directories.