CutIndexKeyTo cuts encoded index key into colIDs to bytes slices. The caller should prepare the memory of the result values.
(key kv.Key, values [][]byte)
| 745 | // CutIndexKeyTo cuts encoded index key into colIDs to bytes slices. |
| 746 | // The caller should prepare the memory of the result values. |
| 747 | func CutIndexKeyTo(key kv.Key, values [][]byte) (b []byte, err error) { |
| 748 | b = key[prefixLen+idLen:] |
| 749 | length := len(values) |
| 750 | for i := 0; i < length; i++ { |
| 751 | var val []byte |
| 752 | val, b, err = codec.CutOne(b) |
| 753 | if err != nil { |
| 754 | return nil, errors.Trace(err) |
| 755 | } |
| 756 | values[i] = val |
| 757 | } |
| 758 | return |
| 759 | } |
| 760 | |
| 761 | // CutIndexKeyNew cuts encoded index key into colIDs to bytes slices. |
| 762 | // The returned value b is the remaining bytes of the key which would be empty if it is unique index or handle data |
no test coverage detected
searching dependent graphs…