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

Function TestValueToString4InvalidKey

pkg/statistics/histogram_test.go:41–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func TestValueToString4InvalidKey(t *testing.T) {
42 bytes, err := codec.EncodeKey(time.UTC, nil, types.NewDatum(1), types.NewDatum(0.5))
43 require.NoError(t, err)
44 // Append invalid flag.
45 bytes = append(bytes, 20)
46 datum := types.NewDatum(bytes)
47 res, err := ValueToString(nil, &datum, 3, nil)
48 require.NoError(t, err)
49 require.Equal(t, "(1, 0.5, \x14)", res)
50}
51
52type bucket4Test struct {
53 lower int64

Callers

nothing calls this directly

Calls 4

EncodeKeyFunction · 0.92
NewDatumFunction · 0.92
ValueToStringFunction · 0.85
EqualMethod · 0.65

Tested by

no test coverage detected