Versions in this module Expand all Collapse all v1 v1.0.0 Oct 16, 2017 Changes in this version + var ErrColumnStateCantNone = terror.ClassTable.New(codeColumnStateCantNone, "column can not be in none state") + var ErrColumnStateNonPublic = terror.ClassTable.New(codeColumnStateNonPublic, "can not use non-public column") + var ErrIndexOutBound = terror.ClassTable.New(codeIndexOutBound, "index column offset out of bound") + var ErrIndexStateCantNone = terror.ClassTable.New(codeIndexStateCantNone, "index can not be in none state") + var ErrInvalidRecordKey = terror.ClassTable.New(codeInvalidRecordKey, "invalid record key") + var ErrNoDefaultValue = terror.ClassTable.New(codeNoDefaultValue, "field doesn't have a default value") + var ErrRowNotFound = terror.ClassTable.New(codeRowNotFound, "can not find the row") + var ErrTableStateCantNone = terror.ClassTable.New(codeTableStateCantNone, "table can not be in none state") + var ErrTruncateWrongValue = terror.ClassTable.New(codeTruncateWrongValue, "Incorrect value") + var ErrUnsupportedOp = terror.ClassTable.New(codeUnsupportedOp, "operation not supported") + var MockTableFromMeta func(tableInfo *model.TableInfo) Table + var TableFromMeta func(alloc autoid.Allocator, tblInfo *model.TableInfo) (Table, error) + func CastValue(ctx context.Context, val types.Datum, col *model.ColumnInfo) (casted types.Datum, err error) + func CastValues(ctx context.Context, rec []types.Datum, cols []*Column, ignoreErr bool) (err error) + func CheckNotNull(cols []*Column, row []types.Datum) error + func CheckOnce(cols []*Column) error + func ColDescFieldNames(full bool) []string + func GetColDefaultValue(ctx context.Context, col *model.ColumnInfo) (types.Datum, error) + func GetColOriginDefaultValue(ctx context.Context, col *model.ColumnInfo) (types.Datum, error) + func GetZeroValue(col *model.ColumnInfo) types.Datum + type ColDesc struct + Collation string + Comment string + DefaultValue interface{} + Extra string + Field string + Key string + Null string + Privileges string + Type string + func NewColDesc(col *Column) *ColDesc + type Column struct + GeneratedExpr ast.ExprNode + func FindCol(cols []*Column, name string) *Column + func FindCols(cols []*Column, names []string) ([]*Column, error) + func FindOnUpdateCols(cols []*Column) []*Column + func ToColumn(col *model.ColumnInfo) *Column + func (c *Column) CheckNotNull(data types.Datum) error + func (c *Column) GetTypeDesc() string + func (c *Column) IsPKHandleColumn(tbInfo *model.TableInfo) bool + func (c *Column) String() string + func (c *Column) ToInfo() *model.ColumnInfo + type Index interface + Create func(rm kv.RetrieverMutator, indexedValues []types.Datum, h int64) (int64, error) + Delete func(m kv.Mutator, indexedValues []types.Datum, h int64) error + Drop func(rm kv.RetrieverMutator) error + Exist func(rm kv.RetrieverMutator, indexedValues []types.Datum, h int64) (bool, int64, error) + FetchValues func(row []types.Datum) (columns []types.Datum, err error) + GenIndexKey func(indexedValues []types.Datum, h int64) (key []byte, distinct bool, err error) + Meta func() *model.IndexInfo + Seek func(r kv.Retriever, indexedValues []types.Datum) (iter IndexIterator, hit bool, err error) + SeekFirst func(r kv.Retriever) (iter IndexIterator, err error) + type IndexIterator interface + Close func() + Next func() (k []types.Datum, h int64, err error) + type RecordIterFunc func(h int64, rec []types.Datum, cols []*Column) (more bool, err error) + type Slice []Table + func (s Slice) Len() int + func (s Slice) Less(i, j int) bool + func (s Slice) Swap(i, j int) + type Table interface + AddRecord func(ctx context.Context, r []types.Datum) (recordID int64, err error) + AllocAutoID func() (int64, error) + Allocator func() autoid.Allocator + Cols func() []*Column + DeletableIndices func() []Index + FirstKey func() kv.Key + IndexPrefix func() kv.Key + Indices func() []Index + IterRecords func(ctx context.Context, startKey kv.Key, cols []*Column, fn RecordIterFunc) error + Meta func() *model.TableInfo + RebaseAutoID func(newBase int64, allocIDs bool) error + RecordKey func(h int64) kv.Key + RecordPrefix func() kv.Key + RemoveRecord func(ctx context.Context, h int64, r []types.Datum) error + Row func(ctx context.Context, h int64) ([]types.Datum, error) + RowWithCols func(ctx context.Context, h int64, cols []*Column) ([]types.Datum, error) + Seek func(ctx context.Context, h int64) (handle int64, found bool, err error) + Type func() Type + UpdateRecord func(ctx context.Context, h int64, currData, newData []types.Datum, touched []bool) error + WritableCols func() []*Column + WritableIndices func() []Index + type Type int16 + const MemoryTable + const NormalTable + const VirtualTable