Versions in this module Expand all Collapse all v1 v1.0.0 Oct 16, 2017 Changes in this version + const SHA0 + const SHA224 + const SHA256 + const SHA384 + const SHA512 + var ErrDivisionByZero = terror.ClassExpression.New(mysql.ErrDivisionByZero, mysql.MySQLErrName[mysql.ErrDivisionByZero]) + var ErrIncorrectParameterCount = terror.ClassExpression.New(mysql.ErrWrongParamcountToNativeFct, ...) + var EvalAstExpr func(expr ast.ExprNode, ctx context.Context) (types.Datum, error) + var MaxPropagateColsCnt = 100 + var Null = &Constant + var One = &Constant + var UnCacheableFunctions = map[string]struct + var Zero = &Constant + func EvalBool(exprList CNFExprs, row []types.Datum, ctx context.Context) (bool, error) + func ExplainColumnList(cols []*Column) []byte + func ExplainExpressionList(exprs []Expression) []byte + func ExprFromSchema(expr Expression, schema *Schema) bool + func ExpressionsToPB(sc *variable.StatementContext, exprs []Expression, client kv.Client) (pbExpr *tipb.Expr, pushed []Expression, remained []Expression) + func ExpressionsToPBList(sc *variable.StatementContext, exprs []Expression, client kv.Client) (pbExpr []*tipb.Expr) + func GetTimeValue(ctx context.Context, v interface{}, tp byte, fsp int) (d types.Datum, err error) + func GroupByItemToPB(sc *variable.StatementContext, client kv.Client, expr Expression) *tipb.ByItem + func IsCurrentTimestampExpr(e ast.ExprNode) bool + func IsHybridType(expr Expression) bool + func SetBinFlagOrBinStr(argTp *types.FieldType, resTp *types.FieldType) + func SortByItemToPB(sc *variable.StatementContext, client kv.Client, expr Expression, desc bool) *tipb.ByItem + type Assignment struct + Col *Column + Expr Expression + type CNFExprs []Expression + func (e CNFExprs) Clone() CNFExprs + type Column struct + ColName model.CIStr + DBName model.CIStr + FromID int + ID int64 + Index int + IsAggOrSubq bool + OrigTblName model.CIStr + Position int + RetType *types.FieldType + TblName model.CIStr + func ColInfo2Col(cols []*Column, col *model.ColumnInfo) *Column + func ColumnInfos2Columns(tblName model.CIStr, colInfos []*model.ColumnInfo) []*Column + func ColumnInfos2ColumnsWithDBName(dbName, tblName model.CIStr, colInfos []*model.ColumnInfo) []*Column + func ExtractColumns(expr Expression) (cols []*Column) + func IndexInfo2Cols(cols []*Column, index *model.IndexInfo) ([]*Column, []int) + func (col *Column) Clone() Expression + func (col *Column) Decorrelate(_ *Schema) Expression + func (col *Column) Equal(expr Expression, _ context.Context) bool + func (col *Column) Eval(row []types.Datum) (types.Datum, error) + func (col *Column) EvalDecimal(row []types.Datum, sc *variable.StatementContext) (*types.MyDecimal, bool, error) + func (col *Column) EvalDuration(row []types.Datum, sc *variable.StatementContext) (types.Duration, bool, error) + func (col *Column) EvalInt(row []types.Datum, sc *variable.StatementContext) (int64, bool, error) + func (col *Column) EvalJSON(row []types.Datum, sc *variable.StatementContext) (json.JSON, bool, error) + func (col *Column) EvalReal(row []types.Datum, sc *variable.StatementContext) (float64, bool, error) + func (col *Column) EvalString(row []types.Datum, sc *variable.StatementContext) (string, bool, error) + func (col *Column) EvalTime(row []types.Datum, sc *variable.StatementContext) (types.Time, bool, error) + func (col *Column) GetType() *types.FieldType + func (col *Column) HashCode() []byte + func (col *Column) IsCorrelated() bool + func (col *Column) MarshalJSON() ([]byte, error) + func (col *Column) ResolveIndices(schema *Schema) + func (col *Column) String() string + func (expr *Column) ExplainInfo() string + type Constant struct + RetType *types.FieldType + Value types.Datum + func (c *Constant) Clone() Expression + func (c *Constant) Decorrelate(_ *Schema) Expression + func (c *Constant) Equal(b Expression, ctx context.Context) bool + func (c *Constant) Eval(_ []types.Datum) (types.Datum, error) + func (c *Constant) EvalDecimal(_ []types.Datum, sc *variable.StatementContext) (*types.MyDecimal, bool, error) + func (c *Constant) EvalDuration(_ []types.Datum, sc *variable.StatementContext) (val types.Duration, isNull bool, err error) + func (c *Constant) EvalInt(_ []types.Datum, sc *variable.StatementContext) (int64, bool, error) + func (c *Constant) EvalJSON(_ []types.Datum, sc *variable.StatementContext) (json.JSON, bool, error) + func (c *Constant) EvalReal(_ []types.Datum, sc *variable.StatementContext) (float64, bool, error) + func (c *Constant) EvalString(_ []types.Datum, sc *variable.StatementContext) (string, bool, error) + func (c *Constant) EvalTime(_ []types.Datum, sc *variable.StatementContext) (val types.Time, isNull bool, err error) + func (c *Constant) GetType() *types.FieldType + func (c *Constant) HashCode() []byte + func (c *Constant) IsCorrelated() bool + func (c *Constant) MarshalJSON() ([]byte, error) + func (c *Constant) ResolveIndices(_ *Schema) + func (c *Constant) String() string + func (expr *Constant) ExplainInfo() string + type CorrelatedColumn struct + Data *types.Datum + func (col *CorrelatedColumn) Clone() Expression + func (col *CorrelatedColumn) Decorrelate(schema *Schema) Expression + func (col *CorrelatedColumn) Equal(expr Expression, ctx context.Context) bool + func (col *CorrelatedColumn) Eval(row []types.Datum) (types.Datum, error) + func (col *CorrelatedColumn) EvalDecimal(row []types.Datum, sc *variable.StatementContext) (*types.MyDecimal, bool, error) + func (col *CorrelatedColumn) EvalDuration(row []types.Datum, sc *variable.StatementContext) (types.Duration, bool, error) + func (col *CorrelatedColumn) EvalInt(row []types.Datum, sc *variable.StatementContext) (int64, bool, error) + func (col *CorrelatedColumn) EvalJSON(row []types.Datum, sc *variable.StatementContext) (json.JSON, bool, error) + func (col *CorrelatedColumn) EvalReal(row []types.Datum, sc *variable.StatementContext) (float64, bool, error) + func (col *CorrelatedColumn) EvalString(row []types.Datum, sc *variable.StatementContext) (string, bool, error) + func (col *CorrelatedColumn) EvalTime(row []types.Datum, sc *variable.StatementContext) (types.Time, bool, error) + func (col *CorrelatedColumn) IsCorrelated() bool + func (col *CorrelatedColumn) ResolveIndices(_ *Schema) + type Expression interface + Clone func() Expression + Decorrelate func(schema *Schema) Expression + Equal func(e Expression, ctx context.Context) bool + Eval func(row []types.Datum) (types.Datum, error) + EvalDecimal func(row []types.Datum, sc *variable.StatementContext) (val *types.MyDecimal, isNull bool, err error) + EvalDuration func(row []types.Datum, sc *variable.StatementContext) (val types.Duration, isNull bool, err error) + EvalInt func(row []types.Datum, sc *variable.StatementContext) (val int64, isNull bool, err error) + EvalJSON func(row []types.Datum, sc *variable.StatementContext) (val json.JSON, isNull bool, err error) + EvalReal func(row []types.Datum, sc *variable.StatementContext) (val float64, isNull bool, err error) + EvalString func(row []types.Datum, sc *variable.StatementContext) (val string, isNull bool, err error) + EvalTime func(row []types.Datum, sc *variable.StatementContext) (val types.Time, isNull bool, err error) + ExplainInfo func() string + GetType func() *types.FieldType + HashCode func() []byte + IsCorrelated func() bool + ResolveIndices func(schema *Schema) + func BuildCastFunction(ctx context.Context, expr Expression, tp *types.FieldType) (res Expression) + func Column2Exprs(cols []*Column) []Expression + func ColumnSubstitute(expr Expression, schema *Schema, newExprs []Expression) Expression + func ComposeCNFCondition(ctx context.Context, conditions ...Expression) Expression + func ComposeDNFCondition(ctx context.Context, conditions ...Expression) Expression + func ConvertCol2CorCol(cond Expression, corCols []*CorrelatedColumn, outerSchema *Schema) Expression + func EvaluateExprWithNull(ctx context.Context, schema *Schema, expr Expression) (Expression, error) + func FoldConstant(expr Expression) Expression + func NewFunction(ctx context.Context, funcName string, retType *types.FieldType, ...) (Expression, error) + func NewFunctionInternal(ctx context.Context, funcName string, retType *types.FieldType, ...) Expression + func PBToExpr(expr *tipb.Expr, tps []*types.FieldType, sc *variable.StatementContext) (Expression, error) + func PropagateConstant(ctx context.Context, conditions []Expression) []Expression + func PushDownNot(expr Expression, not bool, ctx context.Context) Expression + func ScalarFuncs2Exprs(funcs []*ScalarFunction) []Expression + func SplitCNFItems(onExpr Expression) []Expression + func SplitDNFItems(onExpr Expression) []Expression + func SubstituteCorCol2Constant(expr Expression) (Expression, error) + func WrapWithCastAsDecimal(ctx context.Context, expr Expression) Expression + func WrapWithCastAsDuration(ctx context.Context, expr Expression) Expression + func WrapWithCastAsInt(ctx context.Context, expr Expression) Expression + func WrapWithCastAsJSON(ctx context.Context, expr Expression) Expression + func WrapWithCastAsReal(ctx context.Context, expr Expression) Expression + func WrapWithCastAsString(ctx context.Context, expr Expression) Expression + func WrapWithCastAsTime(ctx context.Context, expr Expression, tp *types.FieldType) Expression + type KeyInfo []*Column + func (ki KeyInfo) Clone() KeyInfo + type PbConverter struct + func NewPBConverter(client kv.Client, sc *variable.StatementContext) PbConverter + func (pc PbConverter) ExprToPB(expr Expression) *tipb.Expr + type ScalarFunction struct + FuncName model.CIStr + Function builtinFunc + RetType *types.FieldType + func NewValuesFunc(offset int, retTp *types.FieldType, ctx context.Context) *ScalarFunction + func (expr *ScalarFunction) ExplainInfo() string + func (sf *ScalarFunction) Clone() Expression + func (sf *ScalarFunction) Decorrelate(schema *Schema) Expression + func (sf *ScalarFunction) Equal(e Expression, ctx context.Context) bool + func (sf *ScalarFunction) Eval(row []types.Datum) (d types.Datum, err error) + func (sf *ScalarFunction) EvalDecimal(row []types.Datum, sc *variable.StatementContext) (*types.MyDecimal, bool, error) + func (sf *ScalarFunction) EvalDuration(row []types.Datum, sc *variable.StatementContext) (types.Duration, bool, error) + func (sf *ScalarFunction) EvalInt(row []types.Datum, sc *variable.StatementContext) (int64, bool, error) + func (sf *ScalarFunction) EvalJSON(row []types.Datum, sc *variable.StatementContext) (json.JSON, bool, error) + func (sf *ScalarFunction) EvalReal(row []types.Datum, sc *variable.StatementContext) (float64, bool, error) + func (sf *ScalarFunction) EvalString(row []types.Datum, sc *variable.StatementContext) (string, bool, error) + func (sf *ScalarFunction) EvalTime(row []types.Datum, sc *variable.StatementContext) (types.Time, bool, error) + func (sf *ScalarFunction) GetArgs() []Expression + func (sf *ScalarFunction) GetCtx() context.Context + func (sf *ScalarFunction) GetType() *types.FieldType + func (sf *ScalarFunction) HashCode() []byte + func (sf *ScalarFunction) IsCorrelated() bool + func (sf *ScalarFunction) MarshalJSON() ([]byte, error) + func (sf *ScalarFunction) ResolveIndices(schema *Schema) + func (sf *ScalarFunction) String() string + type Schema struct + Columns []*Column + Keys []KeyInfo + MaxOneRow bool + TblID2Handle map[int64][]*Column + func MergeSchema(lSchema, rSchema *Schema) *Schema + func NewSchema(cols ...*Column) *Schema + func TableInfo2Schema(tbl *model.TableInfo) *Schema + func TableInfo2SchemaWithDBName(dbName model.CIStr, tbl *model.TableInfo) *Schema + func (s *Schema) Append(col ...*Column) + func (s *Schema) Clone() *Schema + func (s *Schema) ColumnIndex(col *Column) int + func (s *Schema) ColumnsByIndices(offsets []int) []*Column + func (s *Schema) ColumnsIndices(cols []*Column) (ret []int) + func (s *Schema) Contains(col *Column) bool + func (s *Schema) FindColumn(astCol *ast.ColumnName) (*Column, error) + func (s *Schema) FindColumnAndIndex(astCol *ast.ColumnName) (*Column, int, error) + func (s *Schema) IsUniqueKey(col *Column) bool + func (s *Schema) Len() int + func (s *Schema) RetrieveColumn(col *Column) *Column + func (s *Schema) SetUniqueKeys(keys []KeyInfo) + func (s *Schema) String() string + type VarAssignment struct + Expr Expression + ExtendValue *Constant + IsDefault bool + IsGlobal bool + IsSystem bool + Name string