Versions in this module Expand all Collapse all v1 v1.0.2 Nov 27, 2021 Changes in this version + type BaseRows struct + func (r *BaseRows) Bytes() int + func (r *BaseRows) Close() error + func (r *BaseRows) Datas() []byte + func (r *BaseRows) Fields() []*querypb.Field + func (r *BaseRows) LastError() error + func (r *BaseRows) LastInsertID() uint64 + func (r *BaseRows) Next() bool + func (r *BaseRows) RowValues() ([]sqltypes.Value, error) + func (r *BaseRows) RowsAffected() uint64 + type BinaryRows struct + func NewBinaryRows(c Conn) *BinaryRows + func (r *BinaryRows) RowValues() ([]sqltypes.Value, error) + type Cond struct + Delay int + Error error + Panic bool + Query string + Result *sqltypes.Result + Type CondType + type CondList struct + type CondType int + const COND_DELAY + const COND_ERROR + const COND_NORMAL + const COND_PANIC + const COND_STREAM + type Conn interface + Cleanup func() + Close func() error + Closed func() bool + ComStatementPrepare func(sql string) (*Statement, error) + Command func(command byte) error + ConnectionID func() uint32 + Exec func(sql string) error + FetchAll func(sql string, maxrows int) (*sqltypes.Result, error) + FetchAllWithFunc func(sql string, maxrows int, fn Func) (*sqltypes.Result, error) + InitDB func(db string) error + NextPacket func() ([]byte, error) + Ping func() error + Query func(sql string) (Rows, error) + Quit func() + func NewConn(username, password, address, database, charset string) (Conn, error) + type Func func(rows Rows) error + type Handler interface + AuthCheck func(session *Session) error + ComInitDB func(session *Session, database string) error + ComQuery func(session *Session, query string, bindVariables map[string]*querypb.BindVariable, ...) error + NewSession func(session *Session) + ServerVersion func() string + SessionCheck func(session *Session) error + SessionClosed func(session *Session) + SessionDec func(session *Session) + SessionInc func(session *Session) + SetServerVersion func() + type Listener struct + func MockMysqlServer(log *xlog.Log, h Handler) (svr *Listener, err error) + func MockMysqlServerWithPort(log *xlog.Log, port int, h Handler) (svr *Listener, err error) + func NewListener(log *xlog.Log, address string, handler Handler) (*Listener, error) + func (l *Listener) Accept() + func (l *Listener) Addr() string + func (l *Listener) Close() + type RowMode int + const BinaryRowMode + const TextRowMode + type Rows interface + Bytes func() int + Close func() error + Datas func() []byte + Fields func() []*querypb.Field + LastError func() error + LastInsertID func() uint64 + Next func() bool + RowValues func() ([]sqltypes.Value, error) + RowsAffected func() uint64 + type Session struct + func (s *Session) Addr() string + func (s *Session) Charset() uint8 + func (s *Session) Close() + func (s *Session) ID() uint32 + func (s *Session) LastQueryTime() time.Time + func (s *Session) Salt() []byte + func (s *Session) Schema() string + func (s *Session) Scramble() []byte + func (s *Session) SetSchema(schema string) + func (s *Session) User() string + type SessionTuple struct + type Statement struct + BindVars map[string]*querypb.BindVariable + ColumnNames []string + ID uint32 + ParamCount uint16 + ParamsType []int32 + PrepareStmt string + func (s *Statement) ComStatementClose() error + func (s *Statement) ComStatementExecute(parameters []sqltypes.Value) error + func (s *Statement) ComStatementQuery(parameters []sqltypes.Value) (*sqltypes.Result, error) + func (s *Statement) ComStatementReset() error + type TestHandler struct + func NewTestHandler(log *xlog.Log) *TestHandler + func (th *TestHandler) AddQuery(query string, result *sqltypes.Result) + func (th *TestHandler) AddQueryDelay(query string, result *sqltypes.Result, delayMs int) + func (th *TestHandler) AddQueryError(query string, err error) + func (th *TestHandler) AddQueryErrorPattern(queryPattern string, err error) + func (th *TestHandler) AddQueryPanic(query string) + func (th *TestHandler) AddQueryPattern(queryPattern string, expectedResult *sqltypes.Result) + func (th *TestHandler) AddQueryStream(query string, result *sqltypes.Result) + func (th *TestHandler) AddQuerys(query string, results ...*sqltypes.Result) + func (th *TestHandler) AuthCheck(s *Session) error + func (th *TestHandler) ComInitDB(s *Session, db string) error + func (th *TestHandler) ComQuery(s *Session, query string, bindVariables map[string]*querypb.BindVariable, ...) error + func (th *TestHandler) GetQueryCalledNum(query string) int + func (th *TestHandler) NewSession(s *Session) + func (th *TestHandler) ResetAll() + func (th *TestHandler) ResetErrors() + func (th *TestHandler) ResetPatternErrors() + func (th *TestHandler) ServerVersion() string + func (th *TestHandler) SessionCheck(s *Session) error + func (th *TestHandler) SessionClosed(s *Session) + func (th *TestHandler) SessionDec(s *Session) + func (th *TestHandler) SessionInc(s *Session) + func (th *TestHandler) SetServerVersion() + type TextRows struct + func NewTextRows(c Conn) *TextRows