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

Function TestUntouchedIndexKValue

pkg/tablecodec/tablecodec_test.go:594–603  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

592}
593
594func TestUntouchedIndexKValue(t *testing.T) {
595 untouchedIndexKey := []byte("t00000001_i000000001")
596 untouchedIndexValue := []byte{0, 0, 0, 0, 0, 0, 0, 1, 49}
597 require.True(t, IsUntouchedIndexKValue(untouchedIndexKey, untouchedIndexValue))
598 IndexKey2TempIndexKey(untouchedIndexKey)
599 require.True(t, IsUntouchedIndexKValue(untouchedIndexKey, untouchedIndexValue))
600 elem := TempIndexValueElem{Handle: kv.IntHandle(1), Delete: true, Distinct: true}
601 tmpIdxVal := elem.Encode(nil)
602 require.False(t, IsUntouchedIndexKValue(untouchedIndexKey, tmpIdxVal))
603}
604
605func TestTempIndexKey(t *testing.T) {
606 values := []types.Datum{types.NewIntDatum(1), types.NewBytesDatum([]byte("abc")), types.NewFloat64Datum(5.5)}

Callers

nothing calls this directly

Calls 4

EncodeMethod · 0.95
IntHandleTypeAlias · 0.92
IsUntouchedIndexKValueFunction · 0.85
IndexKey2TempIndexKeyFunction · 0.85

Tested by

no test coverage detected