MCPcopy Index your code
hub / github.com/pingcap/tidb / getSplitTableKeysFromValueList

Method getSplitTableKeysFromValueList

pkg/executor/split.go:457–491  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

455}
456
457func (e *SplitTableRegionExec) getSplitTableKeysFromValueList() ([][]byte, error) {
458 var keys [][]byte
459 pi := e.tableInfo.GetPartitionInfo()
460 if pi == nil {
461 keys = make([][]byte, 0, len(e.valueLists))
462 return e.getSplitTablePhysicalKeysFromValueList(e.tableInfo.ID, keys)
463 }
464
465 // Split for all table partitions.
466 if len(e.partitionNames) == 0 {
467 keys = make([][]byte, 0, len(e.valueLists)*len(pi.Definitions))
468 for _, p := range pi.Definitions {
469 var err error
470 keys, err = e.getSplitTablePhysicalKeysFromValueList(p.ID, keys)
471 if err != nil {
472 return nil, err
473 }
474 }
475 return keys, nil
476 }
477
478 // Split for specified table partitions.
479 keys = make([][]byte, 0, len(e.valueLists)*len(e.partitionNames))
480 for _, name := range e.partitionNames {
481 pid, err := tables.FindPartitionByName(e.tableInfo, name.L)
482 if err != nil {
483 return nil, err
484 }
485 keys, err = e.getSplitTablePhysicalKeysFromValueList(pid, keys)
486 if err != nil {
487 return nil, err
488 }
489 }
490 return keys, nil
491}
492
493func (e *SplitTableRegionExec) getSplitTablePhysicalKeysFromValueList(physicalID int64, keys [][]byte) ([][]byte, error) {
494 recordPrefix := tablecodec.GenTableRecordPrefix(physicalID)

Callers 1

getSplitTableKeysMethod · 0.95

Calls 3

FindPartitionByNameFunction · 0.92
GetPartitionInfoMethod · 0.80

Tested by

no test coverage detected