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

Function init

pkg/tablecodec/tablecodec.go:84–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82const TableSplitKeyLen = 1 + idLen
83
84func init() {
85 // help kv package to refer the tablecodec package to resolve the kv.Key functions.
86 kv.DecodeTableIDFunc = func(key kv.Key) int64 {
87 //preCheck, avoid the noise error log.
88 if hasTablePrefix(key) && len(key) >= TableSplitKeyLen {
89 return DecodeTableID(key)
90 }
91 return 0
92 }
93}
94
95// TablePrefix returns table's prefix 't'.
96func TablePrefix() []byte {

Callers

nothing calls this directly

Calls 2

hasTablePrefixFunction · 0.85
DecodeTableIDFunction · 0.85

Tested by

no test coverage detected