diff --git a/pkg/ddl/ddl_worker.go b/pkg/ddl/ddl_worker.go index a98513c85d626..3b59093359124 100644 --- a/pkg/ddl/ddl_worker.go +++ b/pkg/ddl/ddl_worker.go @@ -926,23 +926,6 @@ func writeBinlog(binlogCli *pumpcli.PumpsClient, txn kv.Transaction, job *model. } } -// waitDependencyJobFinished waits for the dependency-job to be finished. -// If the dependency job isn't finished yet, we'd better wait a moment. -func (w *worker) waitDependencyJobFinished(job *model.Job, cnt *int) { - if job.DependencyID != noneDependencyJob { - intervalCnt := int(3 * time.Second / waitDependencyJobInterval) - if *cnt%intervalCnt == 0 { - w.jobLogger(job).Info("DDL job need to wait dependent job, sleeps a while, then retries it.", - zap.Int64("dependentJobID", job.DependencyID), - zap.Duration("waitTime", waitDependencyJobInterval)) - } - time.Sleep(waitDependencyJobInterval) - *cnt++ - } else { - *cnt = 0 - } -} - func chooseLeaseTime(t, max time.Duration) time.Duration { if t == 0 || t > max { return max diff --git a/pkg/domain/plan_replayer.go b/pkg/domain/plan_replayer.go index fddee4868ae30..4980395a80126 100644 --- a/pkg/domain/plan_replayer.go +++ b/pkg/domain/plan_replayer.go @@ -52,10 +52,6 @@ type dumpFileGcChecker struct { planReplayerTaskStatus *planReplayerDumpTaskStatus } -func parseType(s string) string { - return strings.Split(s, "_")[0] -} - func parseTime(s string) (time.Time, error) { startIdx := strings.LastIndex(s, "_") if startIdx == -1 { diff --git a/pkg/executor/internal/calibrateresource/calibrate_resource.go b/pkg/executor/internal/calibrateresource/calibrate_resource.go index 0d3a34c60f0ee..a4dedeba6f44b 100644 --- a/pkg/executor/internal/calibrateresource/calibrate_resource.go +++ b/pkg/executor/internal/calibrateresource/calibrate_resource.go @@ -595,18 +595,6 @@ func getComponentCPUUsagePerSec(ctx context.Context, sctx sessionctx.Context, ex return getValuesFromMetrics(ctx, sctx, exec, query) } -func getNumberFromMetrics(ctx context.Context, exec sqlexec.RestrictedSQLExecutor, query, metrics string) (float64, error) { - rows, _, err := exec.ExecRestrictedSQL(ctx, []sqlexec.OptionFuncAlias{sqlexec.ExecOptionUseCurSession}, query) - if err != nil { - return 0.0, errors.Trace(err) - } - if len(rows) == 0 { - return 0.0, errors.Errorf("metrics '%s' is empty", metrics) - } - - return rows[0].GetFloat64(0), nil -} - func getValuesFromMetrics(ctx context.Context, sctx sessionctx.Context, exec sqlexec.RestrictedSQLExecutor, query string) (*timeSeriesValues, error) { rows, _, err := exec.ExecRestrictedSQL(ctx, []sqlexec.OptionFuncAlias{sqlexec.ExecOptionUseCurSession}, query) if err != nil { diff --git a/pkg/planner/core/planbuilder.go b/pkg/planner/core/planbuilder.go index ee2f416adc92e..dd819dc204238 100644 --- a/pkg/planner/core/planbuilder.go +++ b/pkg/planner/core/planbuilder.go @@ -1300,17 +1300,6 @@ func removeGlobalIndexPaths(paths []*util.AccessPath) []*util.AccessPath { return paths[:i] } -func removeTiflashDuringStaleRead(paths []*util.AccessPath) []*util.AccessPath { - n := 0 - for _, path := range paths { - if path.StoreType != kv.TiFlash { - paths[n] = path - n++ - } - } - return paths[:n] -} - func (b *PlanBuilder) buildSelectLock(src LogicalPlan, lock *ast.SelectLockInfo) (*LogicalLock, error) { var tblID2PhysTblIDCol map[int64]*expression.Column if len(b.partitionedTable) > 0 { diff --git a/pkg/planner/core/scalar_subq_expression.go b/pkg/planner/core/scalar_subq_expression.go index e677d7e260066..d51617aa6669b 100644 --- a/pkg/planner/core/scalar_subq_expression.go +++ b/pkg/planner/core/scalar_subq_expression.go @@ -184,12 +184,12 @@ func (*ScalarSubQueryExpr) ConstLevel() expression.ConstLevel { } // Decorrelate implements the Expression interface. -func (s *ScalarSubQueryExpr) Decorrelate(_ *expression.Schema) expression.Expression { +func (s *ScalarSubQueryExpr) Decorrelate(*expression.Schema) expression.Expression { return s } // resolveIndices implements the Expression interface. -func (*ScalarSubQueryExpr) resolveIndices(_ *expression.Schema) error { +func (*ScalarSubQueryExpr) resolveIndices(*expression.Schema) error { return nil }