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

Function DecodeValuesBytesToStrings

pkg/tablecodec/tablecodec.go:203–218  ·  view source on GitHub ↗

DecodeValuesBytesToStrings decode the raw bytes to strings for each columns. FIXME: Without the schema information, we can only decode the raw kind of the column. For instance, MysqlTime is internally saved as uint64.

(b []byte)

Source from the content-addressed store, hash-verified

201// FIXME: Without the schema information, we can only decode the raw kind of
202// the column. For instance, MysqlTime is internally saved as uint64.
203func DecodeValuesBytesToStrings(b []byte) ([]string, error) {
204 var datumValues []string
205 for len(b) > 0 {
206 remain, d, e := codec.DecodeOne(b)
207 if e != nil {
208 return nil, e
209 }
210 str, e1 := d.ToString()
211 if e1 != nil {
212 return nil, e
213 }
214 datumValues = append(datumValues, str)
215 b = remain
216 }
217 return datumValues, nil
218}
219
220// EncodeMetaKey encodes the key and field into meta key.
221func EncodeMetaKey(key []byte, field []byte) kv.Key {

Callers 2

getAllDataForTableIDFunction · 0.92
DecodeIndexKeyFunction · 0.85

Calls 2

DecodeOneFunction · 0.92
ToStringMethod · 0.65

Tested by 1

getAllDataForTableIDFunction · 0.74