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

Function TruncateIndexValues

pkg/tablecodec/tablecodec.go:1768–1774  ·  view source on GitHub ↗

TruncateIndexValues truncates the index values created using only the leading part of column values.

(tblInfo *model.TableInfo, idxInfo *model.IndexInfo, indexedValues []types.Datum)

Source from the content-addressed store, hash-verified

1766
1767// TruncateIndexValues truncates the index values created using only the leading part of column values.
1768func TruncateIndexValues(tblInfo *model.TableInfo, idxInfo *model.IndexInfo, indexedValues []types.Datum) {
1769 for i := 0; i < len(indexedValues); i++ {
1770 idxCol := idxInfo.Columns[i]
1771 tblCol := tblInfo.Columns[idxCol.Offset]
1772 TruncateIndexValue(&indexedValues[i], idxCol, tblCol)
1773 }
1774}
1775
1776// TruncateIndexValue truncate one value in the index.
1777func TruncateIndexValue(v *types.Datum, idxCol *model.IndexColumn, tblCol *model.ColumnInfo) {

Callers 13

buildHandleMethod · 0.92
encodeIndexKeyFromRowMethod · 0.92
addRecordMethod · 0.92
addIndicesMethod · 0.92
buildIndexForRowMethod · 0.92
getDuplicateErrorFunction · 0.92
getHandleMethod · 0.92
compareDataMethod · 0.92
BuildHandleFunction · 0.92
GetHandleMethod · 0.92

Calls 1

TruncateIndexValueFunction · 0.85

Tested by

no test coverage detected