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

Method getSplitTableKeysFromBound

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

Source from the content-addressed store, hash-verified

504}
505
506func (e *SplitTableRegionExec) getSplitTableKeysFromBound() ([][]byte, error) {
507 var keys [][]byte
508 pi := e.tableInfo.GetPartitionInfo()
509 if pi == nil {
510 keys = make([][]byte, 0, e.num)
511 return e.getSplitTablePhysicalKeysFromBound(e.tableInfo.ID, keys)
512 }
513
514 // Split for all table partitions.
515 if len(e.partitionNames) == 0 {
516 keys = make([][]byte, 0, e.num*len(pi.Definitions))
517 for _, p := range pi.Definitions {
518 var err error
519 keys, err = e.getSplitTablePhysicalKeysFromBound(p.ID, keys)
520 if err != nil {
521 return nil, err
522 }
523 }
524 return keys, nil
525 }
526
527 // Split for specified table partitions.
528 keys = make([][]byte, 0, e.num*len(e.partitionNames))
529 for _, name := range e.partitionNames {
530 pid, err := tables.FindPartitionByName(e.tableInfo, name.L)
531 if err != nil {
532 return nil, err
533 }
534 keys, err = e.getSplitTablePhysicalKeysFromBound(pid, keys)
535 if err != nil {
536 return nil, err
537 }
538 }
539 return keys, nil
540}
541
542func (e *SplitTableRegionExec) calculateIntBoundValue() (lowerValue int64, step int64, err error) {
543 isUnsigned := false

Callers 1

getSplitTableKeysMethod · 0.95

Calls 3

FindPartitionByNameFunction · 0.92
GetPartitionInfoMethod · 0.80

Tested by

no test coverage detected