Documentation
¶
Index ¶
- Constants
- Variables
- func AtomicAddDuration(v atomic.Value, t interface{})
- func Execute(ctx context.Context, ses *Session, proc *process.Process, ...) error
- func GetDefaultRole() string
- func GetDefaultTenant() string
- func GetExplainColumns(explainColName string) ([]interface{}, error)
- func GetPrepareStmtID(name string) (int, error)
- func GetRoutineId() uint64
- func GetSimpleExprValue(e tree.Expr) (interface{}, error)
- func InitGeneralTenant(ctx context.Context, ses *Session, ca *tree.CreateAccount) error
- func InitGlobalSystemVariables(gsv *GlobalSystemVariables)
- func InitRole(ctx context.Context, ses *Session, tenant *TenantInfo, cr *tree.CreateRole) error
- func InitServerVersion(v string)
- func InitSysTenant(ctx context.Context) error
- func InitUser(ctx context.Context, ses *Session, tenant *TenantInfo, cu *tree.CreateUser) error
- func IsAdministrativeStatement(stmt tree.Statement) bool
- func IsDDL(stmt tree.Statement) bool
- func IsDropStatement(stmt tree.Statement) bool
- func IsParameterModificationStatement(stmt tree.Statement) bool
- func IsPrepareStatement(stmt tree.Statement) bool
- func MakeDebugInfo(data []byte, bytesCount int, bytesPerLine int) string
- func Max(a int, b int) int
- func MaxInt64(a int64, b int64) int64
- func MaxUint64(a uint64, b uint64) uint64
- func Min(a int, b int) int
- func MinInt64(a int64, b int64) int64
- func MinUint64(a uint64, b uint64) uint64
- func NeedToBeCommittedInActiveTransaction(stmt tree.Statement) bool
- func NewGraph() *graph
- func NewInternalExecutor(pu *config.ParameterUnit) *internalExecutor
- func NewOutputQueue(proto MysqlProtocol, mrs *MysqlResultSet, length uint64, ep *tree.ExportParam, ...) *outputQueue
- func NewSqlCodec() codec.Codec
- func PrintThreadInfo(handler *ParseLineHandler, close *CloseFlag, a time.Duration)
- func SetSpecialUser(userName string, password []byte)
- func StatementCanBeExecutedInUncommittedTransaction(ses *Session, stmt tree.Statement) (bool, error)
- func SubStringFromBegin(str string, length int) string
- func WildcardMatch(pattern, target string) bool
- type AlterAccountExecutor
- type AlterUserExecutor
- type AnalyzeStmtExecutor
- type BackgroundExec
- type BackgroundHandler
- type BackgroundSession
- type BeginTxnExecutor
- type CloseExportData
- type CloseFlag
- type CmdExecutor
- type CmdExecutorImpl
- type Column
- type ColumnImpl
- type ColumnInfo
- type CommandType
- type CommitTxnExecutor
- type ComputationRunner
- type ComputationWrapper
- type CreateAccountExecutor
- type CreateDatabaseExecutor
- type CreateIndexExecutor
- type CreateRoleExecutor
- type CreateTableExecutor
- type CreateUserExecutor
- type CreateViewExecutor
- type DeallocateExecutor
- type DebugCounter
- type DebugTime
- type DeleteExecutor
- type DropAccountExecutor
- type DropDatabaseExecutor
- type DropIndexExecutor
- type DropRoleExecutor
- type DropTableExecutor
- type DropUserExecutor
- type DropViewExecutor
- type ExecResult
- type ExecuteExecutor
- func (ee *ExecuteExecutor) Close(ctx context.Context, ses *Session) error
- func (ee *ExecuteExecutor) CommitOrRollbackTxn(ctx context.Context, ses *Session) error
- func (ee *ExecuteExecutor) Compile(requestCtx context.Context, u interface{}, ...) (interface{}, error)
- func (ee *ExecuteExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
- func (bse ExecuteExecutor) GetStatus() stmtExecStatus
- func (ee *ExecuteExecutor) ResponseAfterExec(ctx context.Context, ses *Session) error
- func (ee *ExecuteExecutor) ResponseBeforeExec(ctx context.Context, ses *Session) error
- func (bse ExecuteExecutor) SetStatus(err error)
- func (bse ExecuteExecutor) Setup(ctx context.Context, ses *Session) error
- func (bse ExecuteExecutor) VerifyPrivilege(ctx context.Context, ses *Session) error
- func (bse ExecuteExecutor) VerifyTxn(ctx context.Context, ses *Session) error
- type ExplainAnalyzeExecutor
- func (eae *ExplainAnalyzeExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
- func (rsse ExplainAnalyzeExecutor) ResponseAfterExec(ctx context.Context, ses *Session) error
- func (rsse ExplainAnalyzeExecutor) ResponseBeforeExec(ctx context.Context, ses *Session) error
- func (eae *ExplainAnalyzeExecutor) Setup(ctx context.Context, ses *Session) error
- type ExplainForExecutor
- type ExplainStmtExecutor
- type FakeProtocol
- func (fp *FakeProtocol) ConnectionID() uint32
- func (fp *FakeProtocol) GetDatabaseName() string
- func (fp *FakeProtocol) GetRequest(payload []byte) *Request
- func (fp *FakeProtocol) GetStats() string
- func (fp *FakeProtocol) GetUserName() string
- func (fp *FakeProtocol) IsEstablished() bool
- func (fp *FakeProtocol) ParseExecuteData(stmt *PrepareStmt, data []byte, pos int) (names []string, vars []any, err error)
- func (fp *FakeProtocol) Peer() (string, string, string, string)
- func (fp *FakeProtocol) PrepareBeforeProcessingResultSet()
- func (fp *FakeProtocol) Quit()
- func (fp *FakeProtocol) SendColumnCountPacket(count uint64) error
- func (fp *FakeProtocol) SendColumnDefinitionPacket(column Column, cmd int) error
- func (fp *FakeProtocol) SendEOFPacketIf(warnings uint16, status uint16) error
- func (fp *FakeProtocol) SendPrepareResponse(stmt *PrepareStmt) error
- func (fp *FakeProtocol) SendResponse(response *Response) error
- func (fp *FakeProtocol) SendResultSetTextBatchRow(mrs *MysqlResultSet, cnt uint64) error
- func (fp *FakeProtocol) SendResultSetTextBatchRowSpeedup(mrs *MysqlResultSet, cnt uint64) error
- func (fp *FakeProtocol) SetDatabaseName(s string)
- func (fp *FakeProtocol) SetEstablished()
- func (fp *FakeProtocol) SetUserName(s string)
- type GlobalSystemVariables
- func (gsv *GlobalSystemVariables) AddSysVariables(vars []SystemVariable)
- func (gsv *GlobalSystemVariables) CopySysVarsToSession() map[string]interface{}
- func (gsv *GlobalSystemVariables) GetDefinitionOfSysVar(name string) (SystemVariable, bool)
- func (gsv *GlobalSystemVariables) GetGlobalSysVar(name string) (SystemVariable, interface{}, bool)
- func (gsv *GlobalSystemVariables) SetGlobalSysVar(name string, value interface{}) error
- func (gsv *GlobalSystemVariables) SetValues(values map[string]interface{}) error
- type GrantExecutor
- type IOPackage
- type IOPackageImpl
- func (bio *IOPackageImpl) AppendUint16(data []byte, value uint16) []byte
- func (bio *IOPackageImpl) AppendUint32(data []byte, value uint32) []byte
- func (bio *IOPackageImpl) AppendUint64(data []byte, value uint64) []byte
- func (bio *IOPackageImpl) AppendUint8(data []byte, value uint8) []byte
- func (bio *IOPackageImpl) IsLittleEndian() bool
- func (bio *IOPackageImpl) ReadUint16(data []byte, pos int) (uint16, int, bool)
- func (bio *IOPackageImpl) ReadUint32(data []byte, pos int) (uint32, int, bool)
- func (bio *IOPackageImpl) ReadUint64(data []byte, pos int) (uint64, int, bool)
- func (bio *IOPackageImpl) ReadUint8(data []byte, pos int) (uint8, int, bool)
- func (bio *IOPackageImpl) WriteUint16(data []byte, pos int, value uint16) int
- func (bio *IOPackageImpl) WriteUint32(data []byte, pos int, value uint32) int
- func (bio *IOPackageImpl) WriteUint64(data []byte, pos int, value uint64) int
- func (bio *IOPackageImpl) WriteUint8(data []byte, pos int, value uint8) int
- type ImportExecutor
- type InsertExecutor
- type InternalCmdFieldList
- type InternalCmdFieldListExecutor
- func (icfle *InternalCmdFieldListExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
- func (icfle *InternalCmdFieldListExecutor) ResponseAfterExec(ctx context.Context, ses *Session) error
- func (icfle *InternalCmdFieldListExecutor) ResponseBeforeExec(ctx context.Context, ses *Session) error
- type LoadExecutor
- type LoadResult
- type MOServer
- type MysqlCmdExecutor
- func (mce *MysqlCmdExecutor) ChooseDoQueryFunc(choice bool)
- func (mce *MysqlCmdExecutor) Close()
- func (mce *MysqlCmdExecutor) ExecRequest(requestCtx context.Context, req *Request) (resp *Response, err error)
- func (mce *MysqlCmdExecutor) GetDoQueryFunc() doComQueryFunc
- func (mce *MysqlCmdExecutor) GetRoutineManager() *RoutineManager
- func (mce *MysqlCmdExecutor) GetSession() *Session
- func (mce *MysqlCmdExecutor) GetSqlCount() uint64
- func (mce *MysqlCmdExecutor) PrepareSessionBeforeExecRequest(ses *Session)
- func (mce *MysqlCmdExecutor) SetRoutineManager(mgr *RoutineManager)
- type MysqlColumn
- func (mc *MysqlColumn) Charset() uint16
- func (mc *MysqlColumn) Decimal() uint8
- func (mc *MysqlColumn) DefaultValue() []byte
- func (mc *MysqlColumn) Flag() uint16
- func (mc *MysqlColumn) GetAutoIncr() bool
- func (mc *MysqlColumn) IsSigned() bool
- func (mc *MysqlColumn) OrgName() string
- func (mc *MysqlColumn) OrgTable() string
- func (mc *MysqlColumn) Schema() string
- func (mc *MysqlColumn) SetAutoIncr(s bool)
- func (mc *MysqlColumn) SetCharset(charset uint16)
- func (mc *MysqlColumn) SetDecimal(decimal uint8)
- func (mc *MysqlColumn) SetDefaultValue(defaultValue []byte)
- func (mc *MysqlColumn) SetFlag(flag uint16)
- func (mc *MysqlColumn) SetOrgName(orgName string)
- func (mc *MysqlColumn) SetOrgTable(orgTable string)
- func (mc *MysqlColumn) SetSchema(schema string)
- func (mc *MysqlColumn) SetSigned(s bool)
- func (mc *MysqlColumn) SetTable(table string)
- func (mc *MysqlColumn) Table() string
- type MysqlExecutionResult
- func (mer *MysqlExecutionResult) AffectedRows() uint64
- func (mer *MysqlExecutionResult) InsertID() uint64
- func (mer *MysqlExecutionResult) Mrs() *MysqlResultSet
- func (mer *MysqlExecutionResult) SetAffectedRows(affectedRows uint64)
- func (mer *MysqlExecutionResult) SetInsertID(insertID uint64)
- func (mer *MysqlExecutionResult) SetMrs(mrs *MysqlResultSet)
- func (mer *MysqlExecutionResult) SetStatus(status uint16)
- func (mer *MysqlExecutionResult) SetWarnings(warnings uint16)
- func (mer *MysqlExecutionResult) Status() uint16
- func (mer *MysqlExecutionResult) Warnings() uint16
- type MysqlProtocol
- type MysqlProtocolImpl
- func (mp *MysqlProtocolImpl) AddSequenceId(a uint8)
- func (mp *MysqlProtocolImpl) GetCapability() uint32
- func (mp *MysqlProtocolImpl) GetDatabaseName() string
- func (mp *MysqlProtocolImpl) GetRequest(payload []byte) *Request
- func (mp *MysqlProtocolImpl) GetSequenceId() uint8
- func (mp *MysqlProtocolImpl) GetSession() *Session
- func (mp *MysqlProtocolImpl) GetSkipCheckUser() bool
- func (mp *MysqlProtocolImpl) GetStats() string
- func (mp *MysqlProtocolImpl) GetUserName() string
- func (mp *MysqlProtocolImpl) ParseExecuteData(stmt *PrepareStmt, data []byte, pos int) (names []string, vars []any, err error)
- func (mp *MysqlProtocolImpl) PrepareBeforeProcessingResultSet()
- func (mp *MysqlProtocolImpl) Quit()
- func (ds *MysqlProtocolImpl) ResetStats()
- func (mp *MysqlProtocolImpl) SendColumnCountPacket(count uint64) error
- func (mp *MysqlProtocolImpl) SendColumnDefinitionPacket(column Column, cmd int) error
- func (mp *MysqlProtocolImpl) SendEOFPacketIf(warnings, status uint16) error
- func (mp *MysqlProtocolImpl) SendPrepareResponse(stmt *PrepareStmt) error
- func (mp *MysqlProtocolImpl) SendResponse(resp *Response) error
- func (mp *MysqlProtocolImpl) SendResultSetTextBatchRow(mrs *MysqlResultSet, cnt uint64) error
- func (mp *MysqlProtocolImpl) SendResultSetTextBatchRowSpeedup(mrs *MysqlResultSet, cnt uint64) error
- func (mp *MysqlProtocolImpl) SendResultSetTextRow(mrs *MysqlResultSet, r uint64) error
- func (mp *MysqlProtocolImpl) SetDatabaseName(s string)
- func (mp *MysqlProtocolImpl) SetSequenceID(value uint8)
- func (mp *MysqlProtocolImpl) SetSession(ses *Session)
- func (mp *MysqlProtocolImpl) SetSkipCheckUser(b bool)
- func (mp *MysqlProtocolImpl) SetUserName(s string)
- func (ds *MysqlProtocolImpl) String() string
- type MysqlResultSet
- func (mrs *MysqlResultSet) AddColumn(column Column) uint64
- func (mrs *MysqlResultSet) AddRow(row []interface{}) uint64
- func (mrs *MysqlResultSet) ColumnIsNull(rindex, cindex uint64) (bool, error)
- func (mrs *MysqlResultSet) GetColumn(index uint64) (Column, error)
- func (mrs *MysqlResultSet) GetColumnCount() uint64
- func (mrs *MysqlResultSet) GetFloat64(rindex, cindex uint64) (float64, error)
- func (mrs *MysqlResultSet) GetInt64(rindex, cindex uint64) (int64, error)
- func (mrs *MysqlResultSet) GetRow(index uint64) ([]interface{}, error)
- func (mrs *MysqlResultSet) GetRowCount() uint64
- func (mrs *MysqlResultSet) GetString(rindex, cindex uint64) (string, error)
- func (mrs *MysqlResultSet) GetUint64(rindex, cindex uint64) (uint64, error)
- func (mrs *MysqlResultSet) GetValue(rindex uint64, cindex uint64) (interface{}, error)
- func (mrs *MysqlResultSet) GetValueByName(rindex uint64, colName string) (interface{}, error)
- type NullComputationWrapper
- func (ncw *NullComputationWrapper) Compile(requestCtx context.Context, u interface{}, ...) (interface{}, error)
- func (ncw *NullComputationWrapper) GetAffectedRows() uint64
- func (ncw *NullComputationWrapper) GetAst() tree.Statement
- func (ncw *NullComputationWrapper) GetColumns() ([]interface{}, error)
- func (ncw *NullComputationWrapper) GetLoadTag() bool
- func (ncw *NullComputationWrapper) GetUUID() []byte
- func (ncw *NullComputationWrapper) RecordExecPlan(ctx context.Context) error
- func (ncw *NullComputationWrapper) Run(ts uint64) error
- func (ncw *NullComputationWrapper) SetDatabaseName(db string) error
- type OperatorProfiler
- type Packet
- type ParseLineHandler
- type PhaseProfiler
- type PoolElement
- type PrepareStmt
- type PrepareStmtExecutor
- type PrepareStringExecutor
- type PrivilegeScope
- type PrivilegeType
- type Protocol
- type ProtocolImpl
- func (cpi *ProtocolImpl) ConnectionID() uint32
- func (cpi *ProtocolImpl) GetConciseProfile() string
- func (cpi *ProtocolImpl) GetLock() sync.Locker
- func (cpi *ProtocolImpl) GetSalt() []byte
- func (cpi *ProtocolImpl) GetTcpConnection() goetty.IOSession
- func (cpi *ProtocolImpl) IsEstablished() bool
- func (cpi *ProtocolImpl) IsTlsEstablished() bool
- func (cpi *ProtocolImpl) MakeProfile()
- func (cpi *ProtocolImpl) Peer() (string, string, string, string)
- func (cpi *ProtocolImpl) Quit()
- func (cpi *ProtocolImpl) SetEstablished()
- func (cpi *ProtocolImpl) SetTlsEstablished()
- type QueryProfiler
- type QueryType
- type Request
- type Response
- func NewGeneralErrorResponse(cmd CommandType, err error) *Response
- func NewGeneralOkResponse(cmd CommandType) *Response
- func NewOkResponse(affectedRows, lastInsertId uint64, warnings, status uint16, cmd int, ...) *Response
- func NewResponse(category int, status uint16, cmd int, d interface{}) *Response
- type ResultSet
- type RevokeExecutor
- type RollbackTxnExecutor
- type Routine
- func (routine *Routine) GetCancelRoutineCtx() context.Context
- func (routine *Routine) GetCancelRoutineFunc() context.CancelFunc
- func (routine *Routine) GetClientProtocol() Protocol
- func (routine *Routine) GetCmdExecutor() CmdExecutor
- func (routine *Routine) GetRequestChannel() chan *Request
- func (routine *Routine) GetRoutineMgr() *RoutineManager
- func (routine *Routine) GetSession() *Session
- func (routine *Routine) Loop(routineCtx context.Context)
- func (routine *Routine) Quit()
- func (routine *Routine) SetRoutineMgr(rtMgr *RoutineManager)
- func (routine *Routine) SetSession(ses *Session)
- type RoutineManager
- func (rm *RoutineManager) Closed(rs goetty.IOSession)
- func (rm *RoutineManager) Created(rs goetty.IOSession)
- func (rm *RoutineManager) GetSkipCheckUser() bool
- func (rm *RoutineManager) Handler(rs goetty.IOSession, msg interface{}, received uint64) error
- func (rm *RoutineManager) SetSkipCheckUser(b bool)
- type Scope
- type SelectExecutor
- type Session
- func (ses *Session) AppendData(row []interface{})
- func (ses *Session) AppendMysqlResultSetOfBackgroundTask(mrs *MysqlResultSet)
- func (ses *Session) AuthenticateUser(userInput string) ([]byte, error)
- func (ses *Session) ClearAllMysqlResultSet()
- func (ses *Session) ClearOptionBits(bit uint32)
- func (ses *Session) ClearServerStatus(bit uint16)
- func (ses *Session) CopyAllSessionVars() map[string]interface{}
- func (ses *Session) DatabaseNameIsEmpty() bool
- func (ses *Session) Dispose()
- func (ses *Session) GenNewStmtId() uint32
- func (ses *Session) GetAllMysqlResultSet() []*MysqlResultSet
- func (ses *Session) GetBackgroundExec(ctx context.Context) BackgroundExec
- func (ses *Session) GetCmd() CommandType
- func (ses *Session) GetCompleteProfile() string
- func (ses *Session) GetConciseProfile() string
- func (ses *Session) GetConnectionID() uint32
- func (ses *Session) GetData() [][]interface{}
- func (ses *Session) GetDatabaseName() string
- func (ses *Session) GetErrInfo() *errInfo
- func (ses *Session) GetExportParam() *tree.ExportParam
- func (ses *Session) GetFromRealUser() bool
- func (ses *Session) GetGlobalSysVars() *GlobalSystemVariables
- func (ses *Session) GetGlobalVar(name string) (interface{}, error)
- func (ses *Session) GetIsInternal() bool
- func (ses *Session) GetLastStmtId() uint32
- func (ses *Session) GetMemPool() *mpool.MPool
- func (ses *Session) GetMysqlProtocol() MysqlProtocol
- func (ses *Session) GetMysqlResultSet() *MysqlResultSet
- func (ses *Session) GetOutputCallback() func(interface{}, *batch.Batch) error
- func (ses *Session) GetParameterUnit() *config.ParameterUnit
- func (ses *Session) GetPeer() (string, string)
- func (ses *Session) GetPrepareStmt(name string) (*PrepareStmt, error)
- func (ses *Session) GetPrivilege() *privilege
- func (ses *Session) GetPrivilegeCache() *privilegeCache
- func (ses *Session) GetRequestContext() context.Context
- func (ses *Session) GetSessionVar(name string) (interface{}, error)
- func (ses *Session) GetShowStmtType() ShowStatementType
- func (ses *Session) GetSql() string
- func (ses *Session) GetStorage() engine.Engine
- func (ses *Session) GetSysVar(name string) interface{}
- func (ses *Session) GetSysVars() map[string]interface{}
- func (ses *Session) GetTenantInfo() *TenantInfo
- func (ses *Session) GetTenantName(stmt tree.Statement) string
- func (ses *Session) GetTimeZone() *time.Location
- func (ses *Session) GetTxnCompileCtx() *TxnCompilerContext
- func (ses *Session) GetTxnHandler() *TxnHandler
- func (ses *Session) GetUUID() []byte
- func (ses *Session) GetUUIDString() string
- func (ses *Session) GetUserDefinedVar(name string) (SystemVariableType, interface{}, error)
- func (ses *Session) GetUserName() string
- func (ses *Session) InActiveMultiStmtTransaction() bool
- func (ses *Session) InActiveTransaction() bool
- func (ses *Session) InMultiStmtTransactionMode() bool
- func (ses *Session) InvalidatePrivilegeCache()
- func (ses *Session) IsTaeEngine() bool
- func (ses *Session) MakeProfile()
- func (ses *Session) OptionBitsIsSet(bit uint32) bool
- func (ses *Session) RemovePrepareStmt(name string)
- func (ses *Session) ServerStatusIsSet(bit uint16) bool
- func (ses *Session) SetAutocommit(on bool) error
- func (ses *Session) SetCmd(cmd CommandType)
- func (ses *Session) SetData(data [][]interface{})
- func (ses *Session) SetDatabaseName(db string)
- func (ses *Session) SetExportParam(ep *tree.ExportParam)
- func (ses *Session) SetFromRealUser(b bool)
- func (ses *Session) SetGlobalVar(name string, value interface{}) error
- func (ses *Session) SetMemPool(mp *mpool.MPool)
- func (ses *Session) SetMysqlResultSet(mrs *MysqlResultSet)
- func (ses *Session) SetOptionBits(bit uint32)
- func (ses *Session) SetOutputCallback(callback func(interface{}, *batch.Batch) error)
- func (ses *Session) SetPrepareStmt(name string, prepareStmt *PrepareStmt) error
- func (ses *Session) SetPrivilege(priv *privilege)
- func (ses *Session) SetRequestContext(reqCtx context.Context)
- func (ses *Session) SetServerStatus(bit uint16)
- func (ses *Session) SetSessionVar(name string, value interface{}) error
- func (ses *Session) SetShowStmtType(sst ShowStatementType)
- func (ses *Session) SetSql(sql string)
- func (ses *Session) SetSysVar(name string, value interface{})
- func (ses *Session) SetTenantInfo(ti *TenantInfo)
- func (ses *Session) SetTimeZone(loc *time.Location)
- func (ses *Session) SetUserDefinedVar(name string, value interface{}) error
- func (ses *Session) SetUserName(uname string)
- func (ses *Session) TxnBegin() error
- func (ses *Session) TxnCommit() error
- func (ses *Session) TxnCommitSingleStatement(stmt tree.Statement) error
- func (ses *Session) TxnRollback() error
- func (ses *Session) TxnRollbackSingleStatement(stmt tree.Statement) error
- func (ses *Session) TxnStart() error
- type SetDefaultRoleExecutor
- type SetPasswordExecutor
- type SetRoleExecutor
- type SetVarExecutor
- type SharePart
- type ShowColumnsExecutor
- type ShowCreateDatabaseExecutor
- type ShowCreateTableExecutor
- type ShowCreateViewExecutor
- type ShowDatabasesExecutor
- type ShowErrorsExecutor
- type ShowGrantsExecutor
- type ShowIndexExecutor
- type ShowProcessListExecutor
- type ShowStatementType
- type ShowStatusExecutor
- type ShowTableStatusExecutor
- type ShowTablesExecutor
- type ShowTargetExecutor
- type ShowVariablesExecutor
- type ShowWarningsExecutor
- type StmtExecutor
- type SystemVariable
- type SystemVariableBoolType
- func (svbt SystemVariableBoolType) Convert(value interface{}) (interface{}, error)
- func (svbt SystemVariableBoolType) IsTrue(v interface{}) bool
- func (svbt SystemVariableBoolType) MysqlType() defines.MysqlType
- func (svbt SystemVariableBoolType) String() string
- func (svbt SystemVariableBoolType) Type() types.T
- func (svbt SystemVariableBoolType) Zero() interface{}
- type SystemVariableDoubleType
- func (svdt SystemVariableDoubleType) Convert(value interface{}) (interface{}, error)
- func (svdt SystemVariableDoubleType) MysqlType() defines.MysqlType
- func (svdt SystemVariableDoubleType) String() string
- func (svdt SystemVariableDoubleType) Type() types.T
- func (svdt SystemVariableDoubleType) Zero() interface{}
- type SystemVariableEnumType
- func (svet SystemVariableEnumType) Convert(value interface{}) (interface{}, error)
- func (svet SystemVariableEnumType) MysqlType() defines.MysqlType
- func (svet SystemVariableEnumType) String() string
- func (svet SystemVariableEnumType) Type() types.T
- func (svet SystemVariableEnumType) Zero() interface{}
- type SystemVariableIntType
- type SystemVariableNullType
- func (svnt SystemVariableNullType) Convert(value interface{}) (interface{}, error)
- func (svnt SystemVariableNullType) MysqlType() defines.MysqlType
- func (svnt SystemVariableNullType) String() string
- func (svnt SystemVariableNullType) Type() types.T
- func (svnt SystemVariableNullType) Zero() interface{}
- type SystemVariableSetType
- func (svst SystemVariableSetType) Convert(value interface{}) (interface{}, error)
- func (svst SystemVariableSetType) MysqlType() defines.MysqlType
- func (svst SystemVariableSetType) String() string
- func (svst SystemVariableSetType) Type() types.T
- func (svst SystemVariableSetType) Values() []string
- func (svst SystemVariableSetType) Zero() interface{}
- type SystemVariableStringType
- func (svst SystemVariableStringType) Convert(value interface{}) (interface{}, error)
- func (svst SystemVariableStringType) MysqlType() defines.MysqlType
- func (svst SystemVariableStringType) String() string
- func (svst SystemVariableStringType) Type() types.T
- func (svst SystemVariableStringType) Zero() interface{}
- type SystemVariableType
- type SystemVariableUintType
- func (svut SystemVariableUintType) Convert(value interface{}) (interface{}, error)
- func (svut SystemVariableUintType) MysqlType() defines.MysqlType
- func (svut SystemVariableUintType) String() string
- func (svut SystemVariableUintType) Type() types.T
- func (svut SystemVariableUintType) Zero() interface{}
- type TableInfo
- type TableInfoCache
- type TenantInfo
- func (ti *TenantInfo) GetDefaultRole() string
- func (ti *TenantInfo) GetDefaultRoleID() uint32
- func (ti *TenantInfo) GetTenant() string
- func (ti *TenantInfo) GetTenantID() uint32
- func (ti *TenantInfo) GetUseSecondaryRole() bool
- func (ti *TenantInfo) GetUser() string
- func (ti *TenantInfo) GetUserID() uint32
- func (ti *TenantInfo) HasDefaultRole() bool
- func (ti *TenantInfo) IsAccountAdminRole() bool
- func (ti *TenantInfo) IsAdminRole() bool
- func (ti *TenantInfo) IsDefaultRole() bool
- func (ti *TenantInfo) IsMoAdminRole() bool
- func (ti *TenantInfo) IsNameOfAdminRoles(name string) bool
- func (ti *TenantInfo) IsSysTenant() bool
- func (ti *TenantInfo) SetDefaultRole(r string)
- func (ti *TenantInfo) SetDefaultRoleID(id uint32)
- func (ti *TenantInfo) SetTenantID(id uint32)
- func (ti *TenantInfo) SetUseSecondaryRole(v bool)
- func (ti *TenantInfo) SetUserID(id uint32)
- func (ti *TenantInfo) String() string
- type ThreadInfo
- type Timeout
- type TruncateTableExecutor
- type TxnClient
- type TxnCompilerContext
- func (tcc *TxnCompilerContext) Cost(obj *plan2.ObjectRef, e *plan2.Expr) (cost *plan2.Cost)
- func (tcc *TxnCompilerContext) DatabaseExists(name string) bool
- func (tcc *TxnCompilerContext) DefaultDatabase() string
- func (tcc *TxnCompilerContext) GetAccountId() uint32
- func (tcc *TxnCompilerContext) GetHideKeyDef(dbName string, tableName string) *plan2.ColDef
- func (tcc *TxnCompilerContext) GetPrimaryKeyDef(dbName string, tableName string) []*plan2.ColDef
- func (tcc *TxnCompilerContext) GetQueryType() QueryType
- func (tcc *TxnCompilerContext) GetRootSql() string
- func (tcc *TxnCompilerContext) GetSession() *Session
- func (tcc *TxnCompilerContext) GetTxnHandler() *TxnHandler
- func (tcc *TxnCompilerContext) GetUserName() string
- func (tcc *TxnCompilerContext) Resolve(dbName string, tableName string) (*plan2.ObjectRef, *plan2.TableDef)
- func (tcc *TxnCompilerContext) ResolveVariable(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
- func (tcc *TxnCompilerContext) SetDatabase(db string)
- func (tcc *TxnCompilerContext) SetQueryType(qryTyp QueryType)
- func (tcc *TxnCompilerContext) SetSession(ses *Session)
- type TxnComputationWrapper
- func (cwft *TxnComputationWrapper) Compile(requestCtx context.Context, u interface{}, ...) (interface{}, error)
- func (cwft *TxnComputationWrapper) GetAffectedRows() uint64
- func (cwft *TxnComputationWrapper) GetAst() tree.Statement
- func (cwft *TxnComputationWrapper) GetColumns() ([]interface{}, error)
- func (cwft *TxnComputationWrapper) GetLoadTag() bool
- func (cwft *TxnComputationWrapper) GetProcess() *process.Process
- func (cwft *TxnComputationWrapper) GetUUID() []byte
- func (cwft *TxnComputationWrapper) RecordExecPlan(ctx context.Context) error
- func (cwft *TxnComputationWrapper) Run(ts uint64) error
- func (cwft *TxnComputationWrapper) SetDatabaseName(db string) error
- type TxnHandler
- func (th *TxnHandler) CommitTxn() error
- func (th *TxnHandler) GetSession() *Session
- func (th *TxnHandler) GetStorage() engine.Engine
- func (th *TxnHandler) GetTxn() (TxnOperator, error)
- func (th *TxnHandler) GetTxnClient() TxnClient
- func (th *TxnHandler) GetTxnOnly() TxnOperator
- func (th *TxnHandler) GetTxnOperator() TxnOperator
- func (th *TxnHandler) IsValidTxn() bool
- func (th *TxnHandler) NewTxn() error
- func (th *TxnHandler) RollbackTxn() error
- func (th *TxnHandler) SetInvalid()
- func (th *TxnHandler) SetSession(ses *Session)
- func (th *TxnHandler) TxnClientNew() error
- type TxnOperator
- type TxnOption
- type Uint64List
- type UpdateExecutor
- type UseExecutor
- type WriteBatchHandler
Constants ¶
const ( DefaultReadBufferSize int = 512 DefaultWriteBufferSize int = 512 )
const ( NOTIFY_EVENT_WRITE_BATCH_ERROR notifyEventType = iota NOTIFY_EVENT_WRITE_BATCH_RESULT NOTIFY_EVENT_READ_SIMDCSV_ERROR NOTIFY_EVENT_OUTPUT_SIMDCSV_ERROR NOTIFY_EVENT_END )
const ( Utf8mb4CollationID uint8 = 45 AuthNativePassword string = "mysql_native_password" //the length of the mysql protocol header HeaderLengthOfTheProtocol int = 4 HeaderOffset int = 0 // MaxPayloadSize If the payload is larger than or equal to 2^24−1 bytes the length is set to 2^24−1 (ff ff ff) //and additional packets are sent with the rest of the payload until the payload of a packet //is less than 2^24−1 bytes. MaxPayloadSize uint32 = (1 << 24) - 1 // DefaultMySQLState is the default state of the mySQL DefaultMySQLState string = "HY000" )
const ( CLIENT_LONG_PASSWORD uint32 = 0x00000001 CLIENT_FOUND_ROWS uint32 = 0x00000002 CLIENT_LONG_FLAG uint32 = 0x00000004 CLIENT_CONNECT_WITH_DB uint32 = 0x00000008 CLIENT_NO_SCHEMA uint32 = 0x00000010 CLIENT_COMPRESS uint32 = 0x00000020 CLIENT_LOCAL_FILES uint32 = 0x00000080 CLIENT_IGNORE_SPACE uint32 = 0x00000100 CLIENT_PROTOCOL_41 uint32 = 0x00000200 CLIENT_INTERACTIVE uint32 = 0x00000400 CLIENT_SSL uint32 = 0x00000800 CLIENT_IGNORE_SIGPIPE uint32 = 0x00001000 CLIENT_TRANSACTIONS uint32 = 0x00002000 CLIENT_RESERVED uint32 = 0x00004000 CLIENT_SECURE_CONNECTION uint32 = 0x00008000 CLIENT_MULTI_STATEMENTS uint32 = 0x00010000 CLIENT_MULTI_RESULTS uint32 = 0x00020000 CLIENT_PS_MULTI_RESULTS uint32 = 0x00040000 CLIENT_PLUGIN_AUTH uint32 = 0x00080000 CLIENT_CONNECT_ATTRS uint32 = 0x00100000 CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA uint32 = 0x00200000 CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS uint32 = 0x00400000 CLIENT_SESSION_TRACK uint32 = 0x00800000 CLIENT_DEPRECATE_EOF uint32 = 0x01000000 )
mysql client capabilities
const ( SERVER_STATUS_IN_TRANS uint16 = 0x0001 // A transaction is currently active SERVER_STATUS_AUTOCOMMIT uint16 = 0x0002 // Autocommit mode is set SERVER_MORE_RESULTS_EXISTS uint16 = 0x0008 // More results exists (more packet follow) SERVER_STATUS_NO_GOOD_INDEX_USED uint16 = 0x0010 SERVER_STATUS_NO_INDEX_USED uint16 = 0x0020 SERVER_STATUS_CURSOR_EXISTS uint16 = 0x0040 // When using COM_STMT_FETCH, indicate that current cursor still has result SERVER_STATUS_LAST_ROW_SENT uint16 = 0x0080 // When using COM_STMT_FETCH, indicate that current cursor has finished to send results SERVER_STATUS_DB_DROPPED uint16 = 0x0100 // Database has been dropped SERVER_STATUS_NO_BACKSLASH_ESCAPES uint16 = 0x0200 // Current escape mode is "no backslash escape" SERVER_STATUS_METADATA_CHANGED uint16 = 0x0400 // A DDL change did have an impact on an existing PREPARE (an automatic reprepare has been executed) SERVER_QUERY_WAS_SLOW uint16 = 0x0800 SERVER_PS_OUT_PARAMS uint16 = 0x1000 // This resultset contain stored procedure output parameter SERVER_STATUS_IN_TRANS_READONLY uint16 = 0x2000 // Current transaction is a read-only transaction SERVER_SESSION_STATE_CHANGED uint16 = 0x4000 // Session state change. see Session change type for more information )
server status
const ( OPTION_AUTOCOMMIT uint32 = 1 << 8 OPTION_BIG_SELECTS uint32 = 1 << 9 OPTION_LOG_OFF uint32 = 1 << 10 OPTION_QUOTE_SHOW_CREATE uint32 = 1 << 11 TMP_TABLE_ALL_COLUMNS uint32 = 1 << 12 OPTION_WARNINGS uint32 = 1 << 13 OPTION_AUTO_IS_NULL uint32 = 1 << 14 OPTION_FOUND_COMMENT uint32 = 1 << 15 OPTION_SAFE_UPDATES uint32 = 1 << 16 OPTION_BUFFER_RESULT uint32 = 1 << 17 OPTION_BIN_LOG uint32 = 1 << 18 OPTION_NOT_AUTOCOMMIT uint32 = 1 << 19 OPTION_BEGIN uint32 = 1 << 20 OPTION_TABLE_LOCK uint32 = 1 << 21 OPTION_QUICK uint32 = 1 << 22 OPTION_NO_CONST_TABLES uint32 = 1 << 23 OPTION_ATTACH_ABORT_TRANSACTION_ERROR uint32 = 1 << 24 //defined in mo )
reference to sql/query_options.h in mysql server 8.0.23
const ( // OkResponse OK message OkResponse = iota // ErrorResponse Error message ErrorResponse // EoFResponse EOF message EoFResponse // ResultResponse result message ResultResponse )
Response Categories
const ( TIMEOUT_TYPE_SECOND int = iota TIMEOUT_TYPE_MILLISECOND )
const (
//reference : https://dev.mysql.com/doc/refman/8.0/en/storage-requirements.html#data-types-storage-reqs-strings
MaxMemberCountOfSetType = 64
)
const MaxPrepareNumberInOneSession = 64
const MoDefaultErrorCount = 64
TODO: this variable should be configure by set variable
const NULL_FLAG = "\\N"
const PacketHeaderLength = 4
Variables ¶
var Close = func(ep *tree.ExportParam) error {
return ep.File.Close()
}
var DefaultCapability = CLIENT_LONG_PASSWORD | CLIENT_FOUND_ROWS | CLIENT_LONG_FLAG | CLIENT_CONNECT_WITH_DB | CLIENT_LOCAL_FILES | CLIENT_PROTOCOL_41 | CLIENT_INTERACTIVE | CLIENT_TRANSACTIONS | CLIENT_SECURE_CONNECTION | CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS | CLIENT_PLUGIN_AUTH | CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | CLIENT_DEPRECATE_EOF
DefaultCapability means default capabilities of the server
var DefaultClientConnStatus = SERVER_STATUS_AUTOCOMMIT
DefaultClientConnStatus default server status
var Flush = func(ep *tree.ExportParam) error {
return ep.Writer.Flush()
}
var GetComputationWrapper = func(db, sql, user string, eng engine.Engine, proc *process.Process, ses *Session) ([]ComputationWrapper, error) { var cw []ComputationWrapper = nil var stmts []tree.Statement = nil var cmdFieldStmt *InternalCmdFieldList var err error if isCmdFieldListSql(sql) { cmdFieldStmt, err = parseCmdFieldList(sql) if err != nil { return nil, err } stmts = append(stmts, cmdFieldStmt) } else { stmts, err = parsers.Parse(dialect.MYSQL, sql) if err != nil { return nil, err } } for _, stmt := range stmts { cw = append(cw, InitTxnComputationWrapper(ses, stmt, proc)) } return cw, nil }
GetComputationWrapper gets the execs from the computation engine
var GetStmtExecList = func(db, sql, user string, eng engine.Engine, proc *process.Process, ses *Session) ([]StmtExecutor, error) { var stmtExecList []StmtExecutor = nil var stmtExec StmtExecutor var stmts []tree.Statement = nil var cmdFieldStmt *InternalCmdFieldList var err error appendStmtExec := func(se StmtExecutor) { stmtExecList = append(stmtExecList, se) } if isCmdFieldListSql(sql) { cmdFieldStmt, err = parseCmdFieldList(sql) if err != nil { return nil, err } stmts = append(stmts, cmdFieldStmt) } else { stmts, err = parsers.Parse(dialect.MYSQL, sql) if err != nil { return nil, err } } for _, stmt := range stmts { cw := InitTxnComputationWrapper(ses, stmt, proc) base := &baseStmtExecutor{} base.ComputationWrapper = cw stmtExec, err = getStmtExecutor(ses, proc, base, stmt) if err != nil { return nil, err } appendStmtExec(stmtExec) } return stmtExecList, nil }
var NewBackgroundHandler = func(ctx context.Context, mp *mpool.MPool, pu *config.ParameterUnit) BackgroundExec { bh := &BackgroundHandler{ mce: NewMysqlCmdExecutor(), ses: NewBackgroundSession(ctx, mp, pu, gSysVariables), } return bh }
var OpenFile = os.OpenFile
var PathExists = func(path string) (bool, bool, error) { fi, err := os.Stat(path) if err == nil { return true, !fi.IsDir(), nil } if os.IsNotExist(err) { return false, false, err } return false, false, err }
path exists in the system return: true/false - exists or not. true/false - file or directory error
var Read = func(ep *tree.ExportParam) (int, error) { ep.OutputStr = make([]byte, ep.LineSize) return ep.File.Read(ep.OutputStr) }
var RecordParseErrorStatement = func(ctx context.Context, ses *Session, proc *process.Process, envBegin time.Time, envStmt string, err error) context.Context { if !trace.GetTracerProvider().IsEnable() { return ctx } sessInfo := proc.SessionInfo tenant := ses.GetTenantInfo() if tenant == nil { tenant, _ = GetTenantInfo("internal") } stmID, _ := uuid.NewUUID() var txnID uuid.UUID var txn TxnOperator var err2 error if handler := ses.GetTxnHandler(); handler.IsValidTxn() { txn, err2 = handler.GetTxn() if err2 != nil { logutil.Errorf("RecordParseErrorStatement. error:%v", err2) } else { copy(txnID[:], txn.Txn().ID) } } var sesID uuid.UUID copy(sesID[:], ses.GetUUID()) text := SubStringFromBegin(envStmt, int(ses.GetParameterUnit().SV.LengthOfQueryPrinted)) stm := &trace.StatementInfo{ StatementID: stmID, TransactionID: txnID, SessionID: sesID, Account: tenant.GetTenant(), User: tenant.GetUser(), Host: sessInfo.GetHost(), Database: sessInfo.GetDatabase(), Statement: text, StatementFingerprint: "", StatementTag: "", RequestAt: envBegin, } sc := trace.SpanContextWithID(trace.TraceID(stmID), trace.SpanKindStatement) ctx = trace.ContextWithStatement(trace.ContextWithSpanContext(ctx, sc), stm) trace.EndStatement(ctx, err) incStatementCounter(tenant.GetTenant(), nil) incStatementErrorsCounter(tenant.GetTenant(), nil) return ctx }
var RecordStatement = func(ctx context.Context, ses *Session, proc *process.Process, cw ComputationWrapper, envBegin time.Time, envStmt string, useEnv bool) context.Context { if !trace.GetTracerProvider().IsEnable() { return ctx } sessInfo := proc.SessionInfo tenant := ses.GetTenantInfo() if tenant == nil { tenant, _ = GetTenantInfo("internal") } var stmID uuid.UUID copy(stmID[:], cw.GetUUID()) var txnID uuid.UUID var txn TxnOperator var err error if handler := ses.GetTxnHandler(); handler.IsValidTxn() { txn, err = handler.GetTxn() if err != nil { logutil.Errorf("RecordStatement. error:%v", err) } else { copy(txnID[:], txn.Txn().ID) } } var sesID uuid.UUID copy(sesID[:], ses.GetUUID()) requestAt := envBegin if !useEnv { requestAt = time.Now() } fmtCtx := tree.NewFmtCtx(dialect.MYSQL, tree.WithQuoteString(true)) cw.GetAst().Format(fmtCtx) text := SubStringFromBegin(fmtCtx.String(), int(ses.GetParameterUnit().SV.LengthOfQueryPrinted)) stm := &trace.StatementInfo{ StatementID: stmID, TransactionID: txnID, SessionID: sesID, Account: tenant.GetTenant(), User: tenant.GetUser(), Host: sessInfo.GetHost(), Database: sessInfo.GetDatabase(), Statement: text, StatementFingerprint: "", StatementTag: "", RequestAt: requestAt, } if !stm.IsZeroTxnID() { stm.Report(ctx) } sc := trace.SpanContextWithID(trace.TraceID(stmID), trace.SpanKindStatement) reqCtx := ses.GetRequestContext() ses.SetRequestContext(trace.ContextWithSpanContext(reqCtx, sc)) return trace.ContextWithStatement(trace.ContextWithSpanContext(ctx, sc), stm) }
var RecordStatementTxnID = func(ctx context.Context, ses *Session) { var err error var txn TxnOperator if stm := trace.StatementFromContext(ctx); ses != nil && stm != nil && stm.IsZeroTxnID() { if handler := ses.GetTxnHandler(); handler.IsValidTxn() { txn, err = handler.GetTxn() if err != nil { logutil.Errorf("RecordStatementTxnID. error:%v", err) } else { stm.SetTxnID(txn.Txn().ID) } } stm.Report(ctx) } }
RecordStatementTxnID record txnID after TxnBegin or Compile(autocommit=1)
var Seek = func(ep *tree.ExportParam) (int64, error) { return ep.File.Seek(int64(ep.CurFileSize-ep.LineSize), io.SeekStart) }
var SerializeExecPlan = func(plan any, uuid uuid.UUID) ([]byte, int64, int64) { if plan == nil { return serializePlanToJson(nil, uuid) } else if queryPlan, ok := plan.(*plan2.Plan); !ok { moError := moerr.NewInternalError("execPlan not type of plan2.Plan: %s", reflect.ValueOf(plan).Type().Name()) return buildErrorJsonPlan(uuid, moError.ErrorCode(), moError.Error()), 0, 0 } else { return serializePlanToJson(queryPlan, uuid) } }
SerializeExecPlan Serialize the execution plan by json
var Truncate = func(ep *tree.ExportParam) error { return ep.File.Truncate(int64(ep.CurFileSize - ep.LineSize)) }
var Write = func(ep *tree.ExportParam, output []byte) (int, error) {
return ep.Writer.Write(output)
}
Functions ¶
func AtomicAddDuration ¶
func Execute ¶ added in v0.6.0
func Execute(ctx context.Context, ses *Session, proc *process.Process, stmtExec StmtExecutor, beginInstant time.Time, envStmt string, useEnv bool) error
Execute runs the statement executor
func GetDefaultRole ¶ added in v0.6.0
func GetDefaultRole() string
func GetDefaultTenant ¶ added in v0.6.0
func GetDefaultTenant() string
func GetExplainColumns ¶ added in v0.5.0
func GetPrepareStmtID ¶ added in v0.6.0
func GetSimpleExprValue ¶ added in v0.5.0
only support single value and unary minus
func InitGeneralTenant ¶ added in v0.6.0
InitGeneralTenant initializes the application level tenant
func InitGlobalSystemVariables ¶ added in v0.5.0
func InitGlobalSystemVariables(gsv *GlobalSystemVariables)
initialize system variables from definition
func InitRole ¶ added in v0.6.0
func InitRole(ctx context.Context, ses *Session, tenant *TenantInfo, cr *tree.CreateRole) error
InitRole creates the new role
func InitServerVersion ¶
func InitServerVersion(v string)
func InitSysTenant ¶ added in v0.6.0
InitSysTenant initializes the tenant SYS before any tenants and accepting any requests during the system is booting.
func InitUser ¶ added in v0.6.0
func InitUser(ctx context.Context, ses *Session, tenant *TenantInfo, cu *tree.CreateUser) error
InitUser creates new user for the tenant
func IsAdministrativeStatement ¶ added in v0.6.0
IsAdministrativeStatement checks the statement is the administrative statement.
func IsDropStatement ¶ added in v0.6.0
IsDropStatement checks the statement is the drop statement.
func IsParameterModificationStatement ¶ added in v0.6.0
IsParameterModificationStatement checks the statement is the statement of parameter modification statement.
func IsPrepareStatement ¶ added in v0.6.0
IsPrepareStatement checks the statement is the Prepare statement.
func MakeDebugInfo ¶
MakeDebugInfo prints bytes in multi-lines.
func NeedToBeCommittedInActiveTransaction ¶ added in v0.6.0
NeedToBeCommittedInActiveTransaction checks the statement that need to be committed in an active transaction.
Currently, it includes the drop statement, the administration statement ,
the parameter modification statement.
func NewInternalExecutor ¶ added in v0.6.0
func NewInternalExecutor(pu *config.ParameterUnit) *internalExecutor
func NewOutputQueue ¶ added in v0.6.0
func NewOutputQueue(proto MysqlProtocol, mrs *MysqlResultSet, length uint64, ep *tree.ExportParam, showStatementType ShowStatementType) *outputQueue
func NewSqlCodec ¶
func PrintThreadInfo ¶
func PrintThreadInfo(handler *ParseLineHandler, close *CloseFlag, a time.Duration)
func SetSpecialUser ¶ added in v0.6.0
SetSpecialUser saves the user for initialization !!!NOTE: userName must not contain Colon ':'
func StatementCanBeExecutedInUncommittedTransaction ¶ added in v0.6.0
func StatementCanBeExecutedInUncommittedTransaction(ses *Session, stmt tree.Statement) (bool, error)
StatementCanBeExecutedInUncommittedTransaction checks the statement can be executed in an active transaction.
func SubStringFromBegin ¶
length: -1, complete string. 0, empty string >0 , length of characters at the header of the string.
func WildcardMatch ¶ added in v0.5.0
WildcardMatch implements wildcard pattern match algorithm. pattern and target are ascii characters TODO: add \_ and \%
Types ¶
type AlterAccountExecutor ¶ added in v0.6.0
type AlterAccountExecutor struct {
// contains filtered or unexported fields
}
type AlterUserExecutor ¶ added in v0.6.0
type AlterUserExecutor struct {
// contains filtered or unexported fields
}
type AnalyzeStmtExecutor ¶ added in v0.6.0
type AnalyzeStmtExecutor struct {
// contains filtered or unexported fields
}
func (*AnalyzeStmtExecutor) ExecuteImpl ¶ added in v0.6.0
func (ase *AnalyzeStmtExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (AnalyzeStmtExecutor) ResponseAfterExec ¶ added in v0.6.0
type BackgroundExec ¶ added in v0.6.0
type BackgroundExec interface {
Close()
Exec(context.Context, string) error
GetExecResultSet() []interface{}
ClearExecResultSet()
}
BackgroundExec executes the sql in background session without network output.
type BackgroundHandler ¶ added in v0.6.0
type BackgroundHandler struct {
// contains filtered or unexported fields
}
func (*BackgroundHandler) ClearExecResultSet ¶ added in v0.6.0
func (bh *BackgroundHandler) ClearExecResultSet()
func (*BackgroundHandler) Close ¶ added in v0.6.0
func (bh *BackgroundHandler) Close()
func (*BackgroundHandler) Exec ¶ added in v0.6.0
func (bh *BackgroundHandler) Exec(ctx context.Context, sql string) error
func (*BackgroundHandler) GetExecResultSet ¶ added in v0.6.0
func (bh *BackgroundHandler) GetExecResultSet() []interface{}
type BackgroundSession ¶ added in v0.6.0
type BackgroundSession struct {
*Session
// contains filtered or unexported fields
}
BackgroundSession executing the sql in background
func NewBackgroundSession ¶ added in v0.6.0
func NewBackgroundSession(ctx context.Context, mp *mpool.MPool, PU *config.ParameterUnit, gSysVars *GlobalSystemVariables) *BackgroundSession
NewBackgroundSession generates an independent background session executing the sql
func (*BackgroundSession) Close ¶ added in v0.6.0
func (bgs *BackgroundSession) Close()
type BeginTxnExecutor ¶ added in v0.6.0
type BeginTxnExecutor struct {
// contains filtered or unexported fields
}
func (*BeginTxnExecutor) ExecuteImpl ¶ added in v0.6.0
func (bte *BeginTxnExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type CloseExportData ¶
type CloseExportData struct {
// contains filtered or unexported fields
}
func NewCloseExportData ¶
func NewCloseExportData() *CloseExportData
func (*CloseExportData) Close ¶
func (cld *CloseExportData) Close()
func (*CloseExportData) Open ¶
func (cld *CloseExportData) Open()
type CmdExecutor ¶
type CmdExecutor interface {
PrepareSessionBeforeExecRequest(*Session)
// ExecRequest execute the request and get the response
ExecRequest(context.Context, *Request) (*Response, error)
Close()
}
CmdExecutor handle the command from the client
type CmdExecutorImpl ¶
type CmdExecutorImpl struct {
CmdExecutor
}
type Column ¶
type Column interface {
SetName(string)
Name() string
//data type: MYSQL_TYPE_XXXX
SetColumnType(defines.MysqlType)
ColumnType() defines.MysqlType
//the max count of spaces
SetLength(uint32)
Length() uint32
//unsigned / signed for digital types
//default: signed
//true: signed; false: unsigned
SetSigned(bool)
IsSigned() bool
}
type ColumnImpl ¶
type ColumnImpl struct {
// contains filtered or unexported fields
}
func (*ColumnImpl) ColumnType ¶
func (ci *ColumnImpl) ColumnType() defines.MysqlType
func (*ColumnImpl) Length ¶
func (ci *ColumnImpl) Length() uint32
func (*ColumnImpl) Name ¶
func (ci *ColumnImpl) Name() string
func (*ColumnImpl) SetColumnType ¶
func (ci *ColumnImpl) SetColumnType(colType defines.MysqlType)
func (*ColumnImpl) SetLength ¶
func (ci *ColumnImpl) SetLength(l uint32)
func (*ColumnImpl) SetName ¶
func (ci *ColumnImpl) SetName(name string)
type ColumnInfo ¶ added in v0.5.0
type CommandType ¶ added in v0.6.0
type CommandType uint8
const ( COM_SLEEP CommandType = 0x00 COM_QUIT CommandType = 0x01 COM_INIT_DB CommandType = 0x02 COM_QUERY CommandType = 0x03 COM_FIELD_LIST CommandType = 0x04 COM_CREATE_DB CommandType = 0x05 COM_DROP_DB CommandType = 0x06 COM_REFRESH CommandType = 0x07 COM_SHUTDOWN CommandType = 0x08 COM_STATISTICS CommandType = 0x09 COM_PROCESS_INFO CommandType = 0x0a COM_CONNECT CommandType = 0x0b COM_PROCESS_KILL CommandType = 0x0c COM_DEBUG CommandType = 0x0d COM_PING CommandType = 0x0e COM_TIME CommandType = 0x0f COM_DELAYED_INSERT CommandType = 0x10 COM_CHANGE_USER CommandType = 0x11 COM_STMT_PREPARE CommandType = 0x16 COM_STMT_EXECUTE CommandType = 0x17 COM_STMT_SEND_LONG_DATA CommandType = 0x18 COM_STMT_CLOSE CommandType = 0x19 COM_STMT_RESET CommandType = 0x1a COM_SET_OPTION CommandType = 0x1b COM_STMT_FETCH CommandType = 0x1c COM_DAEMON CommandType = 0x1d COM_RESET_CONNECTION CommandType = 0x1f )
text protocol in mysql client protocol iteration command
func (CommandType) String ¶ added in v0.6.0
func (ct CommandType) String() string
type CommitTxnExecutor ¶ added in v0.6.0
type CommitTxnExecutor struct {
// contains filtered or unexported fields
}
func (*CommitTxnExecutor) ExecuteImpl ¶ added in v0.6.0
func (cte *CommitTxnExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type ComputationRunner ¶ added in v0.5.0
type ComputationWrapper ¶
type ComputationWrapper interface {
ComputationRunner
GetAst() tree.Statement
GetProcess() *process.Process
SetDatabaseName(db string) error
GetColumns() ([]interface{}, error)
GetAffectedRows() uint64
Compile(requestCtx context.Context, u interface{}, fill func(interface{}, *batch.Batch) error) (interface{}, error)
GetUUID() []byte
RecordExecPlan(ctx context.Context) error
GetLoadTag() bool
}
ComputationWrapper is the wrapper of the computation
type CreateAccountExecutor ¶ added in v0.6.0
type CreateAccountExecutor struct {
// contains filtered or unexported fields
}
func (*CreateAccountExecutor) ExecuteImpl ¶ added in v0.6.0
func (cae *CreateAccountExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type CreateDatabaseExecutor ¶ added in v0.6.0
type CreateDatabaseExecutor struct {
// contains filtered or unexported fields
}
type CreateIndexExecutor ¶ added in v0.6.0
type CreateIndexExecutor struct {
// contains filtered or unexported fields
}
type CreateRoleExecutor ¶ added in v0.6.0
type CreateRoleExecutor struct {
// contains filtered or unexported fields
}
func (*CreateRoleExecutor) ExecuteImpl ¶ added in v0.6.0
func (cre *CreateRoleExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type CreateTableExecutor ¶ added in v0.6.0
type CreateTableExecutor struct {
// contains filtered or unexported fields
}
type CreateUserExecutor ¶ added in v0.6.0
type CreateUserExecutor struct {
// contains filtered or unexported fields
}
func (*CreateUserExecutor) ExecuteImpl ¶ added in v0.6.0
func (cue *CreateUserExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type CreateViewExecutor ¶ added in v0.6.0
type CreateViewExecutor struct {
// contains filtered or unexported fields
}
type DeallocateExecutor ¶ added in v0.6.0
type DeallocateExecutor struct {
// contains filtered or unexported fields
}
TODO: DeallocateExecutor has no response like QUIT COMMAND ?
func (*DeallocateExecutor) ExecuteImpl ¶ added in v0.6.0
func (de *DeallocateExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (*DeallocateExecutor) ResponseAfterExec ¶ added in v0.6.0
func (de *DeallocateExecutor) ResponseAfterExec(ctx context.Context, ses *Session) error
type DebugCounter ¶
type DebugCounter struct {
Cf CloseFlag
// contains filtered or unexported fields
}
func NewDebugCounter ¶
func NewDebugCounter(l int) *DebugCounter
func (*DebugCounter) Add ¶
func (dc *DebugCounter) Add(i int, v uint64)
func (*DebugCounter) DCRoutine ¶
func (dc *DebugCounter) DCRoutine()
func (*DebugCounter) Get ¶
func (dc *DebugCounter) Get(i int) uint64
func (*DebugCounter) Len ¶
func (dc *DebugCounter) Len() int
func (*DebugCounter) Set ¶
func (dc *DebugCounter) Set(i int, v uint64)
type DeleteExecutor ¶ added in v0.6.0
type DeleteExecutor struct {
// contains filtered or unexported fields
}
type DropAccountExecutor ¶ added in v0.6.0
type DropAccountExecutor struct {
// contains filtered or unexported fields
}
func (*DropAccountExecutor) ExecuteImpl ¶ added in v0.6.0
func (dae *DropAccountExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type DropDatabaseExecutor ¶ added in v0.6.0
type DropDatabaseExecutor struct {
// contains filtered or unexported fields
}
func (*DropDatabaseExecutor) ExecuteImpl ¶ added in v0.6.0
func (dde *DropDatabaseExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type DropIndexExecutor ¶ added in v0.6.0
type DropIndexExecutor struct {
// contains filtered or unexported fields
}
type DropRoleExecutor ¶ added in v0.6.0
type DropRoleExecutor struct {
// contains filtered or unexported fields
}
func (*DropRoleExecutor) ExecuteImpl ¶ added in v0.6.0
func (dre *DropRoleExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type DropTableExecutor ¶ added in v0.6.0
type DropTableExecutor struct {
// contains filtered or unexported fields
}
type DropUserExecutor ¶ added in v0.6.0
type DropUserExecutor struct {
// contains filtered or unexported fields
}
func (*DropUserExecutor) ExecuteImpl ¶ added in v0.6.0
func (due *DropUserExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type DropViewExecutor ¶ added in v0.6.0
type DropViewExecutor struct {
// contains filtered or unexported fields
}
type ExecResult ¶ added in v0.6.0
type ExecResult interface {
GetRowCount() uint64
GetString(rindex, cindex uint64) (string, error)
GetUint64(rindex, cindex uint64) (uint64, error)
GetInt64(rindex, cindex uint64) (int64, error)
}
ExecResult is the result interface of the execution
type ExecuteExecutor ¶ added in v0.6.0
type ExecuteExecutor struct {
// contains filtered or unexported fields
}
func (*ExecuteExecutor) Close ¶ added in v0.6.0
func (ee *ExecuteExecutor) Close(ctx context.Context, ses *Session) error
func (*ExecuteExecutor) CommitOrRollbackTxn ¶ added in v0.6.0
func (ee *ExecuteExecutor) CommitOrRollbackTxn(ctx context.Context, ses *Session) error
func (*ExecuteExecutor) ExecuteImpl ¶ added in v0.6.0
func (ee *ExecuteExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (ExecuteExecutor) GetStatus ¶ added in v0.6.0
func (bse ExecuteExecutor) GetStatus() stmtExecStatus
func (*ExecuteExecutor) ResponseAfterExec ¶ added in v0.6.0
func (ee *ExecuteExecutor) ResponseAfterExec(ctx context.Context, ses *Session) error
func (*ExecuteExecutor) ResponseBeforeExec ¶ added in v0.6.0
func (ee *ExecuteExecutor) ResponseBeforeExec(ctx context.Context, ses *Session) error
func (ExecuteExecutor) VerifyPrivilege ¶ added in v0.6.0
type ExplainAnalyzeExecutor ¶ added in v0.6.0
type ExplainAnalyzeExecutor struct {
// contains filtered or unexported fields
}
func (*ExplainAnalyzeExecutor) ExecuteImpl ¶ added in v0.6.0
func (eae *ExplainAnalyzeExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (ExplainAnalyzeExecutor) ResponseAfterExec ¶ added in v0.6.0
func (ExplainAnalyzeExecutor) ResponseBeforeExec ¶ added in v0.6.0
type ExplainForExecutor ¶ added in v0.6.0
type ExplainForExecutor struct {
// contains filtered or unexported fields
}
func (ExplainForExecutor) ResponseAfterExec ¶ added in v0.6.0
type ExplainStmtExecutor ¶ added in v0.6.0
type ExplainStmtExecutor struct {
// contains filtered or unexported fields
}
func (*ExplainStmtExecutor) ExecuteImpl ¶ added in v0.6.0
func (ese *ExplainStmtExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (ExplainStmtExecutor) ResponseAfterExec ¶ added in v0.6.0
type FakeProtocol ¶ added in v0.6.0
type FakeProtocol struct {
// contains filtered or unexported fields
}
FakeProtocol works for the background transaction that does not use the network protocol.
func (*FakeProtocol) ConnectionID ¶ added in v0.6.0
func (fp *FakeProtocol) ConnectionID() uint32
func (*FakeProtocol) GetDatabaseName ¶ added in v0.6.0
func (fp *FakeProtocol) GetDatabaseName() string
func (*FakeProtocol) GetRequest ¶ added in v0.6.0
func (fp *FakeProtocol) GetRequest(payload []byte) *Request
func (*FakeProtocol) GetStats ¶ added in v0.6.0
func (fp *FakeProtocol) GetStats() string
func (*FakeProtocol) GetUserName ¶ added in v0.6.0
func (fp *FakeProtocol) GetUserName() string
func (*FakeProtocol) IsEstablished ¶ added in v0.6.0
func (fp *FakeProtocol) IsEstablished() bool
func (*FakeProtocol) ParseExecuteData ¶ added in v0.6.0
func (fp *FakeProtocol) ParseExecuteData(stmt *PrepareStmt, data []byte, pos int) (names []string, vars []any, err error)
func (*FakeProtocol) Peer ¶ added in v0.6.0
func (fp *FakeProtocol) Peer() (string, string, string, string)
func (*FakeProtocol) PrepareBeforeProcessingResultSet ¶ added in v0.6.0
func (fp *FakeProtocol) PrepareBeforeProcessingResultSet()
func (*FakeProtocol) Quit ¶ added in v0.6.0
func (fp *FakeProtocol) Quit()
func (*FakeProtocol) SendColumnCountPacket ¶ added in v0.6.0
func (fp *FakeProtocol) SendColumnCountPacket(count uint64) error
func (*FakeProtocol) SendColumnDefinitionPacket ¶ added in v0.6.0
func (fp *FakeProtocol) SendColumnDefinitionPacket(column Column, cmd int) error
func (*FakeProtocol) SendEOFPacketIf ¶ added in v0.6.0
func (fp *FakeProtocol) SendEOFPacketIf(warnings uint16, status uint16) error
func (*FakeProtocol) SendPrepareResponse ¶ added in v0.6.0
func (fp *FakeProtocol) SendPrepareResponse(stmt *PrepareStmt) error
func (*FakeProtocol) SendResponse ¶ added in v0.6.0
func (fp *FakeProtocol) SendResponse(response *Response) error
func (*FakeProtocol) SendResultSetTextBatchRow ¶ added in v0.6.0
func (fp *FakeProtocol) SendResultSetTextBatchRow(mrs *MysqlResultSet, cnt uint64) error
func (*FakeProtocol) SendResultSetTextBatchRowSpeedup ¶ added in v0.6.0
func (fp *FakeProtocol) SendResultSetTextBatchRowSpeedup(mrs *MysqlResultSet, cnt uint64) error
func (*FakeProtocol) SetDatabaseName ¶ added in v0.6.0
func (fp *FakeProtocol) SetDatabaseName(s string)
func (*FakeProtocol) SetEstablished ¶ added in v0.6.0
func (fp *FakeProtocol) SetEstablished()
func (*FakeProtocol) SetUserName ¶ added in v0.6.0
func (fp *FakeProtocol) SetUserName(s string)
type GlobalSystemVariables ¶ added in v0.5.0
type GlobalSystemVariables struct {
// contains filtered or unexported fields
}
func (*GlobalSystemVariables) AddSysVariables ¶ added in v0.5.0
func (gsv *GlobalSystemVariables) AddSysVariables(vars []SystemVariable)
add custom system variables
func (*GlobalSystemVariables) CopySysVarsToSession ¶ added in v0.5.0
func (gsv *GlobalSystemVariables) CopySysVarsToSession() map[string]interface{}
copy global system variable to session
func (*GlobalSystemVariables) GetDefinitionOfSysVar ¶ added in v0.5.0
func (gsv *GlobalSystemVariables) GetDefinitionOfSysVar(name string) (SystemVariable, bool)
get the definition of the system variable
func (*GlobalSystemVariables) GetGlobalSysVar ¶ added in v0.5.0
func (gsv *GlobalSystemVariables) GetGlobalSysVar(name string) (SystemVariable, interface{}, bool)
get system variable definition ,value. return false, if there is no such variable.
func (*GlobalSystemVariables) SetGlobalSysVar ¶ added in v0.5.0
func (gsv *GlobalSystemVariables) SetGlobalSysVar(name string, value interface{}) error
set global dynamic variable by SET GLOBAL
func (*GlobalSystemVariables) SetValues ¶ added in v0.5.0
func (gsv *GlobalSystemVariables) SetValues(values map[string]interface{}) error
set values to system variables
type GrantExecutor ¶ added in v0.6.0
type GrantExecutor struct {
// contains filtered or unexported fields
}
func (*GrantExecutor) ExecuteImpl ¶ added in v0.6.0
func (ge *GrantExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type IOPackage ¶
type IOPackage interface {
// IsLittleEndian the byte order
//true - littleEndian; false - littleEndian
IsLittleEndian() bool
// WriteUint8 writes an uint8 into the buffer at the position
// returns position + 1
WriteUint8([]byte, int, uint8) int
// WriteUint16 writes an uint16 into the buffer at the position
// returns position + 2
WriteUint16([]byte, int, uint16) int
// WriteUint32 writes an uint32 into the buffer at the position
// returns position + 4
WriteUint32([]byte, int, uint32) int
// WriteUint64 writes an uint64 into the buffer at the position
// returns position + 8
WriteUint64([]byte, int, uint64) int
// AppendUint8 appends an uint8 to the buffer
// returns the buffer
AppendUint8([]byte, uint8) []byte
// AppendUint16 appends an uint16 to the buffer
// returns the buffer
AppendUint16([]byte, uint16) []byte
// AppendUint32 appends an uint32 to the buffer
// returns the buffer
AppendUint32([]byte, uint32) []byte
// AppendUint64 appends an uint64 to the buffer
// returns the buffer
AppendUint64([]byte, uint64) []byte
// ReadUint8 reads an uint8 from the buffer at the position
// returns uint8 value ; pos+1 ; true - decoded successfully or false - failed
ReadUint8([]byte, int) (uint8, int, bool)
// ReadUint16 reads an uint16 from the buffer at the position
// returns uint16 value ; pos+2 ; true - decoded successfully or false - failed
ReadUint16([]byte, int) (uint16, int, bool)
// ReadUint32 reads an uint32 from the buffer at the position
// returns uint32 value ; pos+4 ; true - decoded successfully or false - failed
ReadUint32([]byte, int) (uint32, int, bool)
// ReadUint64 reads an uint64 from the buffer at the position
// returns uint64 value ; pos+8 ; true - decoded successfully or false - failed
ReadUint64([]byte, int) (uint64, int, bool)
}
type IOPackageImpl ¶
type IOPackageImpl struct {
// contains filtered or unexported fields
}
IOPackageImpl implements the IOPackage for the basic interaction in the connection
func NewIOPackage ¶
func NewIOPackage(littleEndian bool) *IOPackageImpl
func (*IOPackageImpl) AppendUint16 ¶
func (bio *IOPackageImpl) AppendUint16(data []byte, value uint16) []byte
func (*IOPackageImpl) AppendUint32 ¶
func (bio *IOPackageImpl) AppendUint32(data []byte, value uint32) []byte
func (*IOPackageImpl) AppendUint64 ¶
func (bio *IOPackageImpl) AppendUint64(data []byte, value uint64) []byte
func (*IOPackageImpl) AppendUint8 ¶
func (bio *IOPackageImpl) AppendUint8(data []byte, value uint8) []byte
func (*IOPackageImpl) IsLittleEndian ¶
func (bio *IOPackageImpl) IsLittleEndian() bool
func (*IOPackageImpl) ReadUint16 ¶
func (*IOPackageImpl) ReadUint32 ¶
func (*IOPackageImpl) ReadUint64 ¶
func (*IOPackageImpl) WriteUint16 ¶
func (bio *IOPackageImpl) WriteUint16(data []byte, pos int, value uint16) int
func (*IOPackageImpl) WriteUint32 ¶
func (bio *IOPackageImpl) WriteUint32(data []byte, pos int, value uint32) int
func (*IOPackageImpl) WriteUint64 ¶
func (bio *IOPackageImpl) WriteUint64(data []byte, pos int, value uint64) int
func (*IOPackageImpl) WriteUint8 ¶
func (bio *IOPackageImpl) WriteUint8(data []byte, pos int, value uint8) int
type ImportExecutor ¶ added in v0.6.0
type ImportExecutor struct {
// contains filtered or unexported fields
}
func (*ImportExecutor) CommitOrRollbackTxn ¶ added in v0.6.0
func (ie *ImportExecutor) CommitOrRollbackTxn(ctx context.Context, ses *Session) error
func (*ImportExecutor) ExecuteImpl ¶ added in v0.6.0
func (ie *ImportExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (*ImportExecutor) ResponseAfterExec ¶ added in v0.6.0
func (ie *ImportExecutor) ResponseAfterExec(ctx context.Context, ses *Session) error
type InsertExecutor ¶ added in v0.6.0
type InsertExecutor struct {
// contains filtered or unexported fields
}
func (*InsertExecutor) ResponseAfterExec ¶ added in v0.6.0
func (ie *InsertExecutor) ResponseAfterExec(ctx context.Context, ses *Session) error
type InternalCmdFieldList ¶ added in v0.6.0
type InternalCmdFieldList struct {
// contains filtered or unexported fields
}
InternalCmdFieldList the CMD_FIELD_LIST statement
func (*InternalCmdFieldList) Format ¶ added in v0.6.0
func (icfl *InternalCmdFieldList) Format(ctx *tree.FmtCtx)
func (*InternalCmdFieldList) String ¶ added in v0.6.0
func (icfl *InternalCmdFieldList) String() string
type InternalCmdFieldListExecutor ¶ added in v0.6.0
type InternalCmdFieldListExecutor struct {
// contains filtered or unexported fields
}
func (*InternalCmdFieldListExecutor) ExecuteImpl ¶ added in v0.6.0
func (icfle *InternalCmdFieldListExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (*InternalCmdFieldListExecutor) ResponseAfterExec ¶ added in v0.6.0
func (icfle *InternalCmdFieldListExecutor) ResponseAfterExec(ctx context.Context, ses *Session) error
func (*InternalCmdFieldListExecutor) ResponseBeforeExec ¶ added in v0.6.0
func (icfle *InternalCmdFieldListExecutor) ResponseBeforeExec(ctx context.Context, ses *Session) error
type LoadExecutor ¶ added in v0.6.0
type LoadExecutor struct {
// contains filtered or unexported fields
}
func (*LoadExecutor) CommitOrRollbackTxn ¶ added in v0.6.0
func (le *LoadExecutor) CommitOrRollbackTxn(ctx context.Context, ses *Session) error
type LoadResult ¶
type LoadResult struct {
Records, Deleted, Skipped, Warnings, WriteTimeout uint64
}
func LoadLoop ¶ added in v0.6.0
func LoadLoop(requestCtx context.Context, ses *Session, proc *process.Process, load *tree.Import, dbHandler engine.Database, tableHandler engine.Relation, dbName string) (*LoadResult, error)
LoadLoop reads data from stream, extracts the fields, and saves into the table
type MOServer ¶
type MOServer struct {
// contains filtered or unexported fields
}
MOServer MatrixOne Server
func NewMOServer ¶
type MysqlCmdExecutor ¶
type MysqlCmdExecutor struct {
CmdExecutorImpl
//for cmd 0x4
TableInfoCache
// contains filtered or unexported fields
}
func NewMysqlCmdExecutor ¶
func NewMysqlCmdExecutor() *MysqlCmdExecutor
func (*MysqlCmdExecutor) ChooseDoQueryFunc ¶ added in v0.6.0
func (mce *MysqlCmdExecutor) ChooseDoQueryFunc(choice bool)
func (*MysqlCmdExecutor) Close ¶
func (mce *MysqlCmdExecutor) Close()
func (*MysqlCmdExecutor) ExecRequest ¶
func (mce *MysqlCmdExecutor) ExecRequest(requestCtx context.Context, req *Request) (resp *Response, err error)
ExecRequest the server execute the commands from the client following the mysql's routine
func (*MysqlCmdExecutor) GetDoQueryFunc ¶ added in v0.6.0
func (mce *MysqlCmdExecutor) GetDoQueryFunc() doComQueryFunc
func (*MysqlCmdExecutor) GetRoutineManager ¶
func (mce *MysqlCmdExecutor) GetRoutineManager() *RoutineManager
func (*MysqlCmdExecutor) GetSession ¶
func (mce *MysqlCmdExecutor) GetSession() *Session
func (*MysqlCmdExecutor) GetSqlCount ¶ added in v0.6.0
func (mce *MysqlCmdExecutor) GetSqlCount() uint64
func (*MysqlCmdExecutor) PrepareSessionBeforeExecRequest ¶
func (mce *MysqlCmdExecutor) PrepareSessionBeforeExecRequest(ses *Session)
func (*MysqlCmdExecutor) SetRoutineManager ¶
func (mce *MysqlCmdExecutor) SetRoutineManager(mgr *RoutineManager)
type MysqlColumn ¶
type MysqlColumn struct {
ColumnImpl
// contains filtered or unexported fields
}
func (*MysqlColumn) Charset ¶
func (mc *MysqlColumn) Charset() uint16
func (*MysqlColumn) Decimal ¶
func (mc *MysqlColumn) Decimal() uint8
func (*MysqlColumn) DefaultValue ¶
func (mc *MysqlColumn) DefaultValue() []byte
func (*MysqlColumn) Flag ¶
func (mc *MysqlColumn) Flag() uint16
func (*MysqlColumn) GetAutoIncr ¶ added in v0.6.0
func (mc *MysqlColumn) GetAutoIncr() bool
func (*MysqlColumn) IsSigned ¶
func (mc *MysqlColumn) IsSigned() bool
func (*MysqlColumn) OrgName ¶
func (mc *MysqlColumn) OrgName() string
func (*MysqlColumn) OrgTable ¶
func (mc *MysqlColumn) OrgTable() string
func (*MysqlColumn) Schema ¶
func (mc *MysqlColumn) Schema() string
func (*MysqlColumn) SetAutoIncr ¶ added in v0.6.0
func (mc *MysqlColumn) SetAutoIncr(s bool)
func (*MysqlColumn) SetCharset ¶
func (mc *MysqlColumn) SetCharset(charset uint16)
func (*MysqlColumn) SetDecimal ¶
func (mc *MysqlColumn) SetDecimal(decimal uint8)
func (*MysqlColumn) SetDefaultValue ¶
func (mc *MysqlColumn) SetDefaultValue(defaultValue []byte)
func (*MysqlColumn) SetFlag ¶
func (mc *MysqlColumn) SetFlag(flag uint16)
func (*MysqlColumn) SetOrgName ¶
func (mc *MysqlColumn) SetOrgName(orgName string)
func (*MysqlColumn) SetOrgTable ¶
func (mc *MysqlColumn) SetOrgTable(orgTable string)
func (*MysqlColumn) SetSchema ¶
func (mc *MysqlColumn) SetSchema(schema string)
func (*MysqlColumn) SetSigned ¶
func (mc *MysqlColumn) SetSigned(s bool)
func (*MysqlColumn) SetTable ¶
func (mc *MysqlColumn) SetTable(table string)
func (*MysqlColumn) Table ¶
func (mc *MysqlColumn) Table() string
type MysqlExecutionResult ¶
type MysqlExecutionResult struct {
// contains filtered or unexported fields
}
the result of the execution
func NewMysqlExecutionResult ¶
func NewMysqlExecutionResult(status uint16, insertid, rows uint64, warnings uint16, mrs *MysqlResultSet) *MysqlExecutionResult
func (*MysqlExecutionResult) AffectedRows ¶
func (mer *MysqlExecutionResult) AffectedRows() uint64
func (*MysqlExecutionResult) InsertID ¶
func (mer *MysqlExecutionResult) InsertID() uint64
func (*MysqlExecutionResult) Mrs ¶
func (mer *MysqlExecutionResult) Mrs() *MysqlResultSet
func (*MysqlExecutionResult) SetAffectedRows ¶
func (mer *MysqlExecutionResult) SetAffectedRows(affectedRows uint64)
func (*MysqlExecutionResult) SetInsertID ¶
func (mer *MysqlExecutionResult) SetInsertID(insertID uint64)
func (*MysqlExecutionResult) SetMrs ¶
func (mer *MysqlExecutionResult) SetMrs(mrs *MysqlResultSet)
func (*MysqlExecutionResult) SetStatus ¶
func (mer *MysqlExecutionResult) SetStatus(status uint16)
func (*MysqlExecutionResult) SetWarnings ¶
func (mer *MysqlExecutionResult) SetWarnings(warnings uint16)
func (*MysqlExecutionResult) Status ¶
func (mer *MysqlExecutionResult) Status() uint16
func (*MysqlExecutionResult) Warnings ¶
func (mer *MysqlExecutionResult) Warnings() uint16
type MysqlProtocol ¶
type MysqlProtocol interface {
Protocol
//the server send group row of the result set as an independent packet thread safe
SendResultSetTextBatchRow(mrs *MysqlResultSet, cnt uint64) error
SendResultSetTextBatchRowSpeedup(mrs *MysqlResultSet, cnt uint64) error
//SendColumnDefinitionPacket the server send the column definition to the client
SendColumnDefinitionPacket(column Column, cmd int) error
//SendColumnCountPacket makes the column count packet
SendColumnCountPacket(count uint64) error
SendResponse(resp *Response) error
SendEOFPacketIf(warnings uint16, status uint16) error
PrepareBeforeProcessingResultSet()
GetStats() string
ParseExecuteData(stmt *PrepareStmt, data []byte, pos int) (names []string, vars []any, err error)
// contains filtered or unexported methods
}
type MysqlProtocolImpl ¶
type MysqlProtocolImpl struct {
ProtocolImpl
SV *config.FrontendParameters
// contains filtered or unexported fields
}
func NewMysqlClientProtocol ¶
func NewMysqlClientProtocol(connectionID uint32, tcp goetty.IOSession, maxBytesToFlush int, SV *config.FrontendParameters) *MysqlProtocolImpl
func (*MysqlProtocolImpl) AddSequenceId ¶ added in v0.6.0
func (mp *MysqlProtocolImpl) AddSequenceId(a uint8)
func (*MysqlProtocolImpl) GetCapability ¶ added in v0.6.0
func (mp *MysqlProtocolImpl) GetCapability() uint32
func (*MysqlProtocolImpl) GetDatabaseName ¶
func (mp *MysqlProtocolImpl) GetDatabaseName() string
func (*MysqlProtocolImpl) GetRequest ¶
func (mp *MysqlProtocolImpl) GetRequest(payload []byte) *Request
func (*MysqlProtocolImpl) GetSequenceId ¶ added in v0.6.0
func (mp *MysqlProtocolImpl) GetSequenceId() uint8
func (*MysqlProtocolImpl) GetSession ¶ added in v0.6.0
func (mp *MysqlProtocolImpl) GetSession() *Session
func (*MysqlProtocolImpl) GetSkipCheckUser ¶ added in v0.6.0
func (mp *MysqlProtocolImpl) GetSkipCheckUser() bool
func (*MysqlProtocolImpl) GetStats ¶
func (mp *MysqlProtocolImpl) GetStats() string
func (*MysqlProtocolImpl) GetUserName ¶
func (mp *MysqlProtocolImpl) GetUserName() string
func (*MysqlProtocolImpl) ParseExecuteData ¶ added in v0.6.0
func (mp *MysqlProtocolImpl) ParseExecuteData(stmt *PrepareStmt, data []byte, pos int) (names []string, vars []any, err error)
func (*MysqlProtocolImpl) PrepareBeforeProcessingResultSet ¶
func (mp *MysqlProtocolImpl) PrepareBeforeProcessingResultSet()
func (*MysqlProtocolImpl) Quit ¶
func (mp *MysqlProtocolImpl) Quit()
func (*MysqlProtocolImpl) ResetStats ¶
func (ds *MysqlProtocolImpl) ResetStats()
func (*MysqlProtocolImpl) SendColumnCountPacket ¶
func (mp *MysqlProtocolImpl) SendColumnCountPacket(count uint64) error
SendColumnCountPacket makes the column count packet
func (*MysqlProtocolImpl) SendColumnDefinitionPacket ¶
func (mp *MysqlProtocolImpl) SendColumnDefinitionPacket(column Column, cmd int) error
SendColumnDefinitionPacket the server send the column definition to the client
func (*MysqlProtocolImpl) SendEOFPacketIf ¶
func (mp *MysqlProtocolImpl) SendEOFPacketIf(warnings, status uint16) error
func (*MysqlProtocolImpl) SendPrepareResponse ¶ added in v0.6.0
func (mp *MysqlProtocolImpl) SendPrepareResponse(stmt *PrepareStmt) error
func (*MysqlProtocolImpl) SendResponse ¶
func (mp *MysqlProtocolImpl) SendResponse(resp *Response) error
func (*MysqlProtocolImpl) SendResultSetTextBatchRow ¶
func (mp *MysqlProtocolImpl) SendResultSetTextBatchRow(mrs *MysqlResultSet, cnt uint64) error
the server send group row of the result set as an independent packet thread safe
func (*MysqlProtocolImpl) SendResultSetTextBatchRowSpeedup ¶
func (mp *MysqlProtocolImpl) SendResultSetTextBatchRowSpeedup(mrs *MysqlResultSet, cnt uint64) error
func (*MysqlProtocolImpl) SendResultSetTextRow ¶
func (mp *MysqlProtocolImpl) SendResultSetTextRow(mrs *MysqlResultSet, r uint64) error
the server send every row of the result set as an independent packet thread safe
func (*MysqlProtocolImpl) SetDatabaseName ¶
func (mp *MysqlProtocolImpl) SetDatabaseName(s string)
func (*MysqlProtocolImpl) SetSequenceID ¶ added in v0.6.0
func (mp *MysqlProtocolImpl) SetSequenceID(value uint8)
func (*MysqlProtocolImpl) SetSession ¶ added in v0.6.0
func (mp *MysqlProtocolImpl) SetSession(ses *Session)
func (*MysqlProtocolImpl) SetSkipCheckUser ¶ added in v0.6.0
func (mp *MysqlProtocolImpl) SetSkipCheckUser(b bool)
func (*MysqlProtocolImpl) SetUserName ¶
func (mp *MysqlProtocolImpl) SetUserName(s string)
type MysqlResultSet ¶
type MysqlResultSet struct {
//column information
Columns []Column
//column name --> column index
Name2Index map[string]uint64
//data
Data [][]interface{}
}
Discussion: for some MatrixOne types, the Type.Precision and Type.Scale value are needed for stringification, I think we need to add a field MoTypes []types.Type in this struct, what's your opinion on this matter?@Daviszhen
func (*MysqlResultSet) AddColumn ¶
func (mrs *MysqlResultSet) AddColumn(column Column) uint64
func (*MysqlResultSet) AddRow ¶
func (mrs *MysqlResultSet) AddRow(row []interface{}) uint64
func (*MysqlResultSet) ColumnIsNull ¶
func (mrs *MysqlResultSet) ColumnIsNull(rindex, cindex uint64) (bool, error)
the value in position (rindex,cindex) is null or not return true - null ; false - not null
func (*MysqlResultSet) GetColumn ¶
func (mrs *MysqlResultSet) GetColumn(index uint64) (Column, error)
func (*MysqlResultSet) GetColumnCount ¶
func (mrs *MysqlResultSet) GetColumnCount() uint64
func (*MysqlResultSet) GetFloat64 ¶
func (mrs *MysqlResultSet) GetFloat64(rindex, cindex uint64) (float64, error)
convert the value into Float64
func (*MysqlResultSet) GetInt64 ¶
func (mrs *MysqlResultSet) GetInt64(rindex, cindex uint64) (int64, error)
convert the value into int64
func (*MysqlResultSet) GetRow ¶
func (mrs *MysqlResultSet) GetRow(index uint64) ([]interface{}, error)
func (*MysqlResultSet) GetRowCount ¶
func (mrs *MysqlResultSet) GetRowCount() uint64
func (*MysqlResultSet) GetString ¶
func (mrs *MysqlResultSet) GetString(rindex, cindex uint64) (string, error)
convert the value into string
func (*MysqlResultSet) GetUint64 ¶
func (mrs *MysqlResultSet) GetUint64(rindex, cindex uint64) (uint64, error)
convert the value into uint64
func (*MysqlResultSet) GetValue ¶
func (mrs *MysqlResultSet) GetValue(rindex uint64, cindex uint64) (interface{}, error)
func (*MysqlResultSet) GetValueByName ¶
func (mrs *MysqlResultSet) GetValueByName(rindex uint64, colName string) (interface{}, error)
type NullComputationWrapper ¶ added in v0.6.0
type NullComputationWrapper struct {
*TxnComputationWrapper
}
func InitNullComputationWrapper ¶ added in v0.6.0
func (*NullComputationWrapper) GetAffectedRows ¶ added in v0.6.0
func (ncw *NullComputationWrapper) GetAffectedRows() uint64
func (*NullComputationWrapper) GetAst ¶ added in v0.6.0
func (ncw *NullComputationWrapper) GetAst() tree.Statement
func (*NullComputationWrapper) GetColumns ¶ added in v0.6.0
func (ncw *NullComputationWrapper) GetColumns() ([]interface{}, error)
func (*NullComputationWrapper) GetLoadTag ¶ added in v0.6.0
func (ncw *NullComputationWrapper) GetLoadTag() bool
func (*NullComputationWrapper) GetUUID ¶ added in v0.6.0
func (ncw *NullComputationWrapper) GetUUID() []byte
func (*NullComputationWrapper) RecordExecPlan ¶ added in v0.6.0
func (ncw *NullComputationWrapper) RecordExecPlan(ctx context.Context) error
func (*NullComputationWrapper) Run ¶ added in v0.6.0
func (ncw *NullComputationWrapper) Run(ts uint64) error
func (*NullComputationWrapper) SetDatabaseName ¶ added in v0.6.0
func (ncw *NullComputationWrapper) SetDatabaseName(db string) error
type OperatorProfiler ¶
type OperatorProfiler interface {
//start the statistics for the operator
StartOperator(operator interface{})
//end the statistics for the operator
EndOperator()
//add the operator into the profiler
AddOperator(operator interface{})
//convert the operator info into the string
ToString() string
}
OperatorProfiler : operator statistics
type ParseLineHandler ¶
type ParseLineHandler struct {
DebugTime
// contains filtered or unexported fields
}
type PhaseProfiler ¶
type PhaseProfiler interface {
/**
start the statistics for the phase.
name: the name of the phase
*/
StartPhase(name string)
/**
stop the statistics for the phase
*/
EndPhase()
// ToString convert the phase info into the string
ToString() string
}
* phase statistics
type PoolElement ¶
type PoolElement struct {
// contains filtered or unexported fields
}
type PrepareStmt ¶ added in v0.6.0
type PrepareStmtExecutor ¶ added in v0.6.0
type PrepareStmtExecutor struct {
// contains filtered or unexported fields
}
func (*PrepareStmtExecutor) ExecuteImpl ¶ added in v0.6.0
func (pse *PrepareStmtExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (*PrepareStmtExecutor) ResponseAfterExec ¶ added in v0.6.0
func (pse *PrepareStmtExecutor) ResponseAfterExec(ctx context.Context, ses *Session) error
type PrepareStringExecutor ¶ added in v0.6.0
type PrepareStringExecutor struct {
// contains filtered or unexported fields
}
func (*PrepareStringExecutor) ExecuteImpl ¶ added in v0.6.0
func (pse *PrepareStringExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (*PrepareStringExecutor) ResponseAfterExec ¶ added in v0.6.0
func (pse *PrepareStringExecutor) ResponseAfterExec(ctx context.Context, ses *Session) error
type PrivilegeScope ¶ added in v0.6.0
type PrivilegeScope uint8
const ( PrivilegeScopeSys PrivilegeScope = 1 PrivilegeScopeAccount PrivilegeScope = 2 PrivilegeScopeUser PrivilegeScope = 4 PrivilegeScopeRole PrivilegeScope = 8 PrivilegeScopeDatabase PrivilegeScope = 16 PrivilegeScopeTable PrivilegeScope = 32 PrivilegeScopeRoutine PrivilegeScope = 64 )
func (PrivilegeScope) String ¶ added in v0.6.0
func (ps PrivilegeScope) String() string
type PrivilegeType ¶ added in v0.6.0
type PrivilegeType int
const ( PrivilegeTypeCreateAccount PrivilegeType = iota PrivilegeTypeDropAccount PrivilegeTypeAlterAccount PrivilegeTypeCreateUser PrivilegeTypeDropUser PrivilegeTypeAlterUser PrivilegeTypeCreateRole PrivilegeTypeDropRole PrivilegeTypeAlterRole PrivilegeTypeCreateDatabase PrivilegeTypeDropDatabase PrivilegeTypeShowDatabases PrivilegeTypeConnect PrivilegeTypeManageGrants PrivilegeTypeAccountAll PrivilegeTypeAccountOwnership PrivilegeTypeUserOwnership PrivilegeTypeRoleOwnership PrivilegeTypeShowTables PrivilegeTypeCreateObject //includes: table, view, stream, sequence, function, dblink,etc PrivilegeTypeCreateTable PrivilegeTypeCreateView PrivilegeTypeDropObject PrivilegeTypeDropTable PrivilegeTypeDropView PrivilegeTypeAlterObject PrivilegeTypeAlterTable PrivilegeTypeAlterView PrivilegeTypeDatabaseAll PrivilegeTypeDatabaseOwnership PrivilegeTypeSelect PrivilegeTypeInsert PrivilegeTypeUpdate PrivilegeTypeTruncate PrivilegeTypeDelete PrivilegeTypeReference PrivilegeTypeIndex //include create/alter/drop index PrivilegeTypeTableAll PrivilegeTypeTableOwnership PrivilegeTypeExecute PrivilegeTypeCanGrantRoleToOthersInCreateUser // used in checking the privilege of CreateUser with the default role PrivilegeTypeValues PrivilegeTypeDump )
func (PrivilegeType) Scope ¶ added in v0.6.0
func (pt PrivilegeType) Scope() PrivilegeScope
func (PrivilegeType) String ¶ added in v0.6.0
func (pt PrivilegeType) String() string
type Protocol ¶
type Protocol interface {
IsEstablished() bool
SetEstablished()
// GetRequest gets Request from Packet
GetRequest(payload []byte) *Request
// SendResponse sends a response to the client for the application request
SendResponse(*Response) error
// ConnectionID the identity of the client
ConnectionID() uint32
// Peer gets the address [Host:Port,Host:Port] of the client and the server
Peer() (string, string, string, string)
GetDatabaseName() string
SetDatabaseName(string)
GetUserName() string
SetUserName(string)
// Quit
Quit()
SendPrepareResponse(stmt *PrepareStmt) error
// contains filtered or unexported methods
}
type ProtocolImpl ¶
type ProtocolImpl struct {
// contains filtered or unexported fields
}
func (*ProtocolImpl) ConnectionID ¶
func (cpi *ProtocolImpl) ConnectionID() uint32
func (*ProtocolImpl) GetConciseProfile ¶ added in v0.6.0
func (cpi *ProtocolImpl) GetConciseProfile() string
func (*ProtocolImpl) GetLock ¶
func (cpi *ProtocolImpl) GetLock() sync.Locker
func (*ProtocolImpl) GetSalt ¶ added in v0.6.0
func (cpi *ProtocolImpl) GetSalt() []byte
func (*ProtocolImpl) GetTcpConnection ¶ added in v0.6.0
func (cpi *ProtocolImpl) GetTcpConnection() goetty.IOSession
func (*ProtocolImpl) IsEstablished ¶
func (cpi *ProtocolImpl) IsEstablished() bool
func (*ProtocolImpl) IsTlsEstablished ¶ added in v0.6.0
func (cpi *ProtocolImpl) IsTlsEstablished() bool
func (*ProtocolImpl) MakeProfile ¶ added in v0.6.0
func (cpi *ProtocolImpl) MakeProfile()
func (*ProtocolImpl) Quit ¶
func (cpi *ProtocolImpl) Quit()
Quit kill tcpConn still connected. before calling NewMysqlClientProtocol, tcpConn.Connected() must be true please check goetty/application.go::doStart() and goetty/application.go::NewIOSession(...) for details
func (*ProtocolImpl) SetEstablished ¶
func (cpi *ProtocolImpl) SetEstablished()
func (*ProtocolImpl) SetTlsEstablished ¶ added in v0.6.0
func (cpi *ProtocolImpl) SetTlsEstablished()
type QueryProfiler ¶
type QueryProfiler interface {
//start the statistics for the query
StartQuery(string)
//stop the statistics for the query
EndQuery()
//generate the statistics tree from the physical plan
InitWithPlan()
//add OperatorProfiler information into the query profiler
AddOperatorProfiler(OperatorProfiler)
//convert the profiler into the string
ToString()
}
query statistics
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) GetCmd ¶
func (req *Request) GetCmd() CommandType
func (*Request) SetCmd ¶
func (req *Request) SetCmd(cmd CommandType)
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewGeneralErrorResponse ¶
func NewGeneralErrorResponse(cmd CommandType, err error) *Response
func NewGeneralOkResponse ¶
func NewGeneralOkResponse(cmd CommandType) *Response
func NewOkResponse ¶
func (*Response) GetCategory ¶
func (*Response) SetCategory ¶
type ResultSet ¶
type ResultSet interface {
//Add a column definition
//return the index of column (start from 0)
AddColumn(Column) uint64
//the Count of the Column
GetColumnCount() uint64
//get the i th column
GetColumn(uint64) (Column, error)
//Add a data row
//return the index of row (start from 0)
AddRow([]interface{}) uint64
//the count of the data row
GetRowCount() uint64
//get the i th data row
GetRow(uint64) ([]interface{}, error)
//get the data of row i, column j
GetValue(uint64, uint64) (interface{}, error)
//get the data of row i, column
GetValueByName(uint64, string) (interface{}, error)
}
type RevokeExecutor ¶ added in v0.6.0
type RevokeExecutor struct {
// contains filtered or unexported fields
}
func (*RevokeExecutor) ExecuteImpl ¶ added in v0.6.0
func (re *RevokeExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type RollbackTxnExecutor ¶ added in v0.6.0
type RollbackTxnExecutor struct {
// contains filtered or unexported fields
}
func (*RollbackTxnExecutor) ExecuteImpl ¶ added in v0.6.0
func (rte *RollbackTxnExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type Routine ¶
type Routine struct {
// contains filtered or unexported fields
}
Routine handles requests. Read requests from the IOSession layer, use the executor to handle requests, and response them.
func NewRoutine ¶
func NewRoutine(ctx context.Context, protocol MysqlProtocol, executor CmdExecutor, pu *config.ParameterUnit) *Routine
func (*Routine) GetCancelRoutineCtx ¶ added in v0.6.0
func (*Routine) GetCancelRoutineFunc ¶ added in v0.6.0
func (routine *Routine) GetCancelRoutineFunc() context.CancelFunc
func (*Routine) GetClientProtocol ¶
func (*Routine) GetCmdExecutor ¶
func (routine *Routine) GetCmdExecutor() CmdExecutor
func (*Routine) GetRequestChannel ¶ added in v0.6.0
func (*Routine) GetRoutineMgr ¶
func (routine *Routine) GetRoutineMgr() *RoutineManager
func (*Routine) GetSession ¶ added in v0.6.0
func (*Routine) Loop ¶
After the handshake with the client is done, the routine goes into processing loop.
func (*Routine) Quit ¶
func (routine *Routine) Quit()
When the io is closed, the Quit will be called.
func (*Routine) SetRoutineMgr ¶
func (routine *Routine) SetRoutineMgr(rtMgr *RoutineManager)
func (*Routine) SetSession ¶ added in v0.6.0
type RoutineManager ¶
type RoutineManager struct {
// contains filtered or unexported fields
}
func NewRoutineManager ¶
func NewRoutineManager(ctx context.Context, pu *config.ParameterUnit) (*RoutineManager, error)
func (*RoutineManager) Closed ¶
func (rm *RoutineManager) Closed(rs goetty.IOSession)
When the io is closed, the Closed will be called.
func (*RoutineManager) Created ¶
func (rm *RoutineManager) Created(rs goetty.IOSession)
func (*RoutineManager) GetSkipCheckUser ¶ added in v0.6.0
func (rm *RoutineManager) GetSkipCheckUser() bool
func (*RoutineManager) Handler ¶
func (rm *RoutineManager) Handler(rs goetty.IOSession, msg interface{}, received uint64) error
func (*RoutineManager) SetSkipCheckUser ¶ added in v0.6.0
func (rm *RoutineManager) SetSkipCheckUser(b bool)
type Scope ¶ added in v0.5.0
type Scope int
const ( ScopeGlobal Scope = iota //it is only in global ScopeSession //it is only in session ScopeBoth //it is both in global and session ScopePersist //it is global and persisted ScopePersistOnly //it is persisted without updating global and session values ScopeResetPersist //to remove a persisted variable )
type SelectExecutor ¶ added in v0.6.0
type SelectExecutor struct {
// contains filtered or unexported fields
}
TODO: special handle for export
func (SelectExecutor) ResponseAfterExec ¶ added in v0.6.0
type Session ¶
type Session struct {
//cmd from the client
Cmd CommandType
//for test
Mrs *MysqlResultSet
// mpool
Mp *mpool.MPool
Pu *config.ParameterUnit
IsInternal bool
Data [][]interface{}
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(proto Protocol, mp *mpool.MPool, PU *config.ParameterUnit, gSysVars *GlobalSystemVariables, flag bool) *Session
func (*Session) AppendData ¶ added in v0.6.0
func (ses *Session) AppendData(row []interface{})
func (*Session) AppendMysqlResultSetOfBackgroundTask ¶ added in v0.6.0
func (ses *Session) AppendMysqlResultSetOfBackgroundTask(mrs *MysqlResultSet)
func (*Session) AuthenticateUser ¶ added in v0.6.0
AuthenticateUser verifies the password of the user.
func (*Session) ClearAllMysqlResultSet ¶ added in v0.6.0
func (ses *Session) ClearAllMysqlResultSet()
func (*Session) ClearOptionBits ¶ added in v0.6.0
func (*Session) ClearServerStatus ¶ added in v0.6.0
func (*Session) CopyAllSessionVars ¶ added in v0.5.0
func (*Session) DatabaseNameIsEmpty ¶ added in v0.5.0
func (*Session) Dispose ¶ added in v0.6.0
func (ses *Session) Dispose()
Clean up all resources hold by the session. As of now, the mpool
func (*Session) GenNewStmtId ¶ added in v0.6.0
func (*Session) GetAllMysqlResultSet ¶ added in v0.6.0
func (ses *Session) GetAllMysqlResultSet() []*MysqlResultSet
func (*Session) GetBackgroundExec ¶ added in v0.6.0
func (ses *Session) GetBackgroundExec(ctx context.Context) BackgroundExec
GetBackgroundExec generates a background executor
func (*Session) GetCmd ¶ added in v0.6.0
func (ses *Session) GetCmd() CommandType
func (*Session) GetCompleteProfile ¶ added in v0.6.0
func (*Session) GetConciseProfile ¶ added in v0.6.0
func (*Session) GetConnectionID ¶ added in v0.5.1
func (*Session) GetDatabaseName ¶ added in v0.5.0
func (*Session) GetErrInfo ¶ added in v0.6.0
func (ses *Session) GetErrInfo() *errInfo
func (*Session) GetExportParam ¶ added in v0.6.0
func (ses *Session) GetExportParam() *tree.ExportParam
func (*Session) GetFromRealUser ¶ added in v0.6.0
func (*Session) GetGlobalSysVars ¶ added in v0.6.0
func (ses *Session) GetGlobalSysVars() *GlobalSystemVariables
func (*Session) GetGlobalVar ¶ added in v0.5.0
GetGlobalVar gets this value of the system variable in global
func (*Session) GetIsInternal ¶ added in v0.6.0
func (*Session) GetLastStmtId ¶ added in v0.6.0
func (*Session) GetMemPool ¶ added in v0.6.0
func (*Session) GetMysqlProtocol ¶
func (ses *Session) GetMysqlProtocol() MysqlProtocol
func (*Session) GetMysqlResultSet ¶ added in v0.6.0
func (ses *Session) GetMysqlResultSet() *MysqlResultSet
func (*Session) GetOutputCallback ¶ added in v0.6.0
func (*Session) GetParameterUnit ¶ added in v0.6.0
func (ses *Session) GetParameterUnit() *config.ParameterUnit
func (*Session) GetPrepareStmt ¶ added in v0.6.0
func (ses *Session) GetPrepareStmt(name string) (*PrepareStmt, error)
func (*Session) GetPrivilege ¶ added in v0.6.0
func (ses *Session) GetPrivilege() *privilege
func (*Session) GetPrivilegeCache ¶ added in v0.6.0
func (ses *Session) GetPrivilegeCache() *privilegeCache
func (*Session) GetRequestContext ¶ added in v0.6.0
func (*Session) GetSessionVar ¶ added in v0.5.0
GetSessionVar gets this value of the system variable in session
func (*Session) GetShowStmtType ¶ added in v0.6.0
func (ses *Session) GetShowStmtType() ShowStatementType
func (*Session) GetStorage ¶ added in v0.5.0
func (*Session) GetSysVars ¶ added in v0.6.0
func (*Session) GetTenantInfo ¶ added in v0.6.0
func (ses *Session) GetTenantInfo() *TenantInfo
func (*Session) GetTenantName ¶ added in v0.6.0
GetTenantName return tenant name according to GetTenantInfo and stmt.
With stmt = nil, should be only called in TxnHandler.NewTxn, TxnHandler.CommitTxn, TxnHandler.RollbackTxn
func (*Session) GetTimeZone ¶ added in v0.6.0
func (*Session) GetTxnCompileCtx ¶ added in v0.5.0
func (ses *Session) GetTxnCompileCtx() *TxnCompilerContext
func (*Session) GetTxnHandler ¶ added in v0.5.0
func (ses *Session) GetTxnHandler() *TxnHandler
func (*Session) GetUUIDString ¶ added in v0.6.0
func (*Session) GetUserDefinedVar ¶ added in v0.5.0
func (ses *Session) GetUserDefinedVar(name string) (SystemVariableType, interface{}, error)
GetUserDefinedVar gets value of the user defined variable
func (*Session) GetUserName ¶ added in v0.5.0
func (*Session) InActiveMultiStmtTransaction ¶ added in v0.6.0
InActiveMultiStmtTransaction checks the session is in multi-statement transaction mode and there is an active transaction.
But sometimes, the session does not start an active transaction even if it is in multi- statement transaction mode.
For example: there is no active transaction. set autocommit = 0; select 1;
For example: there is an active transaction. begin; select 1;
When the statement starts the multi-statement transaction(select * from table), this flag won't be set until we access the tables.
func (*Session) InActiveTransaction ¶ added in v0.6.0
InActiveTransaction checks if it is in an active transaction.
func (*Session) InMultiStmtTransactionMode ¶ added in v0.6.0
InMultiStmtTransactionMode checks the session is in multi-statement transaction mode. OPTION_NOT_AUTOCOMMIT: After the autocommit is off, the multi-statement transaction is started implicitly by the first statement of the transaction. OPTION_BEGIN: Whenever the autocommit is on or off, the multi-statement transaction is started explicitly by the BEGIN statement.
But it does not denote the transaction is active or not.
Cases | set Autocommit = 1/0 | BEGIN statement | --------------------------------------------------- Case1 1 Yes Case2 1 No Case3 0 Yes Case4 0 No ---------------------------------------------------
If it is Case1,Case3,Cass4, Then
InMultiStmtTransactionMode returns true. Also, the bit SERVER_STATUS_IN_TRANS will be set.
If it is Case2, Then
InMultiStmtTransactionMode returns false
func (*Session) InvalidatePrivilegeCache ¶ added in v0.6.0
func (ses *Session) InvalidatePrivilegeCache()
func (*Session) IsTaeEngine ¶ added in v0.5.0
func (*Session) MakeProfile ¶ added in v0.6.0
func (ses *Session) MakeProfile()
func (*Session) OptionBitsIsSet ¶ added in v0.6.0
func (*Session) RemovePrepareStmt ¶ added in v0.6.0
func (*Session) ServerStatusIsSet ¶ added in v0.6.0
func (*Session) SetAutocommit ¶ added in v0.6.0
SetAutocommit sets the value of the system variable 'autocommit'.
The rule is that we can not execute the statement 'set parameter = value' in an active transaction whichever it is started by BEGIN or in 'set autocommit = 0;'.
func (*Session) SetCmd ¶ added in v0.6.0
func (ses *Session) SetCmd(cmd CommandType)
func (*Session) SetDatabaseName ¶ added in v0.5.0
func (*Session) SetExportParam ¶ added in v0.6.0
func (ses *Session) SetExportParam(ep *tree.ExportParam)
func (*Session) SetFromRealUser ¶ added in v0.6.0
func (*Session) SetGlobalVar ¶ added in v0.5.0
SetGlobalVar sets the value of system variable in global. used by SET GLOBAL
func (*Session) SetMemPool ¶ added in v0.6.0
func (*Session) SetMysqlResultSet ¶ added in v0.6.0
func (ses *Session) SetMysqlResultSet(mrs *MysqlResultSet)
func (*Session) SetOptionBits ¶ added in v0.6.0
func (*Session) SetOutputCallback ¶ added in v0.6.0
func (*Session) SetPrepareStmt ¶ added in v0.6.0
func (ses *Session) SetPrepareStmt(name string, prepareStmt *PrepareStmt) error
func (*Session) SetPrivilege ¶ added in v0.6.0
func (ses *Session) SetPrivilege(priv *privilege)
func (*Session) SetRequestContext ¶ added in v0.6.0
func (*Session) SetServerStatus ¶ added in v0.6.0
func (*Session) SetSessionVar ¶ added in v0.5.0
SetSessionVar sets the value of system variable in session
func (*Session) SetShowStmtType ¶ added in v0.6.0
func (ses *Session) SetShowStmtType(sst ShowStatementType)
func (*Session) SetTenantInfo ¶ added in v0.6.0
func (ses *Session) SetTenantInfo(ti *TenantInfo)
func (*Session) SetTimeZone ¶ added in v0.6.0
func (*Session) SetUserDefinedVar ¶ added in v0.5.0
SetUserDefinedVar sets the user defined variable to the value in session
func (*Session) SetUserName ¶ added in v0.5.0
func (*Session) TxnBegin ¶ added in v0.6.0
TxnBegin begins a new transaction. It commits the current transaction implicitly.
func (*Session) TxnCommitSingleStatement ¶ added in v0.6.0
TxnCommitSingleStatement commits the single statement transaction.
Cases | set Autocommit = 1/0 | BEGIN statement | --------------------------------------------------- Case1 1 Yes Case2 1 No Case3 0 Yes Case4 0 No ---------------------------------------------------
If it is Case1,Case3,Cass4, Then
InMultiStmtTransactionMode returns true. Also, the bit SERVER_STATUS_IN_TRANS will be set.
If it is Case2, Then
InMultiStmtTransactionMode returns false
func (*Session) TxnRollback ¶ added in v0.6.0
TxnRollback rollbacks the current transaction.
func (*Session) TxnRollbackSingleStatement ¶ added in v0.6.0
TxnRollbackSingleStatement rollbacks the single statement transaction.
Cases | set Autocommit = 1/0 | BEGIN statement | --------------------------------------------------- Case1 1 Yes Case2 1 No Case3 0 Yes Case4 0 No ---------------------------------------------------
If it is Case1,Case3,Cass4, Then
InMultiStmtTransactionMode returns true. Also, the bit SERVER_STATUS_IN_TRANS will be set.
If it is Case2, Then
InMultiStmtTransactionMode returns false
func (*Session) TxnStart ¶ added in v0.6.0
TxnStart starts the transaction implicitly and idempotent
When it is in multi-statement transaction mode:
Set SERVER_STATUS_IN_TRANS bit; Starts a new transaction if there is none. Reuse the current transaction if there is one.
When it is not in single statement transaction mode:
Starts a new transaction if there is none. Reuse the current transaction if there is one.
type SetDefaultRoleExecutor ¶ added in v0.6.0
type SetDefaultRoleExecutor struct {
// contains filtered or unexported fields
}
type SetPasswordExecutor ¶ added in v0.6.0
type SetPasswordExecutor struct {
// contains filtered or unexported fields
}
type SetRoleExecutor ¶ added in v0.6.0
type SetRoleExecutor struct {
// contains filtered or unexported fields
}
func (*SetRoleExecutor) ExecuteImpl ¶ added in v0.6.0
func (sre *SetRoleExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type SetVarExecutor ¶ added in v0.6.0
type SetVarExecutor struct {
// contains filtered or unexported fields
}
func (*SetVarExecutor) ExecuteImpl ¶ added in v0.6.0
func (sve *SetVarExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type ShowColumnsExecutor ¶ added in v0.6.0
type ShowColumnsExecutor struct {
// contains filtered or unexported fields
}
func (ShowColumnsExecutor) ResponseAfterExec ¶ added in v0.6.0
func (ShowColumnsExecutor) ResponseBeforeExec ¶ added in v0.6.0
type ShowCreateDatabaseExecutor ¶ added in v0.6.0
type ShowCreateDatabaseExecutor struct {
// contains filtered or unexported fields
}
func (ShowCreateDatabaseExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowCreateTableExecutor ¶ added in v0.6.0
type ShowCreateTableExecutor struct {
// contains filtered or unexported fields
}
func (ShowCreateTableExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowCreateViewExecutor ¶ added in v0.6.0
type ShowCreateViewExecutor struct {
// contains filtered or unexported fields
}
func (ShowCreateViewExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowDatabasesExecutor ¶ added in v0.6.0
type ShowDatabasesExecutor struct {
// contains filtered or unexported fields
}
func (ShowDatabasesExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowErrorsExecutor ¶ added in v0.6.0
type ShowErrorsExecutor struct {
// contains filtered or unexported fields
}
func (*ShowErrorsExecutor) ExecuteImpl ¶ added in v0.6.0
func (see *ShowErrorsExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (ShowErrorsExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowGrantsExecutor ¶ added in v0.6.0
type ShowGrantsExecutor struct {
// contains filtered or unexported fields
}
func (ShowGrantsExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowIndexExecutor ¶ added in v0.6.0
type ShowIndexExecutor struct {
// contains filtered or unexported fields
}
func (ShowIndexExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowProcessListExecutor ¶ added in v0.6.0
type ShowProcessListExecutor struct {
// contains filtered or unexported fields
}
func (ShowProcessListExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowStatementType ¶ added in v0.5.0
type ShowStatementType int
const ( NotShowStatement ShowStatementType = 0 ShowColumns ShowStatementType = 1 ShowTableStatus ShowStatementType = 2 )
type ShowStatusExecutor ¶ added in v0.6.0
type ShowStatusExecutor struct {
// contains filtered or unexported fields
}
func (ShowStatusExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowTableStatusExecutor ¶ added in v0.6.0
type ShowTableStatusExecutor struct {
// contains filtered or unexported fields
}
func (ShowTableStatusExecutor) ResponseAfterExec ¶ added in v0.6.0
func (ShowTableStatusExecutor) ResponseBeforeExec ¶ added in v0.6.0
type ShowTablesExecutor ¶ added in v0.6.0
type ShowTablesExecutor struct {
// contains filtered or unexported fields
}
func (ShowTablesExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowTargetExecutor ¶ added in v0.6.0
type ShowTargetExecutor struct {
// contains filtered or unexported fields
}
func (ShowTargetExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowVariablesExecutor ¶ added in v0.6.0
type ShowVariablesExecutor struct {
// contains filtered or unexported fields
}
func (*ShowVariablesExecutor) ExecuteImpl ¶ added in v0.6.0
func (sve *ShowVariablesExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (ShowVariablesExecutor) ResponseAfterExec ¶ added in v0.6.0
type ShowWarningsExecutor ¶ added in v0.6.0
type ShowWarningsExecutor struct {
// contains filtered or unexported fields
}
func (*ShowWarningsExecutor) ExecuteImpl ¶ added in v0.6.0
func (swe *ShowWarningsExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
func (ShowWarningsExecutor) ResponseAfterExec ¶ added in v0.6.0
type StmtExecutor ¶ added in v0.6.0
type StmtExecutor interface {
ComputationWrapper
// GetStatus returns the execution status
GetStatus() stmtExecStatus
// SetStatus sets the execution status
SetStatus(err error)
// Setup does preparation
Setup(ctx context.Context, ses *Session) error
// VerifyPrivilege ensures the user can execute this statement
VerifyPrivilege(ctx context.Context, ses *Session) error
// VerifyTxn checks the restriction of the transaction
VerifyTxn(ctx context.Context, ses *Session) error
// ResponseBeforeExec responses the client before the execution starts
ResponseBeforeExec(ctx context.Context, ses *Session) error
// ExecuteImpl runs the concrete logic of the statement. every statement has its implementation
ExecuteImpl(ctx context.Context, ses *Session) error
// ResponseAfterExec responses the client after the execution ends
ResponseAfterExec(ctx context.Context, ses *Session) error
// CommitOrRollbackTxn commits or rollbacks the transaction based on the status
CommitOrRollbackTxn(ctx context.Context, ses *Session) error
// Close does clean
Close(ctx context.Context, ses *Session) error
}
StmtExecutor represents the single statement execution. it is also independent of the protocol
type SystemVariable ¶ added in v0.5.0
type SystemVariable struct {
Name string
// scope of the system variable includes Global,Session,Both
Scope Scope
// can be changed during runtime
Dynamic bool
//can be set for single query by SET_VAR()
SetVarHintApplies bool
Type SystemVariableType
Default interface{}
UpdateSessVar func(*Session, map[string]interface{}, string, interface{}) error
}
func (SystemVariable) GetDefault ¶ added in v0.5.0
func (sv SystemVariable) GetDefault() interface{}
func (SystemVariable) GetDynamic ¶ added in v0.5.0
func (sv SystemVariable) GetDynamic() bool
func (SystemVariable) GetName ¶ added in v0.5.0
func (sv SystemVariable) GetName() string
func (SystemVariable) GetScope ¶ added in v0.5.0
func (sv SystemVariable) GetScope() Scope
func (SystemVariable) GetSetVarHintApplies ¶ added in v0.5.0
func (sv SystemVariable) GetSetVarHintApplies() bool
func (SystemVariable) GetType ¶ added in v0.5.0
func (sv SystemVariable) GetType() SystemVariableType
type SystemVariableBoolType ¶ added in v0.5.0
type SystemVariableBoolType struct {
// contains filtered or unexported fields
}
func InitSystemVariableBoolType ¶ added in v0.5.0
func InitSystemVariableBoolType(name string) SystemVariableBoolType
func (SystemVariableBoolType) Convert ¶ added in v0.5.0
func (svbt SystemVariableBoolType) Convert(value interface{}) (interface{}, error)
func (SystemVariableBoolType) IsTrue ¶ added in v0.6.0
func (svbt SystemVariableBoolType) IsTrue(v interface{}) bool
func (SystemVariableBoolType) MysqlType ¶ added in v0.5.0
func (svbt SystemVariableBoolType) MysqlType() defines.MysqlType
func (SystemVariableBoolType) String ¶ added in v0.5.0
func (svbt SystemVariableBoolType) String() string
func (SystemVariableBoolType) Type ¶ added in v0.5.0
func (svbt SystemVariableBoolType) Type() types.T
func (SystemVariableBoolType) Zero ¶ added in v0.5.0
func (svbt SystemVariableBoolType) Zero() interface{}
type SystemVariableDoubleType ¶ added in v0.5.0
type SystemVariableDoubleType struct {
// contains filtered or unexported fields
}
func (SystemVariableDoubleType) Convert ¶ added in v0.5.0
func (svdt SystemVariableDoubleType) Convert(value interface{}) (interface{}, error)
func (SystemVariableDoubleType) MysqlType ¶ added in v0.5.0
func (svdt SystemVariableDoubleType) MysqlType() defines.MysqlType
func (SystemVariableDoubleType) String ¶ added in v0.5.0
func (svdt SystemVariableDoubleType) String() string
func (SystemVariableDoubleType) Type ¶ added in v0.5.0
func (svdt SystemVariableDoubleType) Type() types.T
func (SystemVariableDoubleType) Zero ¶ added in v0.5.0
func (svdt SystemVariableDoubleType) Zero() interface{}
type SystemVariableEnumType ¶ added in v0.5.0
type SystemVariableEnumType struct {
// contains filtered or unexported fields
}
func InitSystemSystemEnumType ¶ added in v0.5.0
func InitSystemSystemEnumType(name string, values ...string) SystemVariableEnumType
func (SystemVariableEnumType) Convert ¶ added in v0.5.0
func (svet SystemVariableEnumType) Convert(value interface{}) (interface{}, error)
func (SystemVariableEnumType) MysqlType ¶ added in v0.5.0
func (svet SystemVariableEnumType) MysqlType() defines.MysqlType
func (SystemVariableEnumType) String ¶ added in v0.5.0
func (svet SystemVariableEnumType) String() string
func (SystemVariableEnumType) Type ¶ added in v0.5.0
func (svet SystemVariableEnumType) Type() types.T
func (SystemVariableEnumType) Zero ¶ added in v0.5.0
func (svet SystemVariableEnumType) Zero() interface{}
type SystemVariableIntType ¶ added in v0.5.0
type SystemVariableIntType struct {
// contains filtered or unexported fields
}
func InitSystemVariableIntType ¶ added in v0.5.0
func InitSystemVariableIntType(name string, minimum, maximum int64, maybeMinusOne bool) SystemVariableIntType
func (SystemVariableIntType) Convert ¶ added in v0.5.0
func (svit SystemVariableIntType) Convert(value interface{}) (interface{}, error)
func (SystemVariableIntType) MysqlType ¶ added in v0.5.0
func (svit SystemVariableIntType) MysqlType() defines.MysqlType
func (SystemVariableIntType) String ¶ added in v0.5.0
func (svit SystemVariableIntType) String() string
func (SystemVariableIntType) Type ¶ added in v0.5.0
func (svit SystemVariableIntType) Type() types.T
func (SystemVariableIntType) Zero ¶ added in v0.5.0
func (svit SystemVariableIntType) Zero() interface{}
type SystemVariableNullType ¶ added in v0.5.0
type SystemVariableNullType struct {
}
func (SystemVariableNullType) Convert ¶ added in v0.5.0
func (svnt SystemVariableNullType) Convert(value interface{}) (interface{}, error)
func (SystemVariableNullType) MysqlType ¶ added in v0.5.0
func (svnt SystemVariableNullType) MysqlType() defines.MysqlType
func (SystemVariableNullType) String ¶ added in v0.5.0
func (svnt SystemVariableNullType) String() string
func (SystemVariableNullType) Type ¶ added in v0.5.0
func (svnt SystemVariableNullType) Type() types.T
func (SystemVariableNullType) Zero ¶ added in v0.5.0
func (svnt SystemVariableNullType) Zero() interface{}
type SystemVariableSetType ¶ added in v0.5.0
type SystemVariableSetType struct {
// contains filtered or unexported fields
}
func InitSystemVariableSetType ¶ added in v0.5.0
func InitSystemVariableSetType(name string, values ...string) SystemVariableSetType
func (SystemVariableSetType) Convert ¶ added in v0.5.0
func (svst SystemVariableSetType) Convert(value interface{}) (interface{}, error)
func (SystemVariableSetType) MysqlType ¶ added in v0.5.0
func (svst SystemVariableSetType) MysqlType() defines.MysqlType
func (SystemVariableSetType) String ¶ added in v0.5.0
func (svst SystemVariableSetType) String() string
func (SystemVariableSetType) Type ¶ added in v0.5.0
func (svst SystemVariableSetType) Type() types.T
func (SystemVariableSetType) Values ¶ added in v0.5.0
func (svst SystemVariableSetType) Values() []string
func (SystemVariableSetType) Zero ¶ added in v0.5.0
func (svst SystemVariableSetType) Zero() interface{}
type SystemVariableStringType ¶ added in v0.5.0
type SystemVariableStringType struct {
// contains filtered or unexported fields
}
func InitSystemVariableStringType ¶ added in v0.5.0
func InitSystemVariableStringType(name string) SystemVariableStringType
func (SystemVariableStringType) Convert ¶ added in v0.5.0
func (svst SystemVariableStringType) Convert(value interface{}) (interface{}, error)
func (SystemVariableStringType) MysqlType ¶ added in v0.5.0
func (svst SystemVariableStringType) MysqlType() defines.MysqlType
func (SystemVariableStringType) String ¶ added in v0.5.0
func (svst SystemVariableStringType) String() string
func (SystemVariableStringType) Type ¶ added in v0.5.0
func (svst SystemVariableStringType) Type() types.T
func (SystemVariableStringType) Zero ¶ added in v0.5.0
func (svst SystemVariableStringType) Zero() interface{}
type SystemVariableType ¶ added in v0.5.0
type SystemVariableType interface {
fmt.Stringer
// Convert the value to another value of the type
Convert(value interface{}) (interface{}, error)
// Type gets the type in the computation engine
Type() types.T
// MysqlType gets the mysql type
MysqlType() defines.MysqlType
// Zero gets the zero value for the type
Zero() interface{}
}
type SystemVariableUintType ¶ added in v0.5.0
type SystemVariableUintType struct {
// contains filtered or unexported fields
}
func InitSystemVariableUintType ¶ added in v0.5.0
func InitSystemVariableUintType(name string, minimum, maximum uint64) SystemVariableUintType
func (SystemVariableUintType) Convert ¶ added in v0.5.0
func (svut SystemVariableUintType) Convert(value interface{}) (interface{}, error)
func (SystemVariableUintType) MysqlType ¶ added in v0.5.0
func (svut SystemVariableUintType) MysqlType() defines.MysqlType
func (SystemVariableUintType) String ¶ added in v0.5.0
func (svut SystemVariableUintType) String() string
func (SystemVariableUintType) Type ¶ added in v0.5.0
func (svut SystemVariableUintType) Type() types.T
func (SystemVariableUintType) Zero ¶ added in v0.5.0
func (svut SystemVariableUintType) Zero() interface{}
type TableInfoCache ¶
type TableInfoCache struct {
// contains filtered or unexported fields
}
TableInfoCache tableInfos of a database
type TenantInfo ¶ added in v0.6.0
type TenantInfo struct {
Tenant string
User string
DefaultRole string
TenantID uint32
UserID uint32
DefaultRoleID uint32
// contains filtered or unexported fields
}
func GetTenantInfo ¶ added in v0.6.0
func GetTenantInfo(userInput string) (*TenantInfo, error)
GetTenantInfo extract tenant info from the input of the user. * The format of the user 1. tenant:user:role 2. tenant:user 3. user
func (*TenantInfo) GetDefaultRole ¶ added in v0.6.0
func (ti *TenantInfo) GetDefaultRole() string
func (*TenantInfo) GetDefaultRoleID ¶ added in v0.6.0
func (ti *TenantInfo) GetDefaultRoleID() uint32
func (*TenantInfo) GetTenant ¶ added in v0.6.0
func (ti *TenantInfo) GetTenant() string
func (*TenantInfo) GetTenantID ¶ added in v0.6.0
func (ti *TenantInfo) GetTenantID() uint32
func (*TenantInfo) GetUseSecondaryRole ¶ added in v0.6.0
func (ti *TenantInfo) GetUseSecondaryRole() bool
func (*TenantInfo) GetUser ¶ added in v0.6.0
func (ti *TenantInfo) GetUser() string
func (*TenantInfo) GetUserID ¶ added in v0.6.0
func (ti *TenantInfo) GetUserID() uint32
func (*TenantInfo) HasDefaultRole ¶ added in v0.6.0
func (ti *TenantInfo) HasDefaultRole() bool
func (*TenantInfo) IsAccountAdminRole ¶ added in v0.6.0
func (ti *TenantInfo) IsAccountAdminRole() bool
func (*TenantInfo) IsAdminRole ¶ added in v0.6.0
func (ti *TenantInfo) IsAdminRole() bool
func (*TenantInfo) IsDefaultRole ¶ added in v0.6.0
func (ti *TenantInfo) IsDefaultRole() bool
func (*TenantInfo) IsMoAdminRole ¶ added in v0.6.0
func (ti *TenantInfo) IsMoAdminRole() bool
func (*TenantInfo) IsNameOfAdminRoles ¶ added in v0.6.0
func (ti *TenantInfo) IsNameOfAdminRoles(name string) bool
func (*TenantInfo) IsSysTenant ¶ added in v0.6.0
func (ti *TenantInfo) IsSysTenant() bool
func (*TenantInfo) SetDefaultRole ¶ added in v0.6.0
func (ti *TenantInfo) SetDefaultRole(r string)
func (*TenantInfo) SetDefaultRoleID ¶ added in v0.6.0
func (ti *TenantInfo) SetDefaultRoleID(id uint32)
func (*TenantInfo) SetTenantID ¶ added in v0.6.0
func (ti *TenantInfo) SetTenantID(id uint32)
func (*TenantInfo) SetUseSecondaryRole ¶ added in v0.6.0
func (ti *TenantInfo) SetUseSecondaryRole(v bool)
func (*TenantInfo) SetUserID ¶ added in v0.6.0
func (ti *TenantInfo) SetUserID(id uint32)
func (*TenantInfo) String ¶ added in v0.6.0
func (ti *TenantInfo) String() string
type ThreadInfo ¶
type ThreadInfo struct {
// contains filtered or unexported fields
}
func (*ThreadInfo) GetCnt ¶
func (t *ThreadInfo) GetCnt() int32
func (*ThreadInfo) GetTime ¶
func (t *ThreadInfo) GetTime() (val interface{})
func (*ThreadInfo) SetCnt ¶
func (t *ThreadInfo) SetCnt(id int32)
func (*ThreadInfo) SetTime ¶
func (t *ThreadInfo) SetTime(tmp time.Time)
type Timeout ¶
type Timeout struct {
// contains filtered or unexported fields
}
func (*Timeout) UpdateTime ¶
type TruncateTableExecutor ¶ added in v0.6.0
type TruncateTableExecutor struct {
// contains filtered or unexported fields
}
type TxnCompilerContext ¶ added in v0.5.0
type TxnCompilerContext struct {
QryTyp QueryType
// contains filtered or unexported fields
}
func InitTxnCompilerContext ¶ added in v0.5.0
func InitTxnCompilerContext(txn *TxnHandler, db string) *TxnCompilerContext
func (*TxnCompilerContext) DatabaseExists ¶ added in v0.5.0
func (tcc *TxnCompilerContext) DatabaseExists(name string) bool
func (*TxnCompilerContext) DefaultDatabase ¶ added in v0.5.0
func (tcc *TxnCompilerContext) DefaultDatabase() string
func (*TxnCompilerContext) GetAccountId ¶ added in v0.6.0
func (tcc *TxnCompilerContext) GetAccountId() uint32
func (*TxnCompilerContext) GetHideKeyDef ¶ added in v0.5.0
func (tcc *TxnCompilerContext) GetHideKeyDef(dbName string, tableName string) *plan2.ColDef
func (*TxnCompilerContext) GetPrimaryKeyDef ¶ added in v0.5.0
func (tcc *TxnCompilerContext) GetPrimaryKeyDef(dbName string, tableName string) []*plan2.ColDef
func (*TxnCompilerContext) GetQueryType ¶ added in v0.6.0
func (tcc *TxnCompilerContext) GetQueryType() QueryType
func (*TxnCompilerContext) GetRootSql ¶ added in v0.6.0
func (tcc *TxnCompilerContext) GetRootSql() string
func (*TxnCompilerContext) GetSession ¶ added in v0.6.0
func (tcc *TxnCompilerContext) GetSession() *Session
func (*TxnCompilerContext) GetTxnHandler ¶ added in v0.6.0
func (tcc *TxnCompilerContext) GetTxnHandler() *TxnHandler
func (*TxnCompilerContext) GetUserName ¶ added in v0.6.0
func (tcc *TxnCompilerContext) GetUserName() string
func (*TxnCompilerContext) ResolveVariable ¶ added in v0.5.0
func (tcc *TxnCompilerContext) ResolveVariable(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
func (*TxnCompilerContext) SetDatabase ¶ added in v0.5.0
func (tcc *TxnCompilerContext) SetDatabase(db string)
func (*TxnCompilerContext) SetQueryType ¶ added in v0.5.0
func (tcc *TxnCompilerContext) SetQueryType(qryTyp QueryType)
func (*TxnCompilerContext) SetSession ¶ added in v0.5.0
func (tcc *TxnCompilerContext) SetSession(ses *Session)
type TxnComputationWrapper ¶ added in v0.5.0
type TxnComputationWrapper struct {
// contains filtered or unexported fields
}
func InitTxnComputationWrapper ¶ added in v0.5.0
func (*TxnComputationWrapper) GetAffectedRows ¶ added in v0.5.0
func (cwft *TxnComputationWrapper) GetAffectedRows() uint64
func (*TxnComputationWrapper) GetAst ¶ added in v0.5.0
func (cwft *TxnComputationWrapper) GetAst() tree.Statement
func (*TxnComputationWrapper) GetColumns ¶ added in v0.5.0
func (cwft *TxnComputationWrapper) GetColumns() ([]interface{}, error)
func (*TxnComputationWrapper) GetLoadTag ¶ added in v0.6.0
func (cwft *TxnComputationWrapper) GetLoadTag() bool
func (*TxnComputationWrapper) GetProcess ¶ added in v0.6.0
func (cwft *TxnComputationWrapper) GetProcess() *process.Process
func (*TxnComputationWrapper) GetUUID ¶ added in v0.6.0
func (cwft *TxnComputationWrapper) GetUUID() []byte
func (*TxnComputationWrapper) RecordExecPlan ¶ added in v0.6.0
func (cwft *TxnComputationWrapper) RecordExecPlan(ctx context.Context) error
func (*TxnComputationWrapper) Run ¶ added in v0.5.0
func (cwft *TxnComputationWrapper) Run(ts uint64) error
func (*TxnComputationWrapper) SetDatabaseName ¶ added in v0.5.0
func (cwft *TxnComputationWrapper) SetDatabaseName(db string) error
type TxnHandler ¶ added in v0.5.0
type TxnHandler struct {
// contains filtered or unexported fields
}
func InitTxnHandler ¶ added in v0.5.0
func InitTxnHandler(storage engine.Engine, txnClient TxnClient) *TxnHandler
func (*TxnHandler) CommitTxn ¶ added in v0.6.0
func (th *TxnHandler) CommitTxn() error
func (*TxnHandler) GetSession ¶ added in v0.6.0
func (th *TxnHandler) GetSession() *Session
func (*TxnHandler) GetStorage ¶ added in v0.5.0
func (th *TxnHandler) GetStorage() engine.Engine
func (*TxnHandler) GetTxn ¶ added in v0.5.0
func (th *TxnHandler) GetTxn() (TxnOperator, error)
func (*TxnHandler) GetTxnClient ¶ added in v0.6.0
func (th *TxnHandler) GetTxnClient() TxnClient
func (*TxnHandler) GetTxnOnly ¶ added in v0.6.0
func (th *TxnHandler) GetTxnOnly() TxnOperator
func (*TxnHandler) GetTxnOperator ¶ added in v0.6.0
func (th *TxnHandler) GetTxnOperator() TxnOperator
func (*TxnHandler) IsValidTxn ¶ added in v0.6.0
func (th *TxnHandler) IsValidTxn() bool
IsValidTxn checks the transaction is true or not.
func (*TxnHandler) NewTxn ¶ added in v0.6.0
func (th *TxnHandler) NewTxn() error
NewTxn commits the old transaction if it existed. Then it creates the new transaction.
func (*TxnHandler) RollbackTxn ¶ added in v0.6.0
func (th *TxnHandler) RollbackTxn() error
func (*TxnHandler) SetInvalid ¶ added in v0.6.0
func (th *TxnHandler) SetInvalid()
func (*TxnHandler) SetSession ¶ added in v0.6.0
func (th *TxnHandler) SetSession(ses *Session)
func (*TxnHandler) TxnClientNew ¶ added in v0.6.0
func (th *TxnHandler) TxnClientNew() error
TxnClientNew creates a new txn
type TxnOperator ¶ added in v0.6.0
type TxnOperator = client.TxnOperator
type Uint64List ¶
type Uint64List []uint64
func (Uint64List) Len ¶
func (ul Uint64List) Len() int
func (Uint64List) Less ¶
func (ul Uint64List) Less(i, j int) bool
func (Uint64List) Swap ¶
func (ul Uint64List) Swap(i, j int)
type UpdateExecutor ¶ added in v0.6.0
type UpdateExecutor struct {
// contains filtered or unexported fields
}
type UseExecutor ¶ added in v0.6.0
type UseExecutor struct {
// contains filtered or unexported fields
}
func (*UseExecutor) ExecuteImpl ¶ added in v0.6.0
func (ue *UseExecutor) ExecuteImpl(ctx context.Context, ses *Session) error
type WriteBatchHandler ¶
type WriteBatchHandler struct {
DebugTime
*ThreadInfo
// contains filtered or unexported fields
}