Documentation ¶
Index ¶
- Variables
- func BindSessionVars(ctx context.Context)
- func IsAutocommit(ctx context.Context) bool
- type ScopeFlag
- type SessionVars
- func (s *SessionVars) AddAffectedRows(rows uint64)
- func (s *SessionVars) AddFoundRows(rows uint64)
- func (s *SessionVars) GetNextPreparedStmtID() uint32
- func (s *SessionVars) SetAffectedRows(affectedRows uint64)
- func (s *SessionVars) SetLastInsertID(insertID uint64)
- func (s *SessionVars) SetStatus(status uint16)
- type SysVar
Constants ¶
This section is empty.
Variables ¶
var SysVars map[string]*SysVar
Global sys vars map
Functions ¶
func BindSessionVars ¶
BindSessionVars creates a session vars object and bind it to context
func IsAutocommit ¶
IsAutocommit checks if it is in autocommit enviroment
Types ¶
type ScopeFlag ¶
type ScopeFlag uint8
ScopeFlag is for system variable whether can be changed in global/session dynamically or not.
type SessionVars ¶
type SessionVars struct { // user-defined variables Users map[string]string // system variables Systems map[string]string // prepared statement PreparedStmts map[string]stmt.Statement // following variables are specail for current session Status uint16 LastInsertID uint64 AffectedRows uint64 // Client Capability ClientCapability uint32 // Client capability // Disable autocommit DisableAutocommit bool // Found rows FoundRows uint64 // contains filtered or unexported fields }
SessionVars is to handle user-defined or global varaibles in current session
func GetSessionVars ¶
func GetSessionVars(ctx context.Context) *SessionVars
GetSessionVars gets the session vars from context
func (*SessionVars) AddAffectedRows ¶
func (s *SessionVars) AddAffectedRows(rows uint64)
AddAffectedRows adds affected rows with the argument rows
func (*SessionVars) AddFoundRows ¶
func (s *SessionVars) AddFoundRows(rows uint64)
AddFoundRows adds found rows with the argument rows
func (*SessionVars) GetNextPreparedStmtID ¶
func (s *SessionVars) GetNextPreparedStmtID() uint32
GetNextPreparedStmtID generates and return the next session scope prepared statement id
func (*SessionVars) SetAffectedRows ¶
func (s *SessionVars) SetAffectedRows(affectedRows uint64)
SetAffectedRows saves the affected rows to the session context
func (*SessionVars) SetLastInsertID ¶
func (s *SessionVars) SetLastInsertID(insertID uint64)
SetLastInsertID saves the last insert id to the session context
func (*SessionVars) SetStatus ¶
func (s *SessionVars) SetStatus(status uint16)
SetStatus sets the session server status variable