Documentation ¶
Index ¶
- type AdvisoryLockContext
- type AdvisoryLockPropProvider
- type AdvisoryLockPropReader
- type CurrentUserPropProvider
- type CurrentUserPropReader
- type DDLOwnerInfoProvider
- type DDLOwnerPropReader
- type InfoSchemaPropProvider
- type InfoSchemaPropReader
- func (InfoSchemaPropReader) GetDomainInfoSchema(ctx exprctx.EvalContext) (infoschema.MetaOnlyInfoSchema, error)
- func (InfoSchemaPropReader) GetSessionInfoSchema(ctx exprctx.EvalContext) (infoschema.MetaOnlyInfoSchema, error)
- func (InfoSchemaPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet
- type KVStorePropProvider
- type KVStorePropReader
- type OptionalEvalPropProviders
- func (o *OptionalEvalPropProviders) Add(val exprctx.OptionalEvalPropProvider)
- func (o *OptionalEvalPropProviders) Contains(key exprctx.OptionalEvalPropKey) bool
- func (o *OptionalEvalPropProviders) Get(key exprctx.OptionalEvalPropKey) (exprctx.OptionalEvalPropProvider, bool)
- func (o *OptionalEvalPropProviders) PropKeySet() (set exprctx.OptionalEvalPropKeySet)
- type PrivilegeChecker
- type PrivilegeCheckerPropReader
- type PrivilegeCheckerProvider
- type RequireOptionalEvalProps
- type SQLExecutor
- type SQLExecutorPropProvider
- type SQLExecutorPropReader
- type SequenceOperator
- type SequenceOperatorPropReader
- type SequenceOperatorProvider
- type SessionVarsPropProvider
- type SessionVarsPropReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvisoryLockContext ¶
type AdvisoryLockContext interface { // GetAdvisoryLock acquires an advisory lock (aka GET_LOCK()). GetAdvisoryLock(string, int64) error // IsUsedAdvisoryLock checks for existing locks (aka IS_USED_LOCK()). IsUsedAdvisoryLock(string) uint64 // ReleaseAdvisoryLock releases an advisory lock (aka RELEASE_LOCK()). ReleaseAdvisoryLock(string) bool // ReleaseAllAdvisoryLocks releases all advisory locks that this session holds. ReleaseAllAdvisoryLocks() int }
AdvisoryLockContext is the interface to operate advisory locks
type AdvisoryLockPropProvider ¶
type AdvisoryLockPropProvider struct {
AdvisoryLockContext
}
AdvisoryLockPropProvider is a provider to provide AdvisoryLockContext.
func NewAdvisoryLockPropProvider ¶
func NewAdvisoryLockPropProvider(ctx AdvisoryLockContext) *AdvisoryLockPropProvider
NewAdvisoryLockPropProvider creates a new AdvisoryLockPropProvider
func (*AdvisoryLockPropProvider) Desc ¶
func (p *AdvisoryLockPropProvider) Desc() *exprctx.OptionalEvalPropDesc
Desc returns the description for the property key.
type AdvisoryLockPropReader ¶
type AdvisoryLockPropReader struct{}
AdvisoryLockPropReader is used by expression to operate advisory lock
func (AdvisoryLockPropReader) AdvisoryLockCtx ¶
func (r AdvisoryLockPropReader) AdvisoryLockCtx(ctx exprctx.EvalContext) (AdvisoryLockContext, error)
AdvisoryLockCtx returns the AdvisoryLockContext from the context
func (AdvisoryLockPropReader) RequiredOptionalEvalProps ¶
func (r AdvisoryLockPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet
RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.
type CurrentUserPropProvider ¶
type CurrentUserPropProvider func() (*auth.UserIdentity, []*auth.RoleIdentity)
CurrentUserPropProvider is a provider to get the current user
func (CurrentUserPropProvider) Desc ¶
func (p CurrentUserPropProvider) Desc() *exprctx.OptionalEvalPropDesc
Desc returns the description for the property key.
type CurrentUserPropReader ¶
type CurrentUserPropReader struct{}
CurrentUserPropReader is used by expression to read property context.OptPropCurrentUser
func (CurrentUserPropReader) ActiveRoles ¶
func (r CurrentUserPropReader) ActiveRoles(ctx exprctx.EvalContext) ([]*auth.RoleIdentity, error)
ActiveRoles returns the active roles
func (CurrentUserPropReader) CurrentUser ¶
func (r CurrentUserPropReader) CurrentUser(ctx exprctx.EvalContext) (*auth.UserIdentity, error)
CurrentUser returns the current user
func (CurrentUserPropReader) RequiredOptionalEvalProps ¶
func (r CurrentUserPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet
RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.
type DDLOwnerInfoProvider ¶
type DDLOwnerInfoProvider func() bool
DDLOwnerInfoProvider is used to provide the DDL owner information. It is a function to return whether the current node is ddl owner
func (DDLOwnerInfoProvider) Desc ¶
func (p DDLOwnerInfoProvider) Desc() *exprctx.OptionalEvalPropDesc
Desc returns the description for the property key.
type DDLOwnerPropReader ¶
type DDLOwnerPropReader struct{}
DDLOwnerPropReader is used by expression to get the DDL owner information.
func (DDLOwnerPropReader) IsDDLOwner ¶
func (r DDLOwnerPropReader) IsDDLOwner(ctx exprctx.EvalContext) (bool, error)
IsDDLOwner returns whether the current node is DDL owner
func (DDLOwnerPropReader) RequiredOptionalEvalProps ¶
func (r DDLOwnerPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet
RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.
type InfoSchemaPropProvider ¶
type InfoSchemaPropProvider func(isDomain bool) infoschema.MetaOnlyInfoSchema
InfoSchemaPropProvider is the function to provide information schema.
func (InfoSchemaPropProvider) Desc ¶
func (InfoSchemaPropProvider) Desc() *exprctx.OptionalEvalPropDesc
Desc returns the description for the property key.
type InfoSchemaPropReader ¶
type InfoSchemaPropReader struct{}
InfoSchemaPropReader is used to get the information schema.
func (InfoSchemaPropReader) GetDomainInfoSchema ¶
func (InfoSchemaPropReader) GetDomainInfoSchema(ctx exprctx.EvalContext) (infoschema.MetaOnlyInfoSchema, error)
GetDomainInfoSchema return domain information schema.
func (InfoSchemaPropReader) GetSessionInfoSchema ¶
func (InfoSchemaPropReader) GetSessionInfoSchema(ctx exprctx.EvalContext) (infoschema.MetaOnlyInfoSchema, error)
GetSessionInfoSchema returns session information schema.
func (InfoSchemaPropReader) RequiredOptionalEvalProps ¶
func (InfoSchemaPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet
RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.
type KVStorePropProvider ¶
KVStorePropProvider is used to provide kv.Storage for context
func (KVStorePropProvider) Desc ¶
func (KVStorePropProvider) Desc() *exprctx.OptionalEvalPropDesc
Desc returns the description for the property key.
type KVStorePropReader ¶
type KVStorePropReader struct{}
KVStorePropReader is used by expression to get kv.Storage.
func (KVStorePropReader) GetKVStore ¶
func (KVStorePropReader) GetKVStore(ctx exprctx.EvalContext) (kv.Storage, error)
GetKVStore returns a SequenceOperator.
func (KVStorePropReader) RequiredOptionalEvalProps ¶
func (KVStorePropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet
RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.
type OptionalEvalPropProviders ¶
type OptionalEvalPropProviders [exprctx.OptPropsCnt]exprctx.OptionalEvalPropProvider
OptionalEvalPropProviders contains some evaluation property providers in EvalContext.
func (*OptionalEvalPropProviders) Add ¶
func (o *OptionalEvalPropProviders) Add(val exprctx.OptionalEvalPropProvider)
Add adds an optional property
func (*OptionalEvalPropProviders) Contains ¶
func (o *OptionalEvalPropProviders) Contains(key exprctx.OptionalEvalPropKey) bool
Contains checks whether the provider by key exists.
func (*OptionalEvalPropProviders) Get ¶
func (o *OptionalEvalPropProviders) Get(key exprctx.OptionalEvalPropKey) (exprctx.OptionalEvalPropProvider, bool)
Get gets the provider by key.
func (*OptionalEvalPropProviders) PropKeySet ¶
func (o *OptionalEvalPropProviders) PropKeySet() (set exprctx.OptionalEvalPropKeySet)
PropKeySet returns the set for optional evaluation properties in EvalContext.
type PrivilegeChecker ¶
type PrivilegeChecker interface { // RequestVerification verifies user privilege RequestVerification(db, table, column string, priv mysql.PrivilegeType) bool // RequestDynamicVerification verifies user privilege for a DYNAMIC privilege. RequestDynamicVerification(privName string, grantable bool) bool }
PrivilegeChecker provides privilege check for expressions.
type PrivilegeCheckerPropReader ¶
type PrivilegeCheckerPropReader struct{}
PrivilegeCheckerPropReader is used by expression to get PrivilegeChecker.
func (PrivilegeCheckerPropReader) GetPrivilegeChecker ¶
func (PrivilegeCheckerPropReader) GetPrivilegeChecker(ctx exprctx.EvalContext) (PrivilegeChecker, error)
GetPrivilegeChecker returns a PrivilegeChecker.
func (PrivilegeCheckerPropReader) RequiredOptionalEvalProps ¶
func (PrivilegeCheckerPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet
RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.
type PrivilegeCheckerProvider ¶
type PrivilegeCheckerProvider func() PrivilegeChecker
PrivilegeCheckerProvider is used to provide PrivilegeChecker.
func (PrivilegeCheckerProvider) Desc ¶
func (PrivilegeCheckerProvider) Desc() *exprctx.OptionalEvalPropDesc
Desc returns the description for the property key.
type RequireOptionalEvalProps ¶
type RequireOptionalEvalProps interface { // RequiredOptionalEvalProps returns the optional properties that this function requires. // If the returned `OptionalEvalPropKeySet` is empty, // it means this function does not require any optional properties. RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet }
RequireOptionalEvalProps is the interface for the function that requires optional evaluation properties or not.
type SQLExecutor ¶
type SQLExecutor interface { ExecRestrictedSQL( ctx context.Context, opts []sqlexec.OptionFuncAlias, sql string, args ...any, ) ([]chunk.Row, []*resolve.ResultField, error) }
SQLExecutor is the interface for SQL executing in expression. We do not `sqlexec.SQLExecutor` to limit expression to use specified methods only.
type SQLExecutorPropProvider ¶
type SQLExecutorPropProvider func() (SQLExecutor, error)
SQLExecutorPropProvider provides the SQLExecutor
func (SQLExecutorPropProvider) Desc ¶
func (SQLExecutorPropProvider) Desc() *exprctx.OptionalEvalPropDesc
Desc returns the description for the property key.
type SQLExecutorPropReader ¶
type SQLExecutorPropReader struct{}
SQLExecutorPropReader is used by expression to get sql executor
func (SQLExecutorPropReader) GetSQLExecutor ¶
func (SQLExecutorPropReader) GetSQLExecutor(ctx exprctx.EvalContext) (SQLExecutor, error)
GetSQLExecutor returns a SQLExecutor.
func (SQLExecutorPropReader) RequiredOptionalEvalProps ¶
func (SQLExecutorPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet
RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.
type SequenceOperator ¶
type SequenceOperator interface { // GetSequenceID gets the sequence id. GetSequenceID() int64 // GetSequenceNextVal gets the next value of the sequence. GetSequenceNextVal() (int64, error) // SetSequenceVal sets the sequence value. // The returned bool indicates the newVal is already under the base. SetSequenceVal(newVal int64) (int64, bool, error) }
SequenceOperator is the interface for to operate sequence.
type SequenceOperatorPropReader ¶
type SequenceOperatorPropReader struct{}
SequenceOperatorPropReader is used by expression to get SequenceOperator.
func (SequenceOperatorPropReader) GetSequenceOperator ¶
func (SequenceOperatorPropReader) GetSequenceOperator(ctx exprctx.EvalContext, db, name string) (SequenceOperator, error)
GetSequenceOperator returns a SequenceOperator.
func (SequenceOperatorPropReader) RequiredOptionalEvalProps ¶
func (SequenceOperatorPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet
RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.
type SequenceOperatorProvider ¶
type SequenceOperatorProvider func(db, name string) (SequenceOperator, error)
SequenceOperatorProvider is the function to provide SequenceOperator.
func (SequenceOperatorProvider) Desc ¶
func (SequenceOperatorProvider) Desc() *exprctx.OptionalEvalPropDesc
Desc returns the description for the property key.
type SessionVarsPropProvider ¶
type SessionVarsPropProvider struct {
// contains filtered or unexported fields
}
SessionVarsPropProvider is a provider to get the session variables
func NewSessionVarsProvider ¶
func NewSessionVarsProvider(provider variable.SessionVarsProvider) *SessionVarsPropProvider
NewSessionVarsProvider returns a new SessionVarsPropProvider
func (*SessionVarsPropProvider) Desc ¶
func (p *SessionVarsPropProvider) Desc() *exprctx.OptionalEvalPropDesc
Desc implements the OptionalEvalPropProvider interface.
type SessionVarsPropReader ¶
type SessionVarsPropReader struct{}
SessionVarsPropReader is used by expression to read property context.OptPropSessionVars
func (SessionVarsPropReader) GetSessionVars ¶
func (SessionVarsPropReader) GetSessionVars(ctx exprctx.EvalContext) (*variable.SessionVars, error)
GetSessionVars returns the session vars from the context
func (SessionVarsPropReader) RequiredOptionalEvalProps ¶
func (SessionVarsPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet
RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.