Skip to content

Commit 6a912e7

Browse files
committed
refind package names
1 parent 435797d commit 6a912e7

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

br/pkg/backup/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
"google.golang.org/grpc/status"
3232

3333
"github.com/pingcap/tidb/br/pkg/conn"
34-
util2 "github.com/pingcap/tidb/br/pkg/conn/util"
34+
connutil "github.com/pingcap/tidb/br/pkg/conn/util"
3535
berrors "github.com/pingcap/tidb/br/pkg/errors"
3636
"github.com/pingcap/tidb/br/pkg/logutil"
3737
"github.com/pingcap/tidb/br/pkg/metautil"
@@ -488,7 +488,7 @@ func (bc *Client) BackupRange(
488488
zap.Uint32("concurrency", req.Concurrency))
489489

490490
var allStores []*metapb.Store
491-
allStores, err = conn.GetAllTiKVStoresWithRetry(ctx, bc.mgr.GetPDClient(), util2.SkipTiFlash)
491+
allStores, err = conn.GetAllTiKVStoresWithRetry(ctx, bc.mgr.GetPDClient(), connutil.SkipTiFlash)
492492
if err != nil {
493493
return errors.Trace(err)
494494
}

ddl/ddl_api.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import (
5151
"github.com/pingcap/tidb/sessionctx/variable"
5252
"github.com/pingcap/tidb/table"
5353
"github.com/pingcap/tidb/table/tables"
54-
util2 "github.com/pingcap/tidb/table/tables/util"
54+
tableutil "github.com/pingcap/tidb/table/tables/util"
5555
"github.com/pingcap/tidb/types"
5656
driver "github.com/pingcap/tidb/types/parser_driver"
5757
"github.com/pingcap/tidb/util"
@@ -1637,7 +1637,7 @@ func buildTableInfo(
16371637
if tbInfo.IsCommonHandle {
16381638
// Ensure tblInfo's each non-unique secondary-index's len + primary-key's len <= MaxIndexLength for clustered index table.
16391639
var pkLen, idxLen int
1640-
pkLen, err = indexColumnsLen(tbInfo.Columns, util2.FindPrimaryIndex(tbInfo).Columns)
1640+
pkLen, err = indexColumnsLen(tbInfo.Columns, tableutil.FindPrimaryIndex(tbInfo).Columns)
16411641
if err != nil {
16421642
return
16431643
}
@@ -4282,7 +4282,7 @@ func checkColumnWithIndexConstraint(tbInfo *model.TableInfo, originalCol, newCol
42824282
break
42834283
}
42844284

4285-
pkIndex := util2.FindPrimaryIndex(tbInfo)
4285+
pkIndex := tableutil.FindPrimaryIndex(tbInfo)
42864286
var clusteredPkLen int
42874287
if tbInfo.IsCommonHandle {
42884288
var err error
@@ -5464,7 +5464,7 @@ func (d *ddl) CreateIndex(ctx sessionctx.Context, ti ast.Ident, keyType ast.Inde
54645464
if !unique && tblInfo.IsCommonHandle {
54655465
// Ensure new created non-unique secondary-index's len + primary-key's len <= MaxIndexLength in clustered index table.
54665466
var pkLen, idxLen int
5467-
pkLen, err = indexColumnsLen(tblInfo.Columns, util2.FindPrimaryIndex(tblInfo).Columns)
5467+
pkLen, err = indexColumnsLen(tblInfo.Columns, tableutil.FindPrimaryIndex(tblInfo).Columns)
54685468
if err != nil {
54695469
return err
54705470
}

planner/core/physical_plans.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
"github.com/pingcap/tidb/sessionctx/stmtctx"
3434
"github.com/pingcap/tidb/statistics"
3535
"github.com/pingcap/tidb/table"
36-
util2 "github.com/pingcap/tidb/table/tables/util"
36+
tablesutil "github.com/pingcap/tidb/table/tables/util"
3737
"github.com/pingcap/tidb/types"
3838
"github.com/pingcap/tidb/util/ranger"
3939
"github.com/pingcap/tidb/util/stringutil"
@@ -532,7 +532,7 @@ func (ts *PhysicalTableScan) IsPartition() (bool, int64) {
532532
func (ts *PhysicalTableScan) ResolveCorrelatedColumns() ([]*ranger.Range, error) {
533533
access := ts.AccessCondition
534534
if ts.Table.IsCommonHandle {
535-
pkIdx := util2.FindPrimaryIndex(ts.Table)
535+
pkIdx := tablesutil.FindPrimaryIndex(ts.Table)
536536
idxCols, idxColLens := expression.IndexInfo2PrefixCols(ts.Columns, ts.Schema().Columns, pkIdx)
537537
for _, cond := range access {
538538
newCond, err := expression.SubstituteCorCol2Constant(cond)

planner/core/planbuilder.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import (
4848
"github.com/pingcap/tidb/sessionctx/variable"
4949
"github.com/pingcap/tidb/statistics"
5050
"github.com/pingcap/tidb/table"
51-
util3 "github.com/pingcap/tidb/table/tables/util"
51+
tablesutil "github.com/pingcap/tidb/table/tables/util"
5252
"github.com/pingcap/tidb/table/temptable"
5353
"github.com/pingcap/tidb/types"
5454
driver "github.com/pingcap/tidb/types/parser_driver"
@@ -1524,7 +1524,7 @@ func tryGetCommonHandleCols(t table.Table, allColSchema *expression.Schema) ([]*
15241524
if !tblInfo.IsCommonHandle {
15251525
return nil, nil, false
15261526
}
1527-
pk := util3.FindPrimaryIndex(tblInfo)
1527+
pk := tablesutil.FindPrimaryIndex(tblInfo)
15281528
commonHandleCols, _ := expression.IndexInfo2Cols(tblInfo.Columns, allColSchema.Columns, pk)
15291529
commonHandelColInfos := tables.TryGetCommonPkColumns(t)
15301530
return commonHandelColInfos, commonHandleCols, true
@@ -1738,7 +1738,7 @@ func BuildHandleColsForAnalyze(ctx sessionctx.Context, tblInfo *model.TableInfo,
17381738
Index: index,
17391739
}}
17401740
case tblInfo.IsCommonHandle:
1741-
pkIdx := util3.FindPrimaryIndex(tblInfo)
1741+
pkIdx := tablesutil.FindPrimaryIndex(tblInfo)
17421742
pkColLen := len(pkIdx.Columns)
17431743
columns := make([]*expression.Column, pkColLen)
17441744
for i := 0; i < pkColLen; i++ {
@@ -3715,7 +3715,7 @@ func buildHandleColumnInfos(tblInfo *model.TableInfo) []*model.ColumnInfo {
37153715
return []*model.ColumnInfo{col}
37163716
}
37173717
case tblInfo.IsCommonHandle:
3718-
pkIdx := util3.FindPrimaryIndex(tblInfo)
3718+
pkIdx := tablesutil.FindPrimaryIndex(tblInfo)
37193719
pkCols := make([]*model.ColumnInfo, 0, len(pkIdx.Columns))
37203720
cols := tblInfo.Columns
37213721
for _, idxCol := range pkIdx.Columns {

server/http_handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import (
5959
"github.com/pingcap/tidb/store/helper"
6060
"github.com/pingcap/tidb/table"
6161
"github.com/pingcap/tidb/table/tables"
62-
util2 "github.com/pingcap/tidb/table/tables/util"
62+
tablesutil "github.com/pingcap/tidb/table/tables/util"
6363
"github.com/pingcap/tidb/tablecodec"
6464
"github.com/pingcap/tidb/types"
6565
"github.com/pingcap/tidb/util"
@@ -176,7 +176,7 @@ func (t *tikvHandlerTool) getHandle(tb table.PhysicalTable, params map[string]st
176176
handle = kv.IntHandle(intHandle)
177177
} else {
178178
tblInfo := tb.Meta()
179-
pkIdx := util2.FindPrimaryIndex(tblInfo)
179+
pkIdx := tablesutil.FindPrimaryIndex(tblInfo)
180180
if pkIdx == nil || !tblInfo.IsCommonHandle {
181181
return nil, errors.BadRequestf("Clustered common handle not found.")
182182
}

table/tables/tables.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ import (
4343
"github.com/pingcap/tidb/sessionctx/variable"
4444
"github.com/pingcap/tidb/statistics"
4545
"github.com/pingcap/tidb/table"
46-
context2 "github.com/pingcap/tidb/table/tables/context"
47-
util2 "github.com/pingcap/tidb/table/tables/util"
46+
tablecontext "github.com/pingcap/tidb/table/tables/context"
47+
tablesutil "github.com/pingcap/tidb/table/tables/util"
4848
"github.com/pingcap/tidb/tablecodec"
4949
"github.com/pingcap/tidb/types"
5050
"github.com/pingcap/tidb/util"
@@ -515,15 +515,15 @@ func adjustRowValuesBuf(writeBufs *variable.WriteStmtBufs, rowLen int) {
515515

516516
// ClearAddRecordCtx remove `CommonAddRecordCtx` from session context
517517
func ClearAddRecordCtx(ctx sessionctx.Context) {
518-
ctx.ClearValue(context2.AddRecordCtxKey)
518+
ctx.ClearValue(tablecontext.AddRecordCtxKey)
519519
}
520520

521521
// TryGetCommonPkColumnIds get the IDs of primary key column if the table has common handle.
522522
func TryGetCommonPkColumnIds(tbl *model.TableInfo) []int64 {
523523
if !tbl.IsCommonHandle {
524524
return nil
525525
}
526-
pkIdx := util2.FindPrimaryIndex(tbl)
526+
pkIdx := tablesutil.FindPrimaryIndex(tbl)
527527
pkColIds := make([]int64, 0, len(pkIdx.Columns))
528528
for _, idxCol := range pkIdx.Columns {
529529
pkColIds = append(pkColIds, tbl.Columns[idxCol.Offset].ID)
@@ -551,7 +551,7 @@ func TryGetCommonPkColumns(tbl table.Table) []*table.Column {
551551
if !tbl.Meta().IsCommonHandle {
552552
return nil
553553
}
554-
pkIdx := util2.FindPrimaryIndex(tbl.Meta())
554+
pkIdx := tablesutil.FindPrimaryIndex(tbl.Meta())
555555
cols := tbl.Cols()
556556
pkCols := make([]*table.Column, 0, len(pkIdx.Columns))
557557
for _, idxCol := range pkIdx.Columns {
@@ -637,7 +637,7 @@ func (t *TableCommon) AddRecord(sctx sessionctx.Context, r []types.Datum, opts .
637637
recordID = kv.IntHandle(r[tblInfo.GetPkColInfo().Offset].GetInt64())
638638
hasRecordID = true
639639
} else if tblInfo.IsCommonHandle {
640-
pkIdx := util2.FindPrimaryIndex(tblInfo)
640+
pkIdx := tablesutil.FindPrimaryIndex(tblInfo)
641641
pkDts := make([]types.Datum, 0, len(pkIdx.Columns))
642642
for _, idxCol := range pkIdx.Columns {
643643
pkDts = append(pkDts, r[idxCol.Offset])
@@ -676,7 +676,7 @@ func (t *TableCommon) AddRecord(sctx sessionctx.Context, r []types.Datum, opts .
676676

677677
var colIDs, binlogColIDs []int64
678678
var row, binlogRow []types.Datum
679-
if recordCtx, ok := sctx.Value(context2.AddRecordCtxKey).(*context2.CommonAddRecordCtx); ok {
679+
if recordCtx, ok := sctx.Value(tablecontext.AddRecordCtxKey).(*tablecontext.CommonAddRecordCtx); ok {
680680
colIDs = recordCtx.ColIDs[:0]
681681
row = recordCtx.Row[:0]
682682
} else {
@@ -888,7 +888,7 @@ func RowWithCols(t table.Table, ctx sessionctx.Context, h kv.Handle, cols []*tab
888888
if err != nil {
889889
return nil, err
890890
}
891-
v, _, err := util2.DecodeRawRowData(ctx, t.Meta(), h, cols, value)
891+
v, _, err := tablesutil.DecodeRawRowData(ctx, t.Meta(), h, cols, value)
892892
if err != nil {
893893
return nil, err
894894
}
@@ -1168,7 +1168,7 @@ func IterRecords(t table.Table, ctx sessionctx.Context, cols []*table.Column,
11681168
data[col.Offset] = rowMap[col.ID]
11691169
continue
11701170
}
1171-
data[col.Offset], err = util2.GetColDefaultValue(ctx, col, defaultVals)
1171+
data[col.Offset], err = tablesutil.GetColDefaultValue(ctx, col, defaultVals)
11721172
if err != nil {
11731173
return err
11741174
}
@@ -1325,7 +1325,7 @@ func CanSkip(info *model.TableInfo, col *table.Column, value *types.Datum) bool
13251325
return true
13261326
}
13271327
if col.IsCommonHandleColumn(info) {
1328-
pkIdx := util2.FindPrimaryIndex(info)
1328+
pkIdx := tablesutil.FindPrimaryIndex(info)
13291329
for _, idxCol := range pkIdx.Columns {
13301330
if info.Columns[idxCol.Offset].ID != col.ID {
13311331
continue
@@ -1591,7 +1591,7 @@ func TryGetHandleRestoredDataWrapper(t table.Table, row []types.Datum, rowMap ma
15911591
return nil
15921592
}
15931593
rsData := make([]types.Datum, 0, 4)
1594-
pkIdx := util2.FindPrimaryIndex(t.Meta())
1594+
pkIdx := tablesutil.FindPrimaryIndex(t.Meta())
15951595
for _, pkIdxCol := range pkIdx.Columns {
15961596
pkCol := t.Meta().Columns[pkIdxCol.Offset]
15971597
if !types.NeedRestoredData(&pkCol.FieldType) {

0 commit comments

Comments
 (0)