Skip to content

Commit

Permalink
dep: update tidb package (pingcap#11198)
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 authored and 3AceShowHand committed Jun 4, 2024
1 parent 983bde3 commit 6c37933
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 19 deletions.
11 changes: 9 additions & 2 deletions dm/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ func (c *Checker) Process(ctx context.Context, pr chan pb.ProcessResult) {
errs = append(errs, unit.NewProcessError(errors.New("check was failed, please see detail")))
}

filterResults(result, c.warnCnt, c.errCnt)
filterResults(result, c.warnCnt, c.errCnt, false)

c.updateInstruction(result)

Expand Down Expand Up @@ -660,7 +660,11 @@ func (c *Checker) Process(ctx context.Context, pr chan pb.ProcessResult) {
}
}

func filterResults(result *checker.Results, warnCnt, errCnt int64) {
func filterResults(
result *checker.Results,
warnCnt, errCnt int64,
keepSuccessWhenNoFailure bool,
) {
// remove success result if not pass
results := result.Results[:0]
for _, r := range result.Results {
Expand Down Expand Up @@ -710,6 +714,9 @@ func filterResults(result *checker.Results, warnCnt, errCnt int64) {
results = append(results, r)
}
}
if keepSuccessWhenNoFailure && len(results) == 0 {
return
}
result.Results = results
}

Expand Down
2 changes: 1 addition & 1 deletion dm/checker/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ func RunCheckOnConfigs(
return result, err
}

filterResults(result, warnLimit, errLimit)
filterResults(result, warnLimit, errLimit, true)
return result, nil
}
2 changes: 1 addition & 1 deletion dm/tests/check_task/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function test_privileges_can_migrate() {
run_sql_source1 "create table checktask1.test_privilege(id int primary key, b varchar(10))"
run_sql_source1 "insert into checktask1.test_privilege values (1, 'a'),(2, 'b');"
run_sql_tidb "create user 'test1'@'%' identified by '123456';"
run_sql_tidb "grant select, create, insert, update, delete, alter, drop, index, config on *.* to 'test1'@'%';"
run_sql_tidb "grant select, create, insert, update, delete, alter, drop, index, config, create view on *.* to 'test1'@'%';"
run_sql_tidb "flush privileges;"
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"start-task $cur/conf/task-priv.yaml --remove-meta" \
Expand Down
17 changes: 13 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ require (
github.com/pierrec/lz4/v4 v4.1.18
github.com/pingcap/check v0.0.0-20211026125417-57bd13f7b5f0
github.com/pingcap/errors v0.11.5-0.20240318064555-6bd07397691f
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c
github.com/pingcap/failpoint v0.0.0-20240527053858-9b3b6e34194a
github.com/pingcap/kvproto v0.0.0-20240227073058-929ab83f9754
github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d
github.com/pingcap/tidb v1.1.0-beta.0.20240520031014-397a460dd067
github.com/pingcap/tidb v1.1.0-beta.0.20240530025951-afd8de1f6218
github.com/pingcap/tidb-dashboard v0.0.0-20240326110213-9768844ff5d7
github.com/pingcap/tidb/pkg/parser v0.0.0-20240520031014-397a460dd067
github.com/pingcap/tidb/pkg/parser v0.0.0-20240530025951-afd8de1f6218
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/client_model v0.6.1
github.com/r3labs/diff v1.1.0
Expand Down Expand Up @@ -131,6 +131,8 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/apache/arrow/go/v12 v12.0.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.6 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.36 // indirect
Expand All @@ -155,18 +157,23 @@ require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-resty/resty/v2 v2.11.0 // indirect
github.com/goccy/go-reflect v1.2.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v5 v5.2.0 // indirect
github.com/google/flatbuffers v2.0.8+incompatible // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/influxdata/tdigest v0.0.1 // indirect
github.com/jellydator/ttlcache/v3 v3.0.1 // indirect
github.com/jfcg/sixb v1.3.8 // indirect
github.com/jfcg/sorty/v2 v2.1.0 // indirect
github.com/joomcode/errorx v1.0.1 // indirect
github.com/klauspost/asmfmt v1.3.2 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/ks3sdklib/aws-sdk-go v1.2.9 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect
github.com/otiai10/copy v1.2.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/segmentio/asm v1.2.0 // indirect
Expand All @@ -180,10 +187,12 @@ require (
github.com/tidwall/rtred v0.1.2 // indirect
github.com/tidwall/tinyqueue v0.1.1 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/api v0.28.6 // indirect
Expand Down Expand Up @@ -357,7 +366,7 @@ require (
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/xdg/stringprep v1.0.3 // indirect
github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 // indirect
github.com/xitongsys/parquet-go v1.6.0 // indirect
github.com/xitongsys/parquet-go v1.6.3-0.20240520233950-75e935fc3e17 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.etcd.io/bbolt v1.3.9 // indirect
go.etcd.io/etcd/client/v2 v2.305.12 // indirect
Expand Down
Loading

0 comments on commit 6c37933

Please sign in to comment.