tidb: github.com/pingcap/tidb/util/rowcodec Index | Files

package rowcodec

import "github.com/pingcap/tidb/util/rowcodec"

Index

Package Files

common.go decoder.go encoder.go

Constants

const CodecVer = 128

CodecVer is the constant number that represent the new row format.

type Decoder Uses

type Decoder struct {
    // contains filtered or unexported fields
}

Decoder decodes the row to chunk.Chunk.

func NewDecoder Uses

func NewDecoder(requestColIDs []int64, handleColID int64, tps []*types.FieldType, origDefaults [][]byte,
    sc *stmtctx.StatementContext) (*Decoder, error)

NewDecoder creates a NewDecoder. requestColIDs is the columnIDs to decode. tps is the field types for request columns. origDefault is the original default value in old format, if the column ID is not found in the row, the origDefault will be used.

func (*Decoder) Decode Uses

func (decoder *Decoder) Decode(rowData []byte, handle int64, chk *chunk.Chunk) error

Decode decodes a row to chunk.

type Encoder Uses

type Encoder struct {
    // contains filtered or unexported fields
}

Encoder is used to encode a row.

func NewEncoder Uses

func NewEncoder(colIDs []int64, sc *stmtctx.StatementContext) *Encoder

NewEncoder creates a new Encoder with column IDs.

func (*Encoder) Encode Uses

func (encoder *Encoder) Encode(values []types.Datum, buf []byte) ([]byte, error)

Encode encodes a row from a datums slice.

Package rowcodec imports 14 packages (graph). Updated 2019-08-20. Refresh now. Tools for package owners.