mock

package
v2.0.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package mock is just for test only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Store kv.Storage // mock global variable
	// contains filtered or unexported fields
}

Context represents mocked sessionctx.Context.

func NewContext

func NewContext() *Context

NewContext creates a new mocked sessionctx.Context.

func (*Context) ActivePendingTxn

func (c *Context) ActivePendingTxn() error

ActivePendingTxn implements the sessionctx.Context interface.

func (*Context) Cancel

func (c *Context) Cancel()

Cancel implements the Session interface.

func (*Context) ClearValue

func (c *Context) ClearValue(key fmt.Stringer)

ClearValue implements sessionctx.Context ClearValue interface.

func (*Context) GetClient

func (c *Context) GetClient() kv.Client

GetClient implements sessionctx.Context GetClient interface.

func (*Context) GetGlobalSysVar

func (c *Context) GetGlobalSysVar(ctx sessionctx.Context, name string) (string, error)

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) GetStore

func (c *Context) GetStore() kv.Storage

GetStore gets the store of session.

func (*Context) GoCtx

func (c *Context) GoCtx() context.Context

GoCtx returns standard sessionctx.Context that bind with current transaction.

func (*Context) InitTxnWithStartTS

func (c *Context) InitTxnWithStartTS(startTS uint64) error

InitTxnWithStartTS implements the sessionctx.Context interface with startTS.

func (*Context) NewTxn

func (c *Context) NewTxn() error

NewTxn implements the sessionctx.Context interface.

func (*Context) PreparedPlanCache

func (c *Context) PreparedPlanCache() *kvcache.SimpleLRUCache

PreparedPlanCache implements the sessionctx.Context interface.

func (*Context) RefreshTxnCtx

func (c *Context) RefreshTxnCtx(ctx context.Context) error

RefreshTxnCtx implements the sessionctx.Context interface.

func (*Context) SetGlobalSysVar

func (c *Context) SetGlobalSysVar(ctx sessionctx.Context, name string, value string) error

SetGlobalSysVar implements GlobalVarAccessor SetGlobalSysVar interface.

func (*Context) SetSessionManager

func (c *Context) SetSessionManager(sm util.SessionManager)

SetSessionManager set the session manager.

func (*Context) SetValue

func (c *Context) SetValue(key fmt.Stringer, value interface{})

SetValue implements sessionctx.Context SetValue interface.

func (*Context) StmtAddDirtyTableOP

func (c *Context) StmtAddDirtyTableOP(op int, tid int64, handle int64, row []types.Datum)

StmtAddDirtyTableOP implements the sessionctx.Context interface.

func (*Context) StmtCommit

func (c *Context) StmtCommit()

StmtCommit implements the sessionctx.Context interface.

func (*Context) StmtGetMutation

func (c *Context) StmtGetMutation(tableID int64) *binlog.TableMutation

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.

func (*Context) Txn

func (c *Context) Txn() kv.Transaction

Txn implements sessionctx.Context Txn interface.

func (*Context) Value

func (c *Context) Value(key fmt.Stringer) interface{}

Value implements sessionctx.Context Value interface.

Jump to

Keyboard shortcuts

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