Documentation
¶
Index ¶
- Constants
- type SQLWarn
- type StatementContext
- func (sc *StatementContext) AppendError(warn error)
- func (sc *StatementContext) AppendWarning(warn error)
- func (sc *StatementContext) GetNow() time.Time
- func (sc *StatementContext) HandleOverflow(err error, warnErr error) error
- func (sc *StatementContext) HandleTruncate(err error) error
- func (sc *StatementContext) ShouldClipToZero() bool
- func (sc *StatementContext) ShouldIgnoreOverflowError() bool
- func (sc *StatementContext) TruncateWarnings(start int) []SQLWarn
- func (sc *StatementContext) WarningCount() uint16
- type TableEntry
Constants ¶
const ( // WarnLevelError represents level "Error" for 'SHOW WARNINGS' syntax. WarnLevelError = "Error" // WarnLevelWarning represents level "Warning" for 'SHOW WARNINGS' syntax. WarnLevelWarning = "Warning" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatementContext ¶
type StatementContext struct { // InReorgAttribute is indicated for cast function that the transition is a kind of reorg process. InReorgAttribute bool IgnoreTruncate bool UseCache bool InNullRejectCheck bool OptimDependOnMutableConst bool // Copied from SessionVars.TimeZone. TimeZone *time.Location TblInfo2UnionScan map[*model.TableInfo]bool // contains filtered or unexported fields }
StatementContext contains variables for a statement. It should be reset before executing a statement.
func (*StatementContext) AppendError ¶
func (sc *StatementContext) AppendError(warn error)
AppendError appends a warning with level 'Error'.
func (*StatementContext) AppendWarning ¶
func (sc *StatementContext) AppendWarning(warn error)
AppendWarning appends a warning with level 'Warning'.
func (*StatementContext) GetNow ¶
func (sc *StatementContext) GetNow() time.Time
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) ShouldClipToZero ¶
func (sc *StatementContext) ShouldClipToZero() bool
ShouldClipToZero indicates whether values less than 0 should be clipped to 0 for unsigned integer types. This is the case for `insert`, `update`, `alter table`, `create table` and `load data infile` statements, when not in strict SQL mode. see https://dev.mysql.com/doc/refman/5.7/en/out-of-range-and-overflow.html
func (*StatementContext) ShouldIgnoreOverflowError ¶
func (sc *StatementContext) ShouldIgnoreOverflowError() bool
ShouldIgnoreOverflowError indicates whether we should ignore the error when type conversion overflows, so we can leave it for further processing like clipping values less than 0 to 0 for unsigned integer types.
func (*StatementContext) TruncateWarnings ¶
func (sc *StatementContext) TruncateWarnings(start int) []SQLWarn
TruncateWarnings truncates warnings begin from start and returns the truncated warnings.
func (*StatementContext) WarningCount ¶
func (sc *StatementContext) WarningCount() uint16
WarningCount gets warning count.
type TableEntry ¶
TableEntry presents table in db.