expropt

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

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

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

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

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

ActiveRoles returns the active roles

func (CurrentUserPropReader) CurrentUser

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

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

Desc returns the description for the property key.

type InfoSchemaPropReader

type InfoSchemaPropReader struct{}

InfoSchemaPropReader is used to get the information schema.

func (InfoSchemaPropReader) GetDomainInfoSchema

GetDomainInfoSchema return domain information schema.

func (InfoSchemaPropReader) GetSessionInfoSchema

GetSessionInfoSchema returns session information schema.

func (InfoSchemaPropReader) RequiredOptionalEvalProps

func (InfoSchemaPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet

RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.

type KVStorePropProvider

type KVStorePropProvider func() kv.Storage

KVStorePropProvider is used to provide kv.Storage for context

func (KVStorePropProvider) Desc

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

Add adds an optional property

func (*OptionalEvalPropProviders) Contains

Contains checks whether the provider by key exists.

func (*OptionalEvalPropProviders) Get

Get gets the provider by key.

func (*OptionalEvalPropProviders) PropKeySet

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

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

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

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

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

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

Desc implements the OptionalEvalPropProvider interface.

type SessionVarsPropReader

type SessionVarsPropReader struct{}

SessionVarsPropReader is used by expression to read property context.OptPropSessionVars

func (SessionVarsPropReader) GetSessionVars

GetSessionVars returns the session vars from the context

func (SessionVarsPropReader) RequiredOptionalEvalProps

func (SessionVarsPropReader) RequiredOptionalEvalProps() exprctx.OptionalEvalPropKeySet

RequiredOptionalEvalProps implements the RequireOptionalEvalProps interface.

Jump to

Keyboard shortcuts

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