MCPcopy
hub / github.com/pingcap/tidb / EncodeKey

Function EncodeKey

pkg/util/codec/codec.go:303–305  ·  view source on GitHub ↗

EncodeKey appends the encoded values to byte slice b, returns the appended slice. It guarantees the encoded value is in ascending order for comparison. For decimal type, datum must set datum's length and frac.

(loc *time.Location, b []byte, v ...types.Datum)

Source from the content-addressed store, hash-verified

301// slice. It guarantees the encoded value is in ascending order for comparison.
302// For decimal type, datum must set datum's length and frac.
303func EncodeKey(loc *time.Location, b []byte, v ...types.Datum) ([]byte, error) {
304 return encode(loc, b, v, true)
305}
306
307// EncodeValue appends the encoded values to byte slice b, returning the appended
308// slice. It does not guarantee the order for comparison.

Callers 15

buildMethod · 0.92
TestSplitScatterFunction · 0.92
runSnapshotRestoreFunction · 0.92
buildHandleMethod · 0.92
row_count_index.goFile · 0.92
generateIntDatumFunction · 0.92

Calls 1

encodeFunction · 0.85

Tested by 15

buildMethod · 0.74
TestSplitScatterFunction · 0.74
generateIntDatumFunction · 0.74
genHist4BenchFunction · 0.74
encodeKeyFunction · 0.74
buildIndexFunction · 0.74
genHist4TestFunction · 0.74