sessionexpr

package
v1.1.0-beta.0...-a97aa45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvalContext

type EvalContext struct {
	// contains filtered or unexported fields
}

EvalContext implements the `expression.EvalContext` interface to provide evaluation context in session.

func NewEvalContext

func NewEvalContext(sctx sessionctx.Context) *EvalContext

NewEvalContext creates a new EvalContext.

func (*EvalContext) AllParamValues

func (ctx *EvalContext) AllParamValues() []types.Datum

AllParamValues implements context.StaticConvertibleEvalContext.

func (*EvalContext) AppendWarning

func (ctx *EvalContext) AppendWarning(err error)

AppendWarning append warnings to the context.

func (*EvalContext) CopyWarnings

func (ctx *EvalContext) CopyWarnings(dst []contextutil.SQLWarn) []contextutil.SQLWarn

CopyWarnings copies the warnings to dst

func (*EvalContext) CtxID

func (ctx *EvalContext) CtxID() uint64

CtxID returns the context id.

func (*EvalContext) CurrentDB

func (ctx *EvalContext) CurrentDB() string

CurrentDB returns the current database name

func (*EvalContext) CurrentTime

func (ctx *EvalContext) CurrentTime() (time.Time, error)

CurrentTime returns the current time

func (*EvalContext) ErrCtx

func (ctx *EvalContext) ErrCtx() errctx.Context

ErrCtx returns the errctx.Context

func (*EvalContext) GetDefaultWeekFormatMode

func (ctx *EvalContext) GetDefaultWeekFormatMode() string

GetDefaultWeekFormatMode returns the value of the 'default_week_format' system variable.

func (*EvalContext) GetDivPrecisionIncrement

func (ctx *EvalContext) GetDivPrecisionIncrement() int

GetDivPrecisionIncrement returns the specified value of DivPrecisionIncrement.

func (*EvalContext) GetDynamicPrivCheckFn

func (ctx *EvalContext) GetDynamicPrivCheckFn() func(privName string, grantable bool) bool

GetDynamicPrivCheckFn implements context.StaticConvertibleEvalContext.

func (*EvalContext) GetMaxAllowedPacket

func (ctx *EvalContext) GetMaxAllowedPacket() uint64

GetMaxAllowedPacket returns the value of the 'max_allowed_packet' system variable.

func (*EvalContext) GetOptionalPropProvider

func (ctx *EvalContext) GetOptionalPropProvider(key exprctx.OptionalEvalPropKey) (exprctx.OptionalEvalPropProvider, bool)

GetOptionalPropProvider gets the optional property provider by key

func (*EvalContext) GetOptionalPropSet

func (ctx *EvalContext) GetOptionalPropSet() exprctx.OptionalEvalPropKeySet

GetOptionalPropSet gets the optional property set from context

func (*EvalContext) GetParamValue

func (ctx *EvalContext) GetParamValue(idx int) (types.Datum, error)

GetParamValue returns the value of the parameter by index.

func (*EvalContext) GetRequestVerificationFn

func (ctx *EvalContext) GetRequestVerificationFn() func(db string, table string, column string, priv mysql.PrivilegeType) bool

GetRequestVerificationFn implements context.StaticConvertibleEvalContext.

func (*EvalContext) GetTiDBRedactLog

func (ctx *EvalContext) GetTiDBRedactLog() string

GetTiDBRedactLog returns the value of the 'tidb_redact_log' system variable.

func (*EvalContext) GetUserVarsReader

func (ctx *EvalContext) GetUserVarsReader() variable.UserVarsReader

GetUserVarsReader returns the user variables.

func (*EvalContext) GetWarnHandler

func (ctx *EvalContext) GetWarnHandler() contextutil.WarnHandler

GetWarnHandler implements context.StaticConvertibleEvalContext.

func (*EvalContext) IntoStatic

func (ctx *EvalContext) IntoStatic() *exprstatic.EvalContext

IntoStatic turns the EvalContext into a EvalContext.

func (*EvalContext) Location

func (ctx *EvalContext) Location() *time.Location

Location returns the timezone info

func (*EvalContext) RequestDynamicVerification

func (ctx *EvalContext) RequestDynamicVerification(privName string, grantable bool) bool

RequestDynamicVerification verifies user privilege for a DYNAMIC privilege.

func (*EvalContext) RequestVerification

func (ctx *EvalContext) RequestVerification(db, table, column string, priv mysql.PrivilegeType) bool

RequestVerification verifies user privilege

func (*EvalContext) SQLMode

func (ctx *EvalContext) SQLMode() mysql.SQLMode

SQLMode returns the sql mode

func (*EvalContext) Sctx

func (ctx *EvalContext) Sctx() sessionctx.Context

