Documentation ¶
Index ¶
- func DecodeColumnValue(data []byte, ft *types.FieldType, loc *time.Location) (types.Datum, []byte, error)
- func DecodeIndexKey(key []byte, cols []*types.FieldType, pks []*types.FieldType, ...) (int64, int64, []types.Datum, []types.Datum, error)
- func DecodeRecordKey(key []byte, cols []*types.FieldType, loc *time.Location) (int64, []types.Datum, int64, []byte, error)
- func DecodeRowFlexible(sc *stmtctx.StatementContext, b []byte) (map[string]types.Datum, byte, error)
- func DecodeRowHigh(sc *stmtctx.StatementContext, data []byte, ft *types.FieldType, ...) (types.Datum, error)
- func DecodeRowWide(b []byte, cols map[int64]*types.FieldType, loc *time.Location, ...) (map[int64]types.Datum, error)
- func DecodeUniqIndexKey(key []byte, cols []*types.FieldType, loc *time.Location) (int64, int64, []types.Datum, error)
- func EncodeIndex(sc *stmtctx.StatementContext, tableID, idxID int64, ...) ([]byte, error)
- func EncodeIndexPrefix(sc *stmtctx.StatementContext, tableID, idxID int64, values []types.Datum) ([]byte, error)
- func EncodeIndexUnique(sc *stmtctx.StatementContext, tableID, idxID int64, values []types.Datum) ([]byte, error)
- func EncodeKeyTablePrefix(tableID int64) []byte
- func EncodePkCF(key kv.Key, columnFamilyID int64) kv.Key
- func EncodePkCFColumn(key kv.Key, column []byte) kv.Key
- func EncodePkCFWithColumn(key kv.Key, columnFamilyID int64, column []byte) kv.Key
- func EncodePkPrefix(key kv.Key) kv.Key
- func EncodePrimaryKey(sc *stmtctx.StatementContext, primaryKey []types.Datum) ([]byte, error)
- func EncodeRecordKeyHigh(sc *stmtctx.StatementContext, tableID int64, primaryKey []types.Datum, ...) ([]byte, error)
- func EncodeRecordKeyWide(sc *stmtctx.StatementContext, tableID int64, primaryKey []types.Datum, ...) ([]byte, error)
- func EncodeRecordKeyWideWithEncodedPK(tableID int64, encodedPK []byte, columnFamilyID int64) []byte
- func EncodeRecordPrimaryKey(sc *stmtctx.StatementContext, tableID int64, primaryKey []types.Datum) ([]byte, error)
- func EncodeRecordPrimaryKeyCFPrefix(sc *stmtctx.StatementContext, tableID int64, primaryKey []types.Datum, ...) ([]byte, error)
- func EncodeRow(sc *stmtctx.StatementContext, row []types.Datum, colIDs []int64, valBuf []byte, ...) ([]byte, error)
- func EncodeRowFlexible(sc *stmtctx.StatementContext, row map[string]types.Datum, valBuf []byte, ...) ([]byte, error)
- func EncodeRowHigh(sc *stmtctx.StatementContext, value types.Datum, valBuf []byte) ([]byte, error)
- func EncodeTableIndexPrefix(tableID, idxID int64) kv.Key
- func EncodeTablePrefix(tableID int64) kv.Key
- func ExtractEncodedHighColumnName(key []byte, sc *stmtctx.StatementContext, tableID int64, ...) (string, error)
- func ExtractEncodedPrimaryKey(key kv.Key) []byte
- func ExtractEncodedPrimaryKeyCFPrefix(key kv.Key) []byte
- func GenIndexKeyPrefix(tableID int64) kv.Key
- func GenRecordKeyPrefix(tableID int64) kv.Key
- func UnflattenDatums(datums []types.Datum, fts []*types.FieldType, loc *time.Location) ([]types.Datum, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeColumnValue ¶
func DecodeIndexKey ¶
func DecodeIndexKey(key []byte, cols []*types.FieldType, pks []*types.FieldType, loc *time.Location) (int64, int64, []types.Datum, []types.Datum, error)
DecodeUniqIndexKey decodes the key and gets the tableID, indexID, column values, pk values.
func DecodeRecordKey ¶
func DecodeRecordKey(key []byte, cols []*types.FieldType, loc *time.Location) (int64, []types.Datum, int64, []byte, error)
DecodeRecordKey decodes the key and gets the tableID, primaryKey, columnFamilyID,columnID columnID may not exist, return -1.
func DecodeRowFlexible ¶
func DecodeRowHigh ¶
func DecodeRowWide ¶
func DecodeRowWide(b []byte, cols map[int64]*types.FieldType, loc *time.Location, row map[int64]types.Datum) (map[int64]types.Datum, error)
DecodeRowWithMap decodes a byte slice into datums with a existing row map. Row layout: colID1, value1, colID2, value2, .....
func DecodeUniqIndexKey ¶
func DecodeUniqIndexKey(key []byte, cols []*types.FieldType, loc *time.Location) (int64, int64, []types.Datum, error)
DecodeUniqIndexKey decodes the key and gets the tableID, indexID, column values.
func EncodeIndex ¶
func EncodeIndex(sc *stmtctx.StatementContext, tableID, idxID int64, values, primaryKey []types.Datum) ([]byte, error)
Format: v(TableID),v(IndexPrefix),v(IndexID),m(ColumnValue1)...m(ColumnValueN),v(PrimaryKeyPrefix),m(PrimaryKey)
func EncodeIndexPrefix ¶
func EncodeIndexUnique ¶
func EncodeIndexUnique(sc *stmtctx.StatementContext, tableID, idxID int64, values []types.Datum) ([]byte, error)
Format: key: v(TableID),v(IndexPrefix),v(IndexID),m(ColumnValue1),m(ColumnValue2)...
func EncodeKeyTablePrefix ¶
func EncodePkCFWithColumn ¶
func EncodePrimaryKey ¶
func EncodeRecordKeyHigh ¶
func EncodeRecordKeyHigh(sc *stmtctx.StatementContext, tableID int64, primaryKey []types.Datum, columnFamilyID int64, columnName []byte) ([]byte, error)
Format: v(TableID),v(PrimaryKeyPrefix),m(PrimaryKey),v(ColumnFamilyPrefix),v(ColumnFamilyID),v(ColumnName)
func EncodeRecordKeyWide ¶
func EncodeRecordKeyWide(sc *stmtctx.StatementContext, tableID int64, primaryKey []types.Datum, columnFamilyID int64) ([]byte, error)
Format: v(TableID),v(PrimaryKeyPrefix),m(PrimaryKey),v(ColumnFamilyPrefix),v(ColumnFamilyID)
func EncodeRecordPrimaryKey ¶
func EncodeRecordPrimaryKey(sc *stmtctx.StatementContext, tableID int64, primaryKey []types.Datum) ([]byte, error)
EncodeRecordPrimaryKey Format: v(TableID),v(PrimaryKeyPrefix),m(PrimaryKey)
func EncodeRecordPrimaryKeyCFPrefix ¶
func EncodeRecordPrimaryKeyCFPrefix(sc *stmtctx.StatementContext, tableID int64, primaryKey []types.Datum, columnFamilyID int64) ([]byte, error)
EncodeRecordPrimaryKeyCFPrefix Format: v(TableID),v(PrimaryKeyPrefix),m(PrimaryKey),v
func EncodeRow ¶
func EncodeRow(sc *stmtctx.StatementContext, row []types.Datum, colIDs []int64, valBuf []byte, values []types.Datum) ([]byte, error)
EncodeRow encode row data and column ids into a slice of byte. Row layout: colID1, value1, colID2, value2, ..... valBuf and values pass by caller, for reducing EncodeRow allocates temporary bufs. If you pass valBuf and values as nil, EncodeRow will allocate it.
func EncodeRowFlexible ¶
func EncodeRowFlexible(sc *stmtctx.StatementContext, row map[string]types.Datum, valBuf []byte, values []types.Datum) ([]byte, error)
EncodeRowFlexible encode row data and column name into a slice of byte. Row layout: colName1, value1, colName2, value2, ..... valBuf and values pass by caller, for reducing EncodeRow allocates temporary bufs. If you pass valBuf and values as nil, EncodeRow will allocate it.
func EncodeRowHigh ¶
EncodeRowHigh encode the value in `High Layout`.
func EncodeTableIndexPrefix ¶
EncodeTableIndexPrefix encodes index prefix with tableID and idxID.
func EncodeTablePrefix ¶
EncodeTablePrefix encodes table prefix with table ID.
func ExtractEncodedPrimaryKey ¶
ExtractEncodedPrimaryKey extract primary key raw bytes from encoded key. Used for constructing index, avoid to encode primary key one more time.
func ExtractEncodedPrimaryKeyCFPrefix ¶
Only for EncodeRecordPrimaryKeyCFPrefix !!!!
func GenIndexKeyPrefix ¶
func GenRecordKeyPrefix ¶
Types ¶
This section is empty.