stmtctx

package
v2.1.0-alpha+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2018 License: Apache-2.0 Imports: 5 Imported by: 3,032

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatementContext

type StatementContext struct {
	InInsertStmt         bool
	InUpdateOrDeleteStmt bool
	InSelectStmt         bool
	IgnoreTruncate       bool
	IgnoreZeroInDate     bool
	// IgnoreErr is used for the following statements to avoid return an
	// error, `insert`, `update`, and `delete`.
	// If IgnoreErr is true and the statements meet some errors,
	// e.g. duplicate keys, insert null to a not null column...,
	// the errors will be appended as warnings.
	// For the `load data` statement, IgnoreErr should be always true,
	// because it is the same behavior as `insert ignore` statement.
	IgnoreErr              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) AppendWarning

func (sc *StatementContext) AppendWarning(warn error)

AppendWarning appends a warning.

func (*StatementContext) FoundRows

func (sc *StatementContext) FoundRows() uint64

FoundRows gets found rows.

func (*StatementContext) GetWarnings

func (sc *StatementContext) GetWarnings() []error

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) 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 []error)

SetWarnings sets warnings.

func (*StatementContext) WarningCount

func (sc *StatementContext) WarningCount() uint16

WarningCount gets warning count.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL