Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linter: fix linter error when make dev locally #25661

Merged
merged 6 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
make linter happy locally
Signed-off-by: ailinkid <314806019@qq.com>
  • Loading branch information
AilinKid committed Jun 22, 2021
commit e587e00686a95a382bfeecd0c980fe87ea30345b
2 changes: 1 addition & 1 deletion ddl/column_type_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,7 @@ func (s *testColumnTypeChangeSuite) TestChangingColOriginDefaultValueAfterAddCol
tk1 := testkit.NewTestKit(c, s.store)
tk1.MustExec("use test")

tk.MustExec(fmt.Sprintf("set time_zone = 'UTC'"))
tk.MustExec("set time_zone = 'UTC'")
tk.MustExec("drop table if exists t")
tk.MustExec("create table t(a VARCHAR(31) NULL DEFAULT 'wwrzfwzb01j6ddj', b DECIMAL(12,0) NULL DEFAULT '-729850476163')")
tk.MustExec("ALTER TABLE t ADD COLUMN x CHAR(218) NULL DEFAULT 'lkittuae'")
Expand Down
4 changes: 2 additions & 2 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2791,7 +2791,7 @@ func (b *executorBuilder) buildTableReader(v *plannercore.PhysicalTableReader) E
if !b.ctx.GetSessionVars().UseDynamicPartitionPrune() {
return ret
}
// When isPartition is set, it means the union rewriting is done, so a partition reader is prefered.
// When isPartition is set, it means the union rewriting is done, so a partition reader is preferred.
if ok, _ := ts.IsPartition(); ok {
return ret
}
Expand Down Expand Up @@ -3020,7 +3020,7 @@ func (b *executorBuilder) buildIndexReader(v *plannercore.PhysicalIndexReader) E
if !b.ctx.GetSessionVars().UseDynamicPartitionPrune() {
return ret
}
// When isPartition is set, it means the union rewriting is done, so a partition reader is prefered.
// When isPartition is set, it means the union rewriting is done, so a partition reader is preferred.
if ok, _ := is.IsPartition(); ok {
return ret
}
Expand Down
1 change: 0 additions & 1 deletion planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3634,7 +3634,6 @@ func (ds *DataSource) addExtraPIDColumn(info *extraPIDInfo) {

info.Columns = append(info.Columns, pidCol)
info.TblIDs = append(info.TblIDs, ds.TableInfo().ID)
return
}

var (
Expand Down
3 changes: 3 additions & 0 deletions planner/core/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ const (
inSequenceFunction
)

// Make linter happy.
var _ = PreprocessorReturn{}.initedLastSnapshotTS

// PreprocessorReturn is used to retain information obtained in the preprocessor.
type PreprocessorReturn struct {
initedLastSnapshotTS bool
Expand Down
5 changes: 5 additions & 0 deletions server/tidb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,8 @@ func (ts *tidbTestTopSQLSuite) TestTopSQLAgent(c *C) {
agentServer.WaitCollectCnt(1, time.Second*4)
checkFn(8)
cancel() // cancel case 1
// Make linter happy.
_ = cancel

// case 2: agent hangs for a while
cancel = runWorkload(0, 10)
Expand All @@ -1512,6 +1514,7 @@ func (ts *tidbTestTopSQLSuite) TestTopSQLAgent(c *C) {
cancel = runWorkload(11, 20)
agentServer.WaitCollectCnt(1, time.Second*8)
checkFn(5)
_ = cancel

// case 3: agent restart
cancel = runWorkload(0, 10)
Expand All @@ -1525,6 +1528,7 @@ func (ts *tidbTestTopSQLSuite) TestTopSQLAgent(c *C) {
checkFn(5)
// run another set of SQL queries
cancel()
_ = cancel

cancel = runWorkload(11, 20)
// agent server shutdown
Expand All @@ -1536,6 +1540,7 @@ func (ts *tidbTestTopSQLSuite) TestTopSQLAgent(c *C) {
// check result
agentServer.WaitCollectCnt(2, time.Second*8)
checkFn(5)
_ = cancel
}

func (ts *tidbTestTopSQLSuite) loopExec(ctx context.Context, c *C, fn func(db *sql.DB)) {
Expand Down
3 changes: 3 additions & 0 deletions structure/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ const (
ListData TypeFlag = 'l'
)

// Make linter happy, since encodeHashMetaKey is unused in this repo.
var _ = (&TxStructure{}).encodeHashMetaKey

func (t *TxStructure) encodeStringDataKey(key []byte) kv.Key {
// for codec Encode, we may add extra bytes data, so here and following encode
// we will use extra length like 4 for a little optimization.
Expand Down