(values [][]byte, offset int, col *ColInfo, handle kv.Handle, cacheBytes []byte)
| 446 | } |
| 447 | |
| 448 | func (decoder *BytesDecoder) tryDecodeHandle(values [][]byte, offset int, col *ColInfo, |
| 449 | handle kv.Handle, cacheBytes []byte) bool { |
| 450 | if handle == nil { |
| 451 | return false |
| 452 | } |
| 453 | if types.NeedRestoredData(col.Ft) { |
| 454 | return false |
| 455 | } |
| 456 | if col.IsPKHandle || col.ID == model.ExtraHandleID { |
| 457 | handleData := cacheBytes |
| 458 | if mysql.HasUnsignedFlag(col.Ft.GetFlag()) { |
| 459 | handleData = append(handleData, UintFlag) |
| 460 | handleData = codec.EncodeUint(handleData, uint64(handle.IntValue())) |
| 461 | } else { |
| 462 | handleData = append(handleData, IntFlag) |
| 463 | handleData = codec.EncodeInt(handleData, handle.IntValue()) |
| 464 | } |
| 465 | values[offset] = handleData |
| 466 | return true |
| 467 | } |
| 468 | var handleData []byte |
| 469 | for i, hid := range decoder.handleColIDs { |
| 470 | if col.ID == hid { |
| 471 | handleData = append(handleData, handle.EncodedCol(i)...) |
| 472 | } |
| 473 | } |
| 474 | if len(handleData) > 0 { |
| 475 | values[offset] = handleData |
| 476 | return true |
| 477 | } |
| 478 | return false |
| 479 | } |
| 480 | |
| 481 | // DecodeToBytesNoHandle decodes raw byte slice to row data without handle. |
| 482 | func (decoder *BytesDecoder) DecodeToBytesNoHandle(outputOffset map[int64]int, value []byte) ([][]byte, error) { |
no test coverage detected