Sctx returns the innert session context

func (*EvalContext) TruncateWarnings

func (ctx *EvalContext) TruncateWarnings(start int) []contextutil.SQLWarn

TruncateWarnings truncates warnings begin from start and returns the truncated warnings.

func (*EvalContext) TypeCtx

func (ctx *EvalContext) TypeCtx() (tc types.Context)

TypeCtx returns the types.Context

func (*EvalContext) WarningCount

func (ctx *EvalContext) WarningCount() int

WarningCount gets warning count.

type ExprContext

type ExprContext struct {
	*EvalContext
	// contains filtered or unexported fields
}

ExprContext implements `ExprContext`

func NewExprContext

func NewExprContext(sctx sessionctx.Context) *ExprContext

NewExprContext creates a new ExprContext.

func (*ExprContext) AllocPlanColumnID

func (ctx *ExprContext) AllocPlanColumnID() int64

AllocPlanColumnID allocates column id for plan.

func (*ExprContext) ConnectionID

func (ctx *ExprContext) ConnectionID() uint64

ConnectionID indicates the connection ID of the current session. If the context is not in a session, it should return 0.

func (*ExprContext) GetBlockEncryptionMode

func (ctx *ExprContext) GetBlockEncryptionMode() string

GetBlockEncryptionMode returns the variable block_encryption_mode

func (*ExprContext) GetCharsetInfo

func (ctx *ExprContext) GetCharsetInfo() (string, string)

GetCharsetInfo gets charset and collation for current context.

func (*ExprContext) GetDefaultCollationForUTF8MB4

func (ctx *ExprContext) GetDefaultCollationForUTF8MB4() string

GetDefaultCollationForUTF8MB4 returns the default collation of UTF8MB4.

func (*ExprContext) GetEvalCtx

func (ctx *ExprContext) GetEvalCtx() exprctx.EvalContext

GetEvalCtx returns the EvalContext.

func (*ExprContext) GetGroupConcatMaxLen

func (ctx *ExprContext) GetGroupConcatMaxLen() uint64

GetGroupConcatMaxLen returns the value of the 'group_concat_max_len' system variable.

func (*ExprContext) GetLastPlanColumnID

func (ctx *ExprContext) GetLastPlanColumnID() int64

GetLastPlanColumnID implements context.StaticConvertibleExprContext.

func (*ExprContext) GetNoopFuncsMode

func (ctx *ExprContext) GetNoopFuncsMode() int

GetNoopFuncsMode returns the noop function mode: OFF/ON/WARN values as 0/1/2.

func (*ExprContext) GetPlanCacheTracker

func (ctx *ExprContext) GetPlanCacheTracker() *contextutil.PlanCacheTracker

GetPlanCacheTracker implements context.StaticConvertibleExprContext.

func (*ExprContext) GetStaticConvertibleEvalContext

func (ctx *ExprContext) GetStaticConvertibleEvalContext() exprctx.StaticConvertibleEvalContext

GetStaticConvertibleEvalContext implements context.StaticConvertibleExprContext.

func (*ExprContext) GetSysdateIsNow

func (ctx *ExprContext) GetSysdateIsNow() bool

GetSysdateIsNow returns a bool to determine whether Sysdate is an alias of Now function. It is the value of variable `tidb_sysdate_is_now`.

func (*ExprContext) GetWindowingUseHighPrecision

func (ctx *ExprContext) GetWindowingUseHighPrecision() bool

GetWindowingUseHighPrecision determines whether to compute window operations without loss of precision. see https://dev.mysql.com/doc/refman/8.0/en/window-function-optimization.html for more details.

func (*ExprContext) IntoStatic

func (ctx *ExprContext) IntoStatic() *exprstatic.ExprContext

IntoStatic turns the ExprContext into a ExprContext.

func (*ExprContext) IsConstantPropagateCheck

func (ctx *ExprContext) IsConstantPropagateCheck() bool

IsConstantPropagateCheck returns whether the ctx is in constant propagate check.

func (*ExprContext) IsInNullRejectCheck

func (ctx *ExprContext) IsInNullRejectCheck() bool

IsInNullRejectCheck returns whether the expression is in null reject check.

func (*ExprContext) IsUseCache

func (ctx *ExprContext) IsUseCache() bool

IsUseCache indicates whether to cache the build expression in plan cache. If SetSkipPlanCache is invoked, it should return false.

func (*ExprContext) Rng

func (ctx *ExprContext) Rng() *mathutil.MysqlRng

Rng is used to generate random values.

func (*ExprContext) SetSkipPlanCache

func (ctx *ExprContext) SetSkipPlanCache(reason string)

SetSkipPlanCache sets to skip the plan cache and records the reason.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL