Documentation ¶
Index ¶
- Constants
- type SQLWarn
- type StatementContext
- func (sc *StatementContext) AddAffectedRows(rows uint64)
- func (sc *StatementContext) AddFoundRows(rows uint64)
- func (sc *StatementContext) AffectedRows() uint64
- func (sc *StatementContext) AppendNote(warn error)
- func (sc *StatementContext) AppendWarning(warn error)
- func (sc *StatementContext) FoundRows() uint64
- func (sc *StatementContext) GetExecDetails() execdetails.ExecDetails
- func (sc *StatementContext) GetWarnings() []SQLWarn
- func (sc *StatementContext) HandleOverflow(err error, warnErr error) error
- func (sc *StatementContext) HandleTruncate(err error) error
- func (sc *StatementContext) HistogramsNotLoad() bool
- func (sc *StatementContext) MergeExecDetails(details *execdetails.ExecDetails)
- func (sc *StatementContext) ResetForRetry()
- func (sc *StatementContext) SetHistogramsNotLoad()
- func (sc *StatementContext) SetWarnings(warns []SQLWarn)
- func (sc *StatementContext) WarningCount() uint16
Constants ¶
const ( // WarnLevelWarning represents level "Warning" for 'SHOW WARNINGS' syntax. WarnLevelWarning = "Warning" // WarnLevelNote represents level "Note" for 'SHOW WARNINGS' syntax. WarnLevelNote = "Note" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLWarn ¶
SQLWarn relates a sql warning and it's level.
type StatementContext ¶
type StatementContext struct { InInsertStmt bool InUpdateOrDeleteStmt bool InSelectStmt bool IgnoreTruncate bool IgnoreZeroInDate bool DividedByZeroAsWarning bool TruncateAsWarning bool OverflowAsWarning bool InShowWarning bool UseCache bool PadCharToFullLength bool BatchCheck bool // Copied from SessionVars.TimeZone. TimeZone *time.Location Priority mysql.PriorityEnum NotFillCache bool MemTracker *memory.Tracker TableIDs []int64 IndexIDs []int64 // contains filtered or unexported fields }
StatementContext contains variables for a statement. It should be reset before executing a statement.
func (*StatementContext) AddAffectedRows ¶
func (sc *StatementContext) AddAffectedRows(rows uint64)
AddAffectedRows adds affected rows.
func (*StatementContext) AddFoundRows ¶
func (sc *StatementContext) AddFoundRows(rows uint64)
AddFoundRows adds found rows.
func (*StatementContext) AffectedRows ¶
func (sc *StatementContext) AffectedRows() uint64
AffectedRows gets affected rows.
func (*StatementContext) AppendNote ¶
func (sc *StatementContext) AppendNote(warn error)
AppendNote appends a warning with level 'Note'.
func (*StatementContext) AppendWarning ¶
func (sc *StatementContext) AppendWarning(warn error)
AppendWarning appends a warning with level 'Warning'.
func (*StatementContext) FoundRows ¶
func (sc *StatementContext) FoundRows() uint64
FoundRows gets found rows.
func (*StatementContext) GetExecDetails ¶
func (sc *StatementContext) GetExecDetails() execdetails.ExecDetails
GetExecDetails gets the execution details for the statement.
func (*StatementContext) GetWarnings ¶
func (sc *StatementContext) GetWarnings() []SQLWarn
GetWarnings gets warnings.
func (*StatementContext) HandleOverflow ¶
func (sc *StatementContext) HandleOverflow(err error, warnErr error) error
HandleOverflow treats ErrOverflow as warnings or returns the error based on the StmtCtx.OverflowAsWarning state.
func (*StatementContext) HandleTruncate ¶
func (sc *StatementContext) HandleTruncate(err error) error
HandleTruncate ignores or returns the error based on the StatementContext state.
func (*StatementContext) HistogramsNotLoad ¶
func (sc *StatementContext) HistogramsNotLoad() bool
HistogramsNotLoad gets histogramsNotLoad.
func (*StatementContext) MergeExecDetails ¶
func (sc *StatementContext) MergeExecDetails(details *execdetails.ExecDetails)
MergeExecDetails merges a single region execution details into self, used to print the information in slow query log.
func (*StatementContext) ResetForRetry ¶
func (sc *StatementContext) ResetForRetry()
ResetForRetry resets the changed states during execution.
func (*StatementContext) SetHistogramsNotLoad ¶
func (sc *StatementContext) SetHistogramsNotLoad()
SetHistogramsNotLoad sets histogramsNotLoad.
func (*StatementContext) SetWarnings ¶
func (sc *StatementContext) SetWarnings(warns []SQLWarn)
SetWarnings sets warnings.
func (*StatementContext) WarningCount ¶
func (sc *StatementContext) WarningCount() uint16
WarningCount gets warning count.