Documentation ¶
Overview ¶
Package mock is just for test only.
Index ¶
- type Client
- type Context
- func (c *Context) AddTableLock(_ []model.TableLockTpInfo)
- func (c *Context) Cancel()
- func (c *Context) CheckTableLocked(_ int64) (bool, model.TableLockType)
- func (c *Context) ClearValue(key fmt.Stringer)
- func (c *Context) Close()
- func (c *Context) DDLOwnerChecker() owner.DDLOwnerChecker
- func (c *Context) Execute(ctx context.Context, sql string) ([]sqlexec.RecordSet, error)
- func (c *Context) ExecuteInternal(ctx context.Context, sql string) ([]sqlexec.RecordSet, error)
- func (c *Context) GetAllTableLocks() []model.TableLockTpInfo
- func (c *Context) GetClient() kv.Client
- func (c *Context) GetGlobalSysVar(ctx sessionctx.Context, name string) (string, error)
- func (c *Context) GetSessionManager() util.SessionManager
- func (c *Context) GetSessionVars() *variable.SessionVars
- func (c *Context) GetStore() kv.Storage
- func (c *Context) GoCtx() context.Context
- func (c *Context) HasDirtyContent(tid int64) bool
- func (c *Context) HasLockedTables() bool
- func (c *Context) InitTxnWithStartTS(startTS uint64) error
- func (c *Context) NewTxn(context.Context) error
- func (c *Context) PrepareTSFuture(ctx context.Context)
- func (c *Context) PreparedPlanCache() *kvcache.SimpleLRUCache
- func (c *Context) RefreshTxnCtx(ctx context.Context) error
- func (c *Context) ReleaseAllTableLocks()
- func (c *Context) ReleaseTableLockByTableIDs(tableIDs []int64)
- func (c *Context) ReleaseTableLocks(locks []model.TableLockTpInfo)
- func (c *Context) SetGlobalSysVar(ctx sessionctx.Context, name string, value string) error
- func (c *Context) SetSessionManager(sm util.SessionManager)
- func (c *Context) SetValue(key fmt.Stringer, value interface{})
- func (c *Context) StmtAddDirtyTableOP(op int, tid int64, handle int64)
- func (c *Context) StmtCommit(tracker *memory.Tracker) error
- func (c *Context) StmtGetMutation(tableID int64) *binlog.TableMutation
- func (c *Context) StmtRollback()
- func (c *Context) StoreQueryFeedback(_ interface{})
- func (c *Context) Txn(bool) (kv.Transaction, error)
- func (c *Context) Value(key fmt.Stringer) interface{}
- type HookKeyForTest
- type Store
- func (s *Store) Begin() (kv.Transaction, error)
- func (s *Store) BeginWithStartTS(startTS uint64) (kv.Transaction, error)
- func (s *Store) Close() error
- func (s *Store) CurrentVersion() (kv.Version, error)
- func (s *Store) Describe() string
- func (s *Store) GetClient() kv.Client
- func (s *Store) GetOracle() oracle.Oracle
- func (s *Store) GetSnapshot(ver kv.Version) (kv.Snapshot, error)
- func (s *Store) Name() string
- func (s *Store) ShowStatus(ctx context.Context, key string) (interface{}, error)
- func (s *Store) SupportDeleteRange() bool
- func (s *Store) UUID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { kv.RequestTypeSupportedChecker MockResponse kv.Response }
Client implement kv.Client interface, mocked from "CopClient" defined in "store/tikv/copprocessor.go".
type Context ¶
type Context struct { Store kv.Storage // mock global variable // contains filtered or unexported fields }
Context represents mocked sessionctx.Context.
func (*Context) AddTableLock ¶
func (c *Context) AddTableLock(_ []model.TableLockTpInfo)
AddTableLock implements the sessionctx.Context interface.
func (*Context) CheckTableLocked ¶
func (c *Context) CheckTableLocked(_ int64) (bool, model.TableLockType)
CheckTableLocked implements the sessionctx.Context interface.
func (*Context) ClearValue ¶
ClearValue implements sessionctx.Context ClearValue interface.
func (*Context) Close ¶
func (c *Context) Close()
Close implements the sessionctx.Context interface.
func (*Context) DDLOwnerChecker ¶
func (c *Context) DDLOwnerChecker() owner.DDLOwnerChecker
DDLOwnerChecker returns owner.DDLOwnerChecker.
func (*Context) ExecuteInternal ¶
ExecuteInternal implements sqlexec.SQLExecutor ExecuteInternal interface.
func (*Context) GetAllTableLocks ¶
func (c *Context) GetAllTableLocks() []model.TableLockTpInfo
GetAllTableLocks implements the sessionctx.Context interface.
func (*Context) GetGlobalSysVar ¶
GetGlobalSysVar implements GlobalVarAccessor GetGlobalSysVar interface.
func (*Context) GetSessionManager ¶
func (c *Context) GetSessionManager() util.SessionManager
GetSessionManager implements the sessionctx.Context interface.
func (*Context) GetSessionVars ¶
func (c *Context) GetSessionVars() *variable.SessionVars
GetSessionVars implements the sessionctx.Context GetSessionVars interface.
func (*Context) GoCtx ¶
GoCtx returns standard sessionctx.Context that bind with current transaction.
func (*Context) HasDirtyContent ¶
HasDirtyContent implements sessionctx.Context ClearValue interface.
func (*Context) HasLockedTables ¶
HasLockedTables implements the sessionctx.Context interface.
func (*Context) InitTxnWithStartTS ¶
InitTxnWithStartTS implements the sessionctx.Context interface with startTS.
func (*Context) PrepareTSFuture ¶
PrepareTSFuture implements the sessionctx.Context interface.
func (*Context) PreparedPlanCache ¶
func (c *Context) PreparedPlanCache() *kvcache.SimpleLRUCache
PreparedPlanCache implements the sessionctx.Context interface.
func (*Context) RefreshTxnCtx ¶
RefreshTxnCtx implements the sessionctx.Context interface.
func (*Context) ReleaseAllTableLocks ¶
func (c *Context) ReleaseAllTableLocks()
ReleaseAllTableLocks implements the sessionctx.Context interface.
func (*Context) ReleaseTableLockByTableIDs ¶
ReleaseTableLockByTableIDs implements the sessionctx.Context interface.
func (*Context) ReleaseTableLocks ¶
func (c *Context) ReleaseTableLocks(locks []model.TableLockTpInfo)
ReleaseTableLocks implements the sessionctx.Context interface.
func (*Context) SetGlobalSysVar ¶
SetGlobalSysVar implements GlobalVarAccessor SetGlobalSysVar interface.
func (*Context) SetSessionManager ¶
func (c *Context) SetSessionManager(sm util.SessionManager)
SetSessionManager set the session manager.
func (*Context) StmtAddDirtyTableOP ¶
StmtAddDirtyTableOP implements the sessionctx.Context interface.
func (*Context) StmtCommit ¶
StmtCommit implements the sessionctx.Context interface.
func (*Context) StmtGetMutation ¶
StmtGetMutation implements the sessionctx.Context interface.
func (*Context) StmtRollback ¶
func (c *Context) StmtRollback()
StmtRollback implements the sessionctx.Context interface.
func (*Context) StoreQueryFeedback ¶
func (c *Context) StoreQueryFeedback(_ interface{})
StoreQueryFeedback stores the query feedback.
type HookKeyForTest ¶
type HookKeyForTest string
HookKeyForTest is as alias, used by context.WithValue. golint forbits using string type as key in context.WithValue.
type Store ¶
Store implements kv.Storage interface.
func (*Store) Begin ¶
func (s *Store) Begin() (kv.Transaction, error)
Begin implements kv.Storage interface.
func (*Store) BeginWithStartTS ¶
func (s *Store) BeginWithStartTS(startTS uint64) (kv.Transaction, error)
BeginWithStartTS implements kv.Storage interface.
func (*Store) CurrentVersion ¶
CurrentVersion implements kv.Storage interface.
func (*Store) GetSnapshot ¶
GetSnapshot implements kv.Storage interface.
func (*Store) ShowStatus ¶
ShowStatus implements kv.Storage interface.
func (*Store) SupportDeleteRange ¶
SupportDeleteRange implements kv.Storage interface.