(allCols []rowcodec.ColInfo)
| 911 | } |
| 912 | |
| 913 | func buildRestoredColumn(allCols []rowcodec.ColInfo) []rowcodec.ColInfo { |
| 914 | restoredColumns := make([]rowcodec.ColInfo, 0, len(allCols)) |
| 915 | for i, col := range allCols { |
| 916 | if !types.NeedRestoredData(col.Ft) { |
| 917 | continue |
| 918 | } |
| 919 | copyColInfo := rowcodec.ColInfo{ |
| 920 | ID: col.ID, |
| 921 | } |
| 922 | if collate.IsBinCollation(col.Ft.GetCollate()) { |
| 923 | // Change the fieldType from string to uint since we store the number of the truncated spaces. |
| 924 | // NOTE: the corresponding datum is generated as `types.NewUintDatum(paddingSize)`, and the raw data is |
| 925 | // encoded via `encodeUint`. Thus we should mark the field type as unsigened here so that the BytesDecoder |
| 926 | // can decode it correctly later. Otherwise there might be issues like #47115. |
| 927 | copyColInfo.Ft = types.NewFieldType(mysql.TypeLonglong) |
| 928 | copyColInfo.Ft.AddFlag(mysql.UnsignedFlag) |
| 929 | } else { |
| 930 | copyColInfo.Ft = allCols[i].Ft |
| 931 | } |
| 932 | restoredColumns = append(restoredColumns, copyColInfo) |
| 933 | } |
| 934 | return restoredColumns |
| 935 | } |
| 936 | |
| 937 | func decodeIndexKvOldCollation(key, value []byte, hdStatus HandleStatus, buf []byte, resultValues [][]byte) ([][]byte, error) { |
| 938 | b, err := CutIndexKeyTo(key, resultValues) |
no test coverage detected
searching dependent graphs…