diff --git a/Gopkg.lock b/Gopkg.lock index cd8226d284c46..f2b0b627a52b1 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -329,7 +329,7 @@ [[projects]] digest = "1:4b96ce0f151b10c52b1d6876c179e9a6d2329f98939c4cf8148daaf27f981413" - name = "github.com/pkg/errors" + name = "github.com/pingcap/errors" packages = ["."] pruneopts = "NUT" revision = "1176802fff62540cc87d289bd40c52a2d6b2ea16" @@ -577,7 +577,7 @@ "github.com/pingcap/tidb-tools/tidb-binlog/pump_client", "github.com/pingcap/tipb/go-binlog", "github.com/pingcap/tipb/go-tipb", - "github.com/pkg/errors", + "github.com/pingcap/errors", "github.com/prometheus/client_golang/prometheus", "github.com/prometheus/client_golang/prometheus/push", "github.com/sirupsen/logrus", diff --git a/Gopkg.toml b/Gopkg.toml index 57a9061159479..807b2fee97d49 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -94,7 +94,7 @@ required = ["github.com/golang/protobuf/jsonpb"] name = "github.com/pingcap/tipb" [[constraint]] - name = "github.com/pkg/errors" + name = "github.com/pingcap/errors" version = "0.11.0" source = "https://github.com/pingcap/errors.git" diff --git a/cmd/benchfilesort/main.go b/cmd/benchfilesort/main.go index 3116638efb902..08c16353a58fd 100644 --- a/cmd/benchfilesort/main.go +++ b/cmd/benchfilesort/main.go @@ -24,13 +24,13 @@ import ( "runtime/pprof" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/filesort" "github.com/pingcap/tidb/util/logutil" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/cmd/benchkv/main.go b/cmd/benchkv/main.go index 9210170dba708..d6589591a6724 100644 --- a/cmd/benchkv/main.go +++ b/cmd/benchkv/main.go @@ -24,10 +24,10 @@ import ( _ "github.com/go-sql-driver/mysql" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store/tikv" - "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" "golang.org/x/net/context" diff --git a/cmd/benchraw/main.go b/cmd/benchraw/main.go index f1c6f30b40279..b517b14a3a299 100644 --- a/cmd/benchraw/main.go +++ b/cmd/benchraw/main.go @@ -22,10 +22,10 @@ import ( "sync" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/store/tikv" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/cmd/explaintest/main.go b/cmd/explaintest/main.go index cc3e6dd9b6e61..d3650f8a05eb1 100644 --- a/cmd/explaintest/main.go +++ b/cmd/explaintest/main.go @@ -26,12 +26,12 @@ import ( "flag" "github.com/go-sql-driver/mysql" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/logutil" "github.com/pingcap/tidb/util/mock" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "time" ) diff --git a/cmd/importer/config.go b/cmd/importer/config.go index 62f6eb74ba3a5..34d13fc95f8d9 100644 --- a/cmd/importer/config.go +++ b/cmd/importer/config.go @@ -18,7 +18,7 @@ import ( "fmt" "github.com/BurntSushi/toml" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) // NewConfig creates a new config. diff --git a/cmd/importer/db.go b/cmd/importer/db.go index 92bf182828ed0..71d498d83d933 100644 --- a/cmd/importer/db.go +++ b/cmd/importer/db.go @@ -21,8 +21,8 @@ import ( "strings" _ "github.com/go-sql-driver/mysql" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/cmd/importer/job.go b/cmd/importer/job.go index 50d38fd400112..07277d38474e5 100644 --- a/cmd/importer/job.go +++ b/cmd/importer/job.go @@ -18,7 +18,7 @@ import ( "fmt" "time" - "github.com/pkg/errors" + "github.com/pingcap/errors" log "github.com/sirupsen/logrus" ) diff --git a/cmd/importer/main.go b/cmd/importer/main.go index 923fd5d655512..7abaaf1ce59f1 100644 --- a/cmd/importer/main.go +++ b/cmd/importer/main.go @@ -17,7 +17,7 @@ import ( "flag" "os" - "github.com/pkg/errors" + "github.com/pingcap/errors" log "github.com/sirupsen/logrus" ) diff --git a/cmd/importer/parser.go b/cmd/importer/parser.go index b953403698d88..3bc8e49dd64ac 100644 --- a/cmd/importer/parser.go +++ b/cmd/importer/parser.go @@ -18,6 +18,7 @@ import ( "strconv" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" @@ -25,7 +26,6 @@ import ( _ "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/mock" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/cmd/importer/stats.go b/cmd/importer/stats.go index 5ef2a543805e3..c1f4896bb776f 100644 --- a/cmd/importer/stats.go +++ b/cmd/importer/stats.go @@ -19,12 +19,12 @@ import ( "math/rand" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" stats "github.com/pingcap/tidb/statistics" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/config/config.go b/config/config.go index 7f19f634397a4..0a58f7936f397 100644 --- a/config/config.go +++ b/config/config.go @@ -20,8 +20,8 @@ import ( "time" "github.com/BurntSushi/toml" + "github.com/pingcap/errors" "github.com/pingcap/tidb/util/logutil" - "github.com/pkg/errors" tracing "github.com/uber/jaeger-client-go/config" ) diff --git a/ddl/column.go b/ddl/column.go index e28ff4b18bc12..b25b12b51efaf 100644 --- a/ddl/column.go +++ b/ddl/column.go @@ -16,6 +16,7 @@ package ddl import ( "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -24,7 +25,6 @@ import ( "github.com/pingcap/tidb/meta" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/ddl/column_change_test.go b/ddl/column_change_test.go index 6655067a3f9c8..fc0acf34b87d5 100644 --- a/ddl/column_change_test.go +++ b/ddl/column_change_test.go @@ -19,6 +19,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/kv" @@ -30,7 +31,6 @@ import ( "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/testleak" "github.com/pingcap/tidb/util/testutil" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/ddl/column_test.go b/ddl/column_test.go index 1859f1a696d73..91a2af5062cf9 100644 --- a/ddl/column_test.go +++ b/ddl/column_test.go @@ -18,6 +18,7 @@ import ( "sync" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" @@ -30,7 +31,6 @@ import ( "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/ddl/db_change_test.go b/ddl/db_change_test.go index 1df966848094a..5ae512e8a8552 100644 --- a/ddl/db_change_test.go +++ b/ddl/db_change_test.go @@ -21,6 +21,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" @@ -37,7 +38,6 @@ import ( "github.com/pingcap/tidb/util/sqlexec" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/ddl/db_integration_test.go b/ddl/db_integration_test.go index 2698a82b5256c..effcb92e2d832 100644 --- a/ddl/db_integration_test.go +++ b/ddl/db_integration_test.go @@ -17,6 +17,7 @@ import ( "fmt" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/ddl" "github.com/pingcap/tidb/domain" @@ -30,7 +31,6 @@ import ( "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) var _ = Suite(&testIntegrationSuite{}) diff --git a/ddl/db_test.go b/ddl/db_test.go index df201fdc12abc..c55314a5dc139 100644 --- a/ddl/db_test.go +++ b/ddl/db_test.go @@ -24,6 +24,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -48,7 +49,6 @@ import ( "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" "github.com/pingcap/tidb/util/testutil" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/ddl/ddl.go b/ddl/ddl.go index b54b4e976cfa9..030268e74feef 100644 --- a/ddl/ddl.go +++ b/ddl/ddl.go @@ -24,6 +24,7 @@ import ( "github.com/coreos/etcd/clientv3" "github.com/ngaut/pools" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -40,7 +41,6 @@ import ( "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/table" tidbutil "github.com/pingcap/tidb/util" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/twinj/uuid" "golang.org/x/net/context" diff --git a/ddl/ddl_api.go b/ddl/ddl_api.go index 2d9f6b2393e9e..5eb8dbbce956b 100644 --- a/ddl/ddl_api.go +++ b/ddl/ddl_api.go @@ -24,6 +24,7 @@ import ( "time" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/model" @@ -35,7 +36,6 @@ import ( "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" - "github.com/pkg/errors" ) func (d *ddl) CreateSchema(ctx sessionctx.Context, schema model.CIStr, charsetInfo *ast.CharsetOpt) (err error) { diff --git a/ddl/ddl_worker.go b/ddl/ddl_worker.go index fd6ed28300fc1..5bf70ed2f3d9f 100644 --- a/ddl/ddl_worker.go +++ b/ddl/ddl_worker.go @@ -20,6 +20,7 @@ import ( "time" "github.com/ngaut/pools" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" @@ -27,7 +28,6 @@ import ( "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/sessionctx/binloginfo" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/ddl/ddl_worker_test.go b/ddl/ddl_worker_test.go index dbba30142bea0..fb75ca744e223 100644 --- a/ddl/ddl_worker_test.go +++ b/ddl/ddl_worker_test.go @@ -18,6 +18,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -29,7 +30,6 @@ import ( "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/sqlexec" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/ddl/delete_range.go b/ddl/delete_range.go index 25a4512d6beeb..afe30274ee33a 100644 --- a/ddl/delete_range.go +++ b/ddl/delete_range.go @@ -20,6 +20,7 @@ import ( "math" "sync" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/ddl/util" @@ -27,7 +28,6 @@ import ( "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/ddl/foreign_key.go b/ddl/foreign_key.go index d6c3de7d75c1e..b5f9e4fb90185 100644 --- a/ddl/foreign_key.go +++ b/ddl/foreign_key.go @@ -14,10 +14,10 @@ package ddl import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/infoschema" "github.com/pingcap/tidb/meta" - "github.com/pkg/errors" ) func onCreateForeignKey(t *meta.Meta, job *model.Job) (ver int64, _ error) { diff --git a/ddl/foreign_key_test.go b/ddl/foreign_key_test.go index 386b62e604e4e..2bb7eaa2c7cf0 100644 --- a/ddl/foreign_key_test.go +++ b/ddl/foreign_key_test.go @@ -18,13 +18,13 @@ import ( "sync" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/ddl/generated_column.go b/ddl/generated_column.go index 3120b2d907258..0e752c0df525b 100644 --- a/ddl/generated_column.go +++ b/ddl/generated_column.go @@ -14,9 +14,9 @@ package ddl import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/table" - "github.com/pkg/errors" ) // columnGenerationInDDL is a struct for validating generated columns in DDL. diff --git a/ddl/index.go b/ddl/index.go index 2e92bf619c05e..b8454dff94e9e 100644 --- a/ddl/index.go +++ b/ddl/index.go @@ -19,6 +19,7 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -37,7 +38,6 @@ import ( "github.com/pingcap/tidb/util" "github.com/pingcap/tidb/util/rowDecoder" "github.com/pingcap/tidb/util/timeutil" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/ddl/index_change_test.go b/ddl/index_change_test.go index 518b0847471c7..0681c54248f11 100644 --- a/ddl/index_change_test.go +++ b/ddl/index_change_test.go @@ -15,6 +15,7 @@ package ddl import ( . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/kv" @@ -23,7 +24,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/ddl/mock.go b/ddl/mock.go index 6060eb9bba5bb..16d2d64d1b44d 100644 --- a/ddl/mock.go +++ b/ddl/mock.go @@ -18,10 +18,10 @@ import ( "time" "github.com/coreos/etcd/clientv3" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/sessionctx" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/ddl/partition.go b/ddl/partition.go index 18058ed83d02e..f61774f5ebfc7 100644 --- a/ddl/partition.go +++ b/ddl/partition.go @@ -19,6 +19,7 @@ import ( "strconv" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -29,7 +30,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) const ( diff --git a/ddl/reorg.go b/ddl/reorg.go index 52b6009d927f2..a793e0c402c71 100644 --- a/ddl/reorg.go +++ b/ddl/reorg.go @@ -18,6 +18,7 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -32,7 +33,6 @@ import ( "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/ddl/schema.go b/ddl/schema.go index 0c5cc0e82e21e..07c2e59df4aa3 100644 --- a/ddl/schema.go +++ b/ddl/schema.go @@ -14,10 +14,10 @@ package ddl import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/infoschema" "github.com/pingcap/tidb/meta" - "github.com/pkg/errors" ) func onCreateSchema(t *meta.Meta, job *model.Job) (ver int64, _ error) { diff --git a/ddl/session_pool.go b/ddl/session_pool.go index 7710355ce794b..cd6f5be9bdaa9 100644 --- a/ddl/session_pool.go +++ b/ddl/session_pool.go @@ -17,10 +17,10 @@ import ( "sync" "github.com/ngaut/pools" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/mock" - "github.com/pkg/errors" ) // sessionPool is used to new session. diff --git a/ddl/stat.go b/ddl/stat.go index e129c22eb758b..aaaa8d3c53b0d 100644 --- a/ddl/stat.go +++ b/ddl/stat.go @@ -14,10 +14,10 @@ package ddl import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/util/admin" - "github.com/pkg/errors" ) var ( diff --git a/ddl/syncer.go b/ddl/syncer.go index 8f822dff87427..3b4d2bd366dfe 100644 --- a/ddl/syncer.go +++ b/ddl/syncer.go @@ -24,9 +24,9 @@ import ( "github.com/coreos/etcd/clientv3" "github.com/coreos/etcd/clientv3/concurrency" + "github.com/pingcap/errors" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/owner" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/ddl/table.go b/ddl/table.go index c6c95fc6707a8..2e8390854143d 100644 --- a/ddl/table.go +++ b/ddl/table.go @@ -18,6 +18,7 @@ import ( "strconv" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/ddl/util" "github.com/pingcap/tidb/infoschema" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/meta/autoid" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/tablecodec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/ddl/table_test.go b/ddl/table_test.go index ad39b3abd9f41..b594b1353233a 100644 --- a/ddl/table_test.go +++ b/ddl/table_test.go @@ -17,6 +17,7 @@ import ( "fmt" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/kv" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/ddl/util/util.go b/ddl/util/util.go index c9a3c42a65633..9ec18dbe970a6 100644 --- a/ddl/util/util.go +++ b/ddl/util/util.go @@ -17,12 +17,12 @@ import ( "encoding/hex" "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/distsql/distsql.go b/distsql/distsql.go index b681fbc816bdf..2abf907242141 100644 --- a/distsql/distsql.go +++ b/distsql/distsql.go @@ -14,12 +14,12 @@ package distsql import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/statistics" "github.com/pingcap/tidb/types" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/distsql/distsql_test.go b/distsql/distsql_test.go index 8d20dbd89f755..3411c875992c6 100644 --- a/distsql/distsql_test.go +++ b/distsql/distsql_test.go @@ -19,6 +19,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/kv" @@ -30,7 +31,6 @@ import ( "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/execdetails" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/distsql/request_builder.go b/distsql/request_builder.go index 6dd12c6f20c22..f66a83a5721d3 100644 --- a/distsql/request_builder.go +++ b/distsql/request_builder.go @@ -16,6 +16,7 @@ package distsql import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/sessionctx/stmtctx" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) // RequestBuilder is used to build a "kv.Request". diff --git a/distsql/select_result.go b/distsql/select_result.go index 9558f9e680ccc..4b77eff02a800 100644 --- a/distsql/select_result.go +++ b/distsql/select_result.go @@ -16,6 +16,7 @@ package distsql import ( "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/distsql/stream.go b/distsql/stream.go index 0f651a53dc721..ea2e5417205b7 100644 --- a/distsql/stream.go +++ b/distsql/stream.go @@ -14,6 +14,7 @@ package distsql import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" @@ -23,7 +24,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/domain/domain.go b/domain/domain.go index c59012a0b69e5..8e95b39c71937 100644 --- a/domain/domain.go +++ b/domain/domain.go @@ -25,6 +25,7 @@ import ( "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/ngaut/pools" "github.com/ngaut/sync2" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/terror" @@ -40,7 +41,6 @@ import ( "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/statistics" "github.com/pingcap/tidb/util" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc" diff --git a/domain/domain_test.go b/domain/domain_test.go index c516632a99487..be1f18c8aec17 100644 --- a/domain/domain_test.go +++ b/domain/domain_test.go @@ -19,12 +19,12 @@ import ( "github.com/ngaut/pools" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/store/mockstore" "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) func TestT(t *testing.T) { diff --git a/domain/info.go b/domain/info.go index 226b395eed0c4..84b00f8f24ecf 100644 --- a/domain/info.go +++ b/domain/info.go @@ -20,13 +20,13 @@ import ( "github.com/coreos/etcd/clientv3" "github.com/coreos/etcd/clientv3/concurrency" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/ddl" "github.com/pingcap/tidb/owner" "github.com/pingcap/tidb/util/hack" "github.com/pingcap/tidb/util/printer" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/adapter.go b/executor/adapter.go index 44f6d5eaed6b7..17c12a65cf37f 100644 --- a/executor/adapter.go +++ b/executor/adapter.go @@ -20,6 +20,7 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -37,7 +38,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/logutil" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/admin.go b/executor/admin.go index d7dd92d6cc36c..e62ec605996d1 100644 --- a/executor/admin.go +++ b/executor/admin.go @@ -16,6 +16,7 @@ package executor import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/terror" @@ -32,7 +33,6 @@ import ( "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tidb/util/timeutil" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/aggfuncs/builder.go b/executor/aggfuncs/builder.go index 097c90affa782..0f2162d567b2c 100644 --- a/executor/aggfuncs/builder.go +++ b/executor/aggfuncs/builder.go @@ -17,6 +17,7 @@ import ( "fmt" "strconv" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) // Build is used to build a specific AggFunc implementation according to the diff --git a/executor/aggfuncs/func_avg.go b/executor/aggfuncs/func_avg.go index b31b0f96ed69a..b599d4f3e0779 100644 --- a/executor/aggfuncs/func_avg.go +++ b/executor/aggfuncs/func_avg.go @@ -15,12 +15,12 @@ package aggfuncs import ( "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/set" - "github.com/pkg/errors" ) // All the following avg function implementations return the decimal result, diff --git a/executor/aggfuncs/func_bitfuncs.go b/executor/aggfuncs/func_bitfuncs.go index 3379a9b695ff5..2418df4053c05 100644 --- a/executor/aggfuncs/func_bitfuncs.go +++ b/executor/aggfuncs/func_bitfuncs.go @@ -16,9 +16,9 @@ package aggfuncs import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) type baseBitAggFunc struct { diff --git a/executor/aggfuncs/func_count.go b/executor/aggfuncs/func_count.go index ee57b1be64665..74cfb6863173e 100644 --- a/executor/aggfuncs/func_count.go +++ b/executor/aggfuncs/func_count.go @@ -4,13 +4,13 @@ import ( "encoding/binary" "unsafe" + "github.com/pingcap/errors" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/set" - "github.com/pkg/errors" ) type baseCount struct { diff --git a/executor/aggfuncs/func_first_row.go b/executor/aggfuncs/func_first_row.go index 0da037dc1e7bd..25932d0802906 100644 --- a/executor/aggfuncs/func_first_row.go +++ b/executor/aggfuncs/func_first_row.go @@ -14,12 +14,12 @@ package aggfuncs import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/stringutil" - "github.com/pkg/errors" ) type basePartialResult4FirstRow struct { diff --git a/executor/aggfuncs/func_group_concat.go b/executor/aggfuncs/func_group_concat.go index ac4a29727e693..40ed32bce0093 100644 --- a/executor/aggfuncs/func_group_concat.go +++ b/executor/aggfuncs/func_group_concat.go @@ -18,11 +18,11 @@ import ( "sync/atomic" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/set" - "github.com/pkg/errors" ) type baseGroupConcat4String struct { diff --git a/executor/aggfuncs/func_max_min.go b/executor/aggfuncs/func_max_min.go index 3bceaa346e683..a828a40def2d8 100644 --- a/executor/aggfuncs/func_max_min.go +++ b/executor/aggfuncs/func_max_min.go @@ -14,12 +14,12 @@ package aggfuncs import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/stringutil" - "github.com/pkg/errors" ) type partialResult4MaxMinInt struct { diff --git a/executor/aggfuncs/func_sum.go b/executor/aggfuncs/func_sum.go index e38fbc415b9c8..c2935231d5dfb 100644 --- a/executor/aggfuncs/func_sum.go +++ b/executor/aggfuncs/func_sum.go @@ -14,11 +14,11 @@ package aggfuncs import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/set" - "github.com/pkg/errors" ) type partialResult4SumFloat64 struct { diff --git a/executor/aggregate.go b/executor/aggregate.go index a72ad4f0d37a2..4063d9263a8e1 100644 --- a/executor/aggregate.go +++ b/executor/aggregate.go @@ -17,6 +17,7 @@ import ( "sync" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/executor/aggfuncs" "github.com/pingcap/tidb/expression" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/set" - "github.com/pkg/errors" "github.com/spaolacci/murmur3" "golang.org/x/net/context" ) diff --git a/executor/analyze.go b/executor/analyze.go index 85fa0987cfe88..1d3be14c5cecd 100644 --- a/executor/analyze.go +++ b/executor/analyze.go @@ -17,6 +17,7 @@ import ( "runtime" "strconv" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/distsql" @@ -29,7 +30,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/batch_checker.go b/executor/batch_checker.go index 558e25884a55e..eeb4970ff0bbf 100644 --- a/executor/batch_checker.go +++ b/executor/batch_checker.go @@ -14,6 +14,7 @@ package executor import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/sessionctx" @@ -21,7 +22,6 @@ import ( "github.com/pingcap/tidb/table/tables" "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/types" - "github.com/pkg/errors" ) type keyValue struct { diff --git a/executor/builder.go b/executor/builder.go index fed4e0771654f..274a69dcb3e8c 100644 --- a/executor/builder.go +++ b/executor/builder.go @@ -24,6 +24,7 @@ import ( "github.com/cznic/mathutil" "github.com/cznic/sortutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -47,7 +48,6 @@ import ( "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tidb/util/timeutil" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/checksum.go b/executor/checksum.go index e9d6832096339..e0570d37f6c9b 100644 --- a/executor/checksum.go +++ b/executor/checksum.go @@ -16,6 +16,7 @@ package executor import ( "strconv" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/distsql" "github.com/pingcap/tidb/kv" @@ -24,7 +25,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/compiler.go b/executor/compiler.go index 778a555e74194..a47f18aa14969 100644 --- a/executor/compiler.go +++ b/executor/compiler.go @@ -17,6 +17,7 @@ import ( "fmt" "github.com/opentracing/opentracing-go" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/infoschema" @@ -24,7 +25,6 @@ import ( "github.com/pingcap/tidb/planner" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/sessionctx" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/ddl.go b/executor/ddl.go index ba7e9c02390c0..d70b73ad9a7e6 100644 --- a/executor/ddl.go +++ b/executor/ddl.go @@ -17,6 +17,7 @@ import ( "fmt" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -27,7 +28,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/delete.go b/executor/delete.go index 991e2f2817ed5..00ebebefa2ac5 100644 --- a/executor/delete.go +++ b/executor/delete.go @@ -14,13 +14,13 @@ package executor import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/distsql.go b/executor/distsql.go index 89caee248ecf1..9b8c5600d3f8e 100644 --- a/executor/distsql.go +++ b/executor/distsql.go @@ -22,6 +22,7 @@ import ( "time" "unsafe" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -38,7 +39,6 @@ import ( "github.com/pingcap/tidb/util/memory" "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/executor.go b/executor/executor.go index 83381ed6b5046..11dd342b4a100 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -21,6 +21,7 @@ import ( "time" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -41,7 +42,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/execdetails" "github.com/pingcap/tidb/util/memory" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/executor_test.go b/executor/executor_test.go index 5c88fcc5ef6c1..692d708010409 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -28,6 +28,7 @@ import ( gofail "github.com/etcd-io/gofail/runtime" "github.com/golang/protobuf/proto" . "github.com/pingcap/check" + "github.com/pingcap/errors" pb "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/parser" "github.com/pingcap/parser/model" @@ -62,7 +63,6 @@ import ( "github.com/pingcap/tidb/util/testutil" "github.com/pingcap/tidb/util/timeutil" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/grant.go b/executor/grant.go index 2886e1de36791..4225043e21fd0 100644 --- a/executor/grant.go +++ b/executor/grant.go @@ -17,6 +17,7 @@ import ( "fmt" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/index_lookup_join.go b/executor/index_lookup_join.go index 7fcb4bb08bac5..1d809b79776fb 100644 --- a/executor/index_lookup_join.go +++ b/executor/index_lookup_join.go @@ -21,6 +21,7 @@ import ( "time" "unsafe" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/expression" @@ -32,7 +33,6 @@ import ( "github.com/pingcap/tidb/util/memory" "github.com/pingcap/tidb/util/mvmap" "github.com/pingcap/tidb/util/ranger" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/insert.go b/executor/insert.go index 43a4dbded119b..4bf2fb5fa9bd1 100644 --- a/executor/insert.go +++ b/executor/insert.go @@ -14,6 +14,7 @@ package executor import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/kv" @@ -21,7 +22,6 @@ import ( "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/insert_common.go b/executor/insert_common.go index 59655a57af6b1..fc935a1030f64 100644 --- a/executor/insert_common.go +++ b/executor/insert_common.go @@ -16,6 +16,7 @@ package executor import ( "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -24,7 +25,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/join.go b/executor/join.go index c62d73ab65e95..ef97c69420fae 100644 --- a/executor/join.go +++ b/executor/join.go @@ -20,6 +20,7 @@ import ( "time" "unsafe" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/expression" plannercore "github.com/pingcap/tidb/planner/core" @@ -29,7 +30,6 @@ import ( "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/memory" "github.com/pingcap/tidb/util/mvmap" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/joiner.go b/executor/joiner.go index 3494a69eff842..5423acdca86f8 100644 --- a/executor/joiner.go +++ b/executor/joiner.go @@ -14,12 +14,12 @@ package executor import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/expression" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) var ( diff --git a/executor/load_data.go b/executor/load_data.go index 6ab6c7aa5050c..258b5cfbd233d 100644 --- a/executor/load_data.go +++ b/executor/load_data.go @@ -18,12 +18,12 @@ import ( "fmt" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/load_stats.go b/executor/load_stats.go index 968d3b10e0601..7a5894745d495 100644 --- a/executor/load_stats.go +++ b/executor/load_stats.go @@ -16,11 +16,11 @@ package executor import ( "encoding/json" + "github.com/pingcap/errors" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/statistics" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/merge_join.go b/executor/merge_join.go index 4bbfeaac26e0d..7939d128d9948 100644 --- a/executor/merge_join.go +++ b/executor/merge_join.go @@ -16,11 +16,11 @@ package executor import ( "time" + "github.com/pingcap/errors" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/memory" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/point_get.go b/executor/point_get.go index e74c29e8aafbb..cd32718f19e6f 100644 --- a/executor/point_get.go +++ b/executor/point_get.go @@ -14,6 +14,7 @@ package executor import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/prepared.go b/executor/prepared.go index 3538949f3822f..d2ad884d0e621 100644 --- a/executor/prepared.go +++ b/executor/prepared.go @@ -17,6 +17,7 @@ import ( "math" "sort" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/expression" @@ -29,7 +30,6 @@ import ( "github.com/pingcap/tidb/types/parser_driver" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/prepared_test.go b/executor/prepared_test.go index 477c0e704bf2b..808cbee20a577 100644 --- a/executor/prepared_test.go +++ b/executor/prepared_test.go @@ -18,11 +18,11 @@ import ( "strings" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/executor" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/util/testkit" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/projection.go b/executor/projection.go index dce2709f1271b..42890fb97f01e 100644 --- a/executor/projection.go +++ b/executor/projection.go @@ -16,10 +16,10 @@ package executor import ( "time" + "github.com/pingcap/errors" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/replace.go b/executor/replace.go index bb06f2fec0455..5aa983a6e0ebb 100644 --- a/executor/replace.go +++ b/executor/replace.go @@ -14,11 +14,11 @@ package executor import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/table/tables" "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/revoke.go b/executor/revoke.go index 35992f885615f..f541571156eff 100644 --- a/executor/revoke.go +++ b/executor/revoke.go @@ -16,6 +16,7 @@ package executor import ( "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/domain" @@ -24,7 +25,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/set.go b/executor/set.go index f7f7853c8717c..9ed9b5424413c 100644 --- a/executor/set.go +++ b/executor/set.go @@ -18,6 +18,7 @@ import ( "strings" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/terror" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/show.go b/executor/show.go index e1e2bd371ae00..e7d4a64d65dde 100644 --- a/executor/show.go +++ b/executor/show.go @@ -22,6 +22,7 @@ import ( "time" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/charset" @@ -37,7 +38,6 @@ import ( "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/format" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/show_stats.go b/executor/show_stats.go index c221df9ba31d9..f6b604c749db7 100644 --- a/executor/show_stats.go +++ b/executor/show_stats.go @@ -16,12 +16,12 @@ package executor import ( "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/statistics" "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/types" - "github.com/pkg/errors" ) func (e *ShowExec) fetchShowStatsMeta() error { diff --git a/executor/show_test.go b/executor/show_test.go index 61da51ad0f175..ce396ec8995c3 100644 --- a/executor/show_test.go +++ b/executor/show_test.go @@ -19,6 +19,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -30,7 +31,6 @@ import ( "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testutil" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/simple.go b/executor/simple.go index 849c874a3d40b..66a2ee04a6abe 100644 --- a/executor/simple.go +++ b/executor/simple.go @@ -17,6 +17,7 @@ import ( "fmt" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/model" @@ -29,7 +30,6 @@ import ( "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/executor/sort.go b/executor/sort.go index 6dcb74361d8d9..0625567423c1e 100644 --- a/executor/sort.go +++ b/executor/sort.go @@ -18,12 +18,12 @@ import ( "sort" "time" + "github.com/pingcap/errors" "github.com/pingcap/tidb/expression" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/memory" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/table_reader.go b/executor/table_reader.go index 3c81d402d141c..9e3a94c9092dd 100644 --- a/executor/table_reader.go +++ b/executor/table_reader.go @@ -16,6 +16,7 @@ package executor import ( "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/distsql" plannercore "github.com/pingcap/tidb/planner/core" @@ -24,7 +25,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/ranger" tipb "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/trace.go b/executor/trace.go index 6112ea85b4d50..46514f2da1e14 100644 --- a/executor/trace.go +++ b/executor/trace.go @@ -18,12 +18,12 @@ import ( "github.com/opentracing/basictracer-go" opentracing "github.com/opentracing/opentracing-go" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/planner" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/tracing" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/union_scan.go b/executor/union_scan.go index aad9bb157fef4..ee12f0925f990 100644 --- a/executor/union_scan.go +++ b/executor/union_scan.go @@ -17,12 +17,12 @@ import ( "sort" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/update.go b/executor/update.go index 3e653f800ebbf..0f1db7b120646 100644 --- a/executor/update.go +++ b/executor/update.go @@ -14,13 +14,13 @@ package executor import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/executor/write.go b/executor/write.go index 7f5b8709720d9..54d510e4d98f2 100644 --- a/executor/write.go +++ b/executor/write.go @@ -16,6 +16,7 @@ package executor import ( "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" @@ -23,7 +24,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/table/tables" "github.com/pingcap/tidb/types" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/expression/aggregation/aggregation.go b/expression/aggregation/aggregation.go index 62eba44691139..e6cd17fc0c480 100644 --- a/expression/aggregation/aggregation.go +++ b/expression/aggregation/aggregation.go @@ -16,6 +16,7 @@ package aggregation import ( "bytes" "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/model" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) // Aggregation stands for aggregate functions. diff --git a/expression/aggregation/avg.go b/expression/aggregation/avg.go index 04d70fa985d04..65aeed0d55b30 100644 --- a/expression/aggregation/avg.go +++ b/expression/aggregation/avg.go @@ -15,12 +15,12 @@ package aggregation import ( "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) type avgFunction struct { diff --git a/expression/aggregation/bit_and.go b/expression/aggregation/bit_and.go index 6fe2ef8f3ceba..420afec193b46 100644 --- a/expression/aggregation/bit_and.go +++ b/expression/aggregation/bit_and.go @@ -16,10 +16,10 @@ package aggregation import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) type bitAndFunction struct { diff --git a/expression/aggregation/bit_or.go b/expression/aggregation/bit_or.go index 2ac5ab4a5e6df..a703d1ae91e6f 100644 --- a/expression/aggregation/bit_or.go +++ b/expression/aggregation/bit_or.go @@ -14,10 +14,10 @@ package aggregation import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) type bitOrFunction struct { diff --git a/expression/aggregation/bit_xor.go b/expression/aggregation/bit_xor.go index 8cbfdeeb5a159..b510e71681ded 100644 --- a/expression/aggregation/bit_xor.go +++ b/expression/aggregation/bit_xor.go @@ -14,10 +14,10 @@ package aggregation import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) type bitXorFunction struct { diff --git a/expression/aggregation/concat.go b/expression/aggregation/concat.go index b8b5eb995bab2..016c3591250f9 100644 --- a/expression/aggregation/concat.go +++ b/expression/aggregation/concat.go @@ -18,11 +18,11 @@ import ( "fmt" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) type concatFunction struct { diff --git a/expression/aggregation/count.go b/expression/aggregation/count.go index 5a40d27bda188..bb6e210c56a3c 100644 --- a/expression/aggregation/count.go +++ b/expression/aggregation/count.go @@ -14,10 +14,10 @@ package aggregation import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) type countFunction struct { diff --git a/expression/aggregation/first_row.go b/expression/aggregation/first_row.go index 89601eb674826..61f35851ff8c6 100644 --- a/expression/aggregation/first_row.go +++ b/expression/aggregation/first_row.go @@ -14,10 +14,10 @@ package aggregation import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) type firstRowFunction struct { diff --git a/expression/aggregation/max_min.go b/expression/aggregation/max_min.go index 3e919c224ba98..af07db4c196c3 100644 --- a/expression/aggregation/max_min.go +++ b/expression/aggregation/max_min.go @@ -14,10 +14,10 @@ package aggregation import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) type maxMinFunction struct { diff --git a/expression/aggregation/util.go b/expression/aggregation/util.go index eb9b297364974..97e9d4cb39f5f 100644 --- a/expression/aggregation/util.go +++ b/expression/aggregation/util.go @@ -14,11 +14,11 @@ package aggregation import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/mvmap" - "github.com/pkg/errors" ) // distinctChecker stores existing keys and checks if given data is distinct. diff --git a/expression/builtin_arithmetic.go b/expression/builtin_arithmetic.go index 1f7369699519a..f0673f3c36bd6 100644 --- a/expression/builtin_arithmetic.go +++ b/expression/builtin_arithmetic.go @@ -18,13 +18,13 @@ import ( "math" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_cast.go b/expression/builtin_cast.go index a6881861ff038..dd8067d14d908 100644 --- a/expression/builtin_cast.go +++ b/expression/builtin_cast.go @@ -26,6 +26,7 @@ import ( "strconv" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/model" @@ -36,7 +37,6 @@ import ( "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_compare.go b/expression/builtin_compare.go index 0744720694378..4f641844f3d5e 100644 --- a/expression/builtin_compare.go +++ b/expression/builtin_compare.go @@ -16,6 +16,7 @@ package expression import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/opcode" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_compare_test.go b/expression/builtin_compare_test.go index 24cd01ea541dd..3aee49ddaec77 100644 --- a/expression/builtin_compare_test.go +++ b/expression/builtin_compare_test.go @@ -17,13 +17,13 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) func (s *testEvaluatorSuite) TestCompareFunctionWithRefine(c *C) { diff --git a/expression/builtin_control.go b/expression/builtin_control.go index fc8013f6096cc..bf588a058ae44 100644 --- a/expression/builtin_control.go +++ b/expression/builtin_control.go @@ -15,6 +15,7 @@ package expression import ( "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" @@ -22,7 +23,6 @@ import ( "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_encryption.go b/expression/builtin_encryption.go index 7772cd344a8a2..7ad63ce8b26a4 100644 --- a/expression/builtin_encryption.go +++ b/expression/builtin_encryption.go @@ -28,6 +28,7 @@ import ( "io" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" @@ -35,7 +36,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/encrypt" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_info.go b/expression/builtin_info.go index 62b04255af9c9..a597edb0ffc12 100644 --- a/expression/builtin_info.go +++ b/expression/builtin_info.go @@ -18,12 +18,12 @@ package expression import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/printer" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_json.go b/expression/builtin_json.go index f922c6cac8d90..d372bb89430d4 100644 --- a/expression/builtin_json.go +++ b/expression/builtin_json.go @@ -14,6 +14,7 @@ package expression import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" @@ -21,7 +22,6 @@ import ( "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_like.go b/expression/builtin_like.go index 43312813cae94..1409f6ec2cfd7 100644 --- a/expression/builtin_like.go +++ b/expression/builtin_like.go @@ -16,12 +16,12 @@ package expression import ( "regexp" + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/stringutil" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_math.go b/expression/builtin_math.go index f0770420e0cf9..8ddec64a81391 100644 --- a/expression/builtin_math.go +++ b/expression/builtin_math.go @@ -27,12 +27,12 @@ import ( "time" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_miscellaneous.go b/expression/builtin_miscellaneous.go index c046861911395..440d7778cbdc0 100644 --- a/expression/builtin_miscellaneous.go +++ b/expression/builtin_miscellaneous.go @@ -21,13 +21,13 @@ import ( "strings" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" "github.com/twinj/uuid" ) diff --git a/expression/builtin_op.go b/expression/builtin_op.go index e98d83af53835..e5f5d57c9e69d 100644 --- a/expression/builtin_op.go +++ b/expression/builtin_op.go @@ -17,13 +17,13 @@ import ( "fmt" "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/opcode" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_op_test.go b/expression/builtin_op_test.go index f57f17aab557f..3273369772113 100644 --- a/expression/builtin_op_test.go +++ b/expression/builtin_op_test.go @@ -17,12 +17,12 @@ import ( "math" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/testleak" "github.com/pingcap/tidb/util/testutil" - "github.com/pkg/errors" ) func (s *testEvaluatorSuite) TestUnary(c *C) { diff --git a/expression/builtin_other.go b/expression/builtin_other.go index 7cfc36e46541a..05ae92f164d7b 100644 --- a/expression/builtin_other.go +++ b/expression/builtin_other.go @@ -16,13 +16,13 @@ package expression import ( "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) var ( diff --git a/expression/builtin_string.go b/expression/builtin_string.go index ac1dc3f2a8b53..d2fb81287d754 100644 --- a/expression/builtin_string.go +++ b/expression/builtin_string.go @@ -27,6 +27,7 @@ import ( "strings" "unicode/utf8" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" @@ -35,7 +36,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/text/transform" ) diff --git a/expression/builtin_string_test.go b/expression/builtin_string_test.go index 9d229bd19e132..d78eb4b23c00c 100644 --- a/expression/builtin_string_test.go +++ b/expression/builtin_string_test.go @@ -20,6 +20,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" @@ -30,7 +31,6 @@ import ( "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/testleak" "github.com/pingcap/tidb/util/testutil" - "github.com/pkg/errors" ) func (s *testEvaluatorSuite) TestLength(c *C) { diff --git a/expression/builtin_test.go b/expression/builtin_test.go index 2be7dccf751cf..9ea28f93b2f23 100644 --- a/expression/builtin_test.go +++ b/expression/builtin_test.go @@ -17,6 +17,7 @@ import ( "reflect" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/model" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) func evalBuiltinFunc(f builtinFunc, row chunk.Row) (d types.Datum, err error) { diff --git a/expression/builtin_time.go b/expression/builtin_time.go index d171e058896e8..ea4fde8971b4e 100644 --- a/expression/builtin_time.go +++ b/expression/builtin_time.go @@ -26,6 +26,7 @@ import ( "time" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx" @@ -33,7 +34,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/expression/builtin_time_test.go b/expression/builtin_time_test.go index 903985f6d4c48..fadadc2783599 100644 --- a/expression/builtin_time_test.go +++ b/expression/builtin_time_test.go @@ -20,6 +20,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" @@ -32,7 +33,6 @@ import ( "github.com/pingcap/tidb/util/testleak" "github.com/pingcap/tidb/util/testutil" "github.com/pingcap/tidb/util/timeutil" - "github.com/pkg/errors" ) func (s *testEvaluatorSuite) TestDate(c *C) { diff --git a/expression/chunk_executor.go b/expression/chunk_executor.go index 76efd21031af0..5a02dc88ce94a 100644 --- a/expression/chunk_executor.go +++ b/expression/chunk_executor.go @@ -16,12 +16,12 @@ package expression import ( "strconv" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) // Vectorizable checks whether a list of expressions can employ vectorized execution. diff --git a/expression/column.go b/expression/column.go index 5306565373996..551ad98a76a2e 100644 --- a/expression/column.go +++ b/expression/column.go @@ -17,6 +17,7 @@ import ( "fmt" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/expression/constant.go b/expression/constant.go index 3c6a95948f446..374bd2a434cea 100644 --- a/expression/constant.go +++ b/expression/constant.go @@ -16,6 +16,7 @@ package expression import ( "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx" @@ -24,7 +25,6 @@ import ( "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/expression/constant_propagation.go b/expression/constant_propagation.go index 87018232fb4a5..3b49189f067d2 100644 --- a/expression/constant_propagation.go +++ b/expression/constant_propagation.go @@ -14,6 +14,7 @@ package expression import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -21,7 +22,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/disjointset" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/expression/distsql_builtin.go b/expression/distsql_builtin.go index 7d90ff1db72af..45e4387bfdc01 100644 --- a/expression/distsql_builtin.go +++ b/expression/distsql_builtin.go @@ -17,6 +17,7 @@ import ( "fmt" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/sessionctx" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) func pbTypeToFieldType(tp *tipb.FieldType) *types.FieldType { diff --git a/expression/evaluator.go b/expression/evaluator.go index 84f2cc81627c8..7fa7416658145 100644 --- a/expression/evaluator.go +++ b/expression/evaluator.go @@ -14,9 +14,9 @@ package expression import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) type columnEvaluator struct { diff --git a/expression/expr_to_pb.go b/expression/expr_to_pb.go index 1e5384c60de6a..7e37f2865ce2f 100644 --- a/expression/expr_to_pb.go +++ b/expression/expr_to_pb.go @@ -16,6 +16,7 @@ package expression import ( "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/expression/expression.go b/expression/expression.go index 5d6fa3a276723..1d00438a34f41 100644 --- a/expression/expression.go +++ b/expression/expression.go @@ -17,6 +17,7 @@ import ( goJSON "encoding/json" "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) // These are byte flags used for `HashCode()`. diff --git a/expression/helper.go b/expression/helper.go index 7759d944b756b..6c07741675e56 100644 --- a/expression/helper.go +++ b/expression/helper.go @@ -18,6 +18,7 @@ import ( "strings" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/parser_driver" - "github.com/pkg/errors" ) func boolToInt64(v bool) int64 { diff --git a/expression/integration_test.go b/expression/integration_test.go index edc36a3f5c631..345427843f032 100644 --- a/expression/integration_test.go +++ b/expression/integration_test.go @@ -21,6 +21,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -38,7 +39,6 @@ import ( "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" "github.com/pingcap/tidb/util/testutil" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/expression/scalar_function.go b/expression/scalar_function.go index 7705c2ff48b08..e0c1a13b8ea00 100644 --- a/expression/scalar_function.go +++ b/expression/scalar_function.go @@ -17,6 +17,7 @@ import ( "bytes" "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" ) // ScalarFunction is the function that returns a value. diff --git a/expression/schema.go b/expression/schema.go index 50cdb9d6b4dbf..c6a7fce83b69e 100644 --- a/expression/schema.go +++ b/expression/schema.go @@ -16,8 +16,8 @@ package expression import ( "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" - "github.com/pkg/errors" ) // KeyInfo stores the columns of one unique key or primary key. diff --git a/expression/simple_rewriter.go b/expression/simple_rewriter.go index fd57d166bb4a6..879d3e8121516 100644 --- a/expression/simple_rewriter.go +++ b/expression/simple_rewriter.go @@ -14,6 +14,7 @@ package expression import ( + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" @@ -22,7 +23,6 @@ import ( "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/parser_driver" - "github.com/pkg/errors" ) type simpleRewriter struct { diff --git a/expression/util.go b/expression/util.go index 6bf507fd17e52..679be67795bca 100644 --- a/expression/util.go +++ b/expression/util.go @@ -19,6 +19,7 @@ import ( "time" "unicode" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/opcode" @@ -27,7 +28,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" ) // Filter the input expressions, append the results to result. diff --git a/infoschema/builder.go b/infoschema/builder.go index 2f6b1a6ebc3b8..417d8f6d60717 100644 --- a/infoschema/builder.go +++ b/infoschema/builder.go @@ -17,13 +17,13 @@ import ( "fmt" "sort" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/meta" "github.com/pingcap/tidb/meta/autoid" "github.com/pingcap/tidb/perfschema" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/table/tables" - "github.com/pkg/errors" ) // Builder builds a new InfoSchema. diff --git a/infoschema/infoschema_test.go b/infoschema/infoschema_test.go index 13b4217fcdbf1..7baee0a30a980 100644 --- a/infoschema/infoschema_test.go +++ b/infoschema/infoschema_test.go @@ -18,6 +18,7 @@ import ( "testing" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/infoschema" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/testleak" "github.com/pingcap/tidb/util/testutil" - "github.com/pkg/errors" ) func TestT(t *testing.T) { diff --git a/infoschema/tables.go b/infoschema/tables.go index 5f83a20258394..24161a2966a75 100644 --- a/infoschema/tables.go +++ b/infoschema/tables.go @@ -19,6 +19,7 @@ import ( "sync" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -30,7 +31,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" ) const ( diff --git a/kv/buffer_store.go b/kv/buffer_store.go index 5e798db5c8875..4854fe0a6eab7 100644 --- a/kv/buffer_store.go +++ b/kv/buffer_store.go @@ -14,7 +14,7 @@ package kv import ( - "github.com/pkg/errors" + "github.com/pingcap/errors" ) var ( diff --git a/kv/fault_injection_test.go b/kv/fault_injection_test.go index 2c38853c3cd20..ec35944319fa5 100644 --- a/kv/fault_injection_test.go +++ b/kv/fault_injection_test.go @@ -15,8 +15,8 @@ package kv_test import ( . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" - "github.com/pkg/errors" ) type testFaultInjectionSuite struct{} diff --git a/kv/iter.go b/kv/iter.go index 1551391ea0627..a5dd140eaa0fd 100644 --- a/kv/iter.go +++ b/kv/iter.go @@ -13,7 +13,7 @@ package kv -import "github.com/pkg/errors" +import "github.com/pingcap/errors" // NextUntil applies FnKeyCmp to each entry of the iterator until meets some condition. // It will stop when fn returns true, or iterator is invalid or an error occurs. diff --git a/kv/memdb_buffer.go b/kv/memdb_buffer.go index 76b93c355479c..3066288f4146f 100644 --- a/kv/memdb_buffer.go +++ b/kv/memdb_buffer.go @@ -18,13 +18,13 @@ package kv import ( "sync/atomic" + "github.com/pingcap/errors" "github.com/pingcap/goleveldb/leveldb" "github.com/pingcap/goleveldb/leveldb/comparer" "github.com/pingcap/goleveldb/leveldb/iterator" "github.com/pingcap/goleveldb/leveldb/memdb" "github.com/pingcap/goleveldb/leveldb/util" "github.com/pingcap/parser/terror" - "github.com/pkg/errors" ) // memDbBuffer implements the MemBuffer interface. diff --git a/kv/mock.go b/kv/mock.go index 9fb8a0559c33d..4dc7fafa490e0 100644 --- a/kv/mock.go +++ b/kv/mock.go @@ -14,8 +14,8 @@ package kv import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/store/tikv/oracle" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/kv/txn.go b/kv/txn.go index 74c1bd10cf2ce..1abb81f9a440a 100644 --- a/kv/txn.go +++ b/kv/txn.go @@ -18,8 +18,8 @@ import ( "math/rand" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/kv/union_iter.go b/kv/union_iter.go index c4ae42cfd5766..01f198918f8b2 100644 --- a/kv/union_iter.go +++ b/kv/union_iter.go @@ -14,7 +14,7 @@ package kv import ( - "github.com/pkg/errors" + "github.com/pingcap/errors" log "github.com/sirupsen/logrus" ) diff --git a/kv/union_store.go b/kv/union_store.go index 6e3111f3ca240..016f9f9d9d5d2 100644 --- a/kv/union_store.go +++ b/kv/union_store.go @@ -16,7 +16,7 @@ package kv import ( "bytes" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) // UnionStore is a store that wraps a snapshot for read and a BufferStore for buffered write. diff --git a/kv/utils.go b/kv/utils.go index 214745bfadb41..9456e204f2c27 100644 --- a/kv/utils.go +++ b/kv/utils.go @@ -16,7 +16,7 @@ package kv import ( "strconv" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) // IncInt64 increases the value for key k in kv store by step. diff --git a/meta/autoid/autoid.go b/meta/autoid/autoid.go index 4c8ba2e189473..9cd045226eaf2 100644 --- a/meta/autoid/autoid.go +++ b/meta/autoid/autoid.go @@ -20,11 +20,11 @@ import ( "time" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/meta" "github.com/pingcap/tidb/metrics" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/meta/autoid/autoid_test.go b/meta/autoid/autoid_test.go index 173466190c53e..fcec3999a0731 100644 --- a/meta/autoid/autoid_test.go +++ b/meta/autoid/autoid_test.go @@ -20,12 +20,12 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/meta" "github.com/pingcap/tidb/meta/autoid" "github.com/pingcap/tidb/store/mockstore" - "github.com/pkg/errors" ) func TestT(t *testing.T) { diff --git a/meta/meta.go b/meta/meta.go index e2fac6203cfbc..901b69f450adc 100644 --- a/meta/meta.go +++ b/meta/meta.go @@ -24,13 +24,13 @@ import ( "sync" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/structure" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/metrics/server.go b/metrics/server.go index c18058f1461eb..c8d5604a31e2c 100644 --- a/metrics/server.go +++ b/metrics/server.go @@ -16,8 +16,8 @@ package metrics import ( "strconv" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" - "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" ) diff --git a/owner/manager.go b/owner/manager.go index 640bb5d571cf6..3b4afa789dc6b 100644 --- a/owner/manager.go +++ b/owner/manager.go @@ -26,10 +26,10 @@ import ( "github.com/coreos/etcd/clientv3/concurrency" "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" "github.com/coreos/etcd/mvcc/mvccpb" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/util" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc" diff --git a/owner/mock.go b/owner/mock.go index 5266ba9b2553d..0cb13378897b2 100644 --- a/owner/mock.go +++ b/owner/mock.go @@ -16,7 +16,7 @@ package owner import ( "sync/atomic" - "github.com/pkg/errors" + "github.com/pingcap/errors" "golang.org/x/net/context" ) diff --git a/planner/core/cbo_test.go b/planner/core/cbo_test.go index 4046e2b7c71e5..bfdfdd07edd92 100644 --- a/planner/core/cbo_test.go +++ b/planner/core/cbo_test.go @@ -19,6 +19,7 @@ import ( "testing" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/kv" @@ -30,7 +31,6 @@ import ( "github.com/pingcap/tidb/store/mockstore" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) var _ = Suite(&testAnalyzeSuite{}) diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index 89810c1ae9add..f38d9594b4899 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -19,6 +19,7 @@ import ( "strconv" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/model" @@ -32,7 +33,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/kvcache" "github.com/pingcap/tidb/util/ranger" - "github.com/pkg/errors" ) // ShowDDL is for showing DDL information. diff --git a/planner/core/exhaust_physical_plans.go b/planner/core/exhaust_physical_plans.go index 4a15030fde6cc..27214b59a9a60 100644 --- a/planner/core/exhaust_physical_plans.go +++ b/planner/core/exhaust_physical_plans.go @@ -16,6 +16,7 @@ package core import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/planner/property" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/ranger" - "github.com/pkg/errors" ) func (p *LogicalUnionScan) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan { diff --git a/planner/core/expression_rewriter.go b/planner/core/expression_rewriter.go index 0719039f3f6c6..3693a5d92d55f 100644 --- a/planner/core/expression_rewriter.go +++ b/planner/core/expression_rewriter.go @@ -17,6 +17,7 @@ import ( "strconv" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -29,7 +30,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/parser_driver" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) // EvalSubquery evaluates incorrelated subqueries once. diff --git a/planner/core/find_best_task.go b/planner/core/find_best_task.go index d937fd627650f..5321f945c1b57 100644 --- a/planner/core/find_best_task.go +++ b/planner/core/find_best_task.go @@ -16,6 +16,7 @@ package core import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" @@ -23,7 +24,6 @@ import ( "github.com/pingcap/tidb/planner/property" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) const ( diff --git a/planner/core/logical_plan_builder.go b/planner/core/logical_plan_builder.go index 724705af02872..b92ce2393e403 100644 --- a/planner/core/logical_plan_builder.go +++ b/planner/core/logical_plan_builder.go @@ -22,6 +22,7 @@ import ( "unicode" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" @@ -39,7 +40,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/parser_driver" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) const ( diff --git a/planner/core/logical_plans.go b/planner/core/logical_plans.go index b5fae30185ae6..c750edb595ed8 100644 --- a/planner/core/logical_plans.go +++ b/planner/core/logical_plans.go @@ -16,6 +16,7 @@ package core import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/ranger" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/planner/core/logical_plans_test.go b/planner/core/logical_plans_test.go index acda1c36ffbf1..3b162e7026c7f 100644 --- a/planner/core/logical_plans_test.go +++ b/planner/core/logical_plans_test.go @@ -17,6 +17,7 @@ import ( "fmt" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -24,7 +25,6 @@ import ( "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/planner/core/optimizer.go b/planner/core/optimizer.go index 84469150c29c6..305aa57eddb35 100644 --- a/planner/core/optimizer.go +++ b/planner/core/optimizer.go @@ -16,13 +16,13 @@ package core import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/infoschema" "github.com/pingcap/tidb/planner/property" "github.com/pingcap/tidb/privilege" "github.com/pingcap/tidb/sessionctx" - "github.com/pkg/errors" ) // OptimizeAstNode optimizes the query to a physical plan directly. diff --git a/planner/core/plan.go b/planner/core/plan.go index e573be27213d3..ca17f0ed7a7d4 100644 --- a/planner/core/plan.go +++ b/planner/core/plan.go @@ -17,12 +17,12 @@ import ( "fmt" "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/planner/property" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) // Plan is the description of an execution flow. diff --git a/planner/core/plan_to_pb.go b/planner/core/plan_to_pb.go index 258fd5b30bc46..80cf81c8e6258 100644 --- a/planner/core/plan_to_pb.go +++ b/planner/core/plan_to_pb.go @@ -14,6 +14,7 @@ package core import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/expression/aggregation" @@ -22,7 +23,6 @@ import ( "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) // ToPB implements PhysicalPlan ToPB interface. diff --git a/planner/core/planbuilder.go b/planner/core/planbuilder.go index 2140c89369d14..19ea97c150af4 100644 --- a/planner/core/planbuilder.go +++ b/planner/core/planbuilder.go @@ -18,6 +18,7 @@ import ( "strings" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -31,7 +32,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/parser_driver" "github.com/pingcap/tidb/util/ranger" - "github.com/pkg/errors" ) type visitInfo struct { diff --git a/planner/core/point_get_plan.go b/planner/core/point_get_plan.go index f8ae66079d585..62c6c71816229 100644 --- a/planner/core/point_get_plan.go +++ b/planner/core/point_get_plan.go @@ -17,6 +17,7 @@ import ( "bytes" "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/parser_driver" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) // PointGetPlan is a fast plan for simple point get. diff --git a/planner/core/preprocess.go b/planner/core/preprocess.go index dc4154acfc774..37e945cb9e43a 100644 --- a/planner/core/preprocess.go +++ b/planner/core/preprocess.go @@ -17,6 +17,7 @@ import ( "math" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" @@ -27,7 +28,6 @@ import ( "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/parser_driver" - "github.com/pkg/errors" ) // Preprocess resolves table names of the node, and checks some statements validation. diff --git a/planner/core/preprocess_test.go b/planner/core/preprocess_test.go index fb6b1ae659990..45a8200f451d0 100644 --- a/planner/core/preprocess_test.go +++ b/planner/core/preprocess_test.go @@ -15,6 +15,7 @@ package core_test import ( . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/model" "github.com/pingcap/parser/terror" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/planner/core/rule_decorrelate.go b/planner/core/rule_decorrelate.go index bef4ef1b3b88e..f873cd5adc9ad 100644 --- a/planner/core/rule_decorrelate.go +++ b/planner/core/rule_decorrelate.go @@ -16,12 +16,12 @@ package core import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/expression/aggregation" "github.com/pingcap/tidb/types" - "github.com/pkg/errors" ) // extractCorColumnsBySchema only extracts the correlated columns that match the outer plan's schema. diff --git a/planner/core/rule_partition_processor.go b/planner/core/rule_partition_processor.go index fc68e0e21a8ff..beefd81bb0779 100644 --- a/planner/core/rule_partition_processor.go +++ b/planner/core/rule_partition_processor.go @@ -13,11 +13,11 @@ package core import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/table/tables" "github.com/pingcap/tidb/util/ranger" - "github.com/pkg/errors" ) // partitionProcessor rewrites the ast for table partition. diff --git a/planner/core/stats.go b/planner/core/stats.go index 4d7696a824154..050e9e8a1450f 100644 --- a/planner/core/stats.go +++ b/planner/core/stats.go @@ -16,9 +16,9 @@ package core import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/planner/property" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/planner/optimize.go b/planner/optimize.go index b17aa11adc8af..06f6d730ffdc2 100644 --- a/planner/optimize.go +++ b/planner/optimize.go @@ -14,12 +14,12 @@ package planner import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/tidb/infoschema" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/privilege" "github.com/pingcap/tidb/sessionctx" - "github.com/pkg/errors" ) // Optimize does optimization and creates a Plan. diff --git a/privilege/privileges/cache.go b/privilege/privileges/cache.go index 43bcd6f9f49fc..8ddf1fabd5e27 100644 --- a/privilege/privileges/cache.go +++ b/privilege/privileges/cache.go @@ -20,6 +20,7 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" "github.com/pingcap/tidb/util/stringutil" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/server/conn.go b/server/conn.go index 09fe05762c131..1d8e4d42910af 100644 --- a/server/conn.go +++ b/server/conn.go @@ -49,6 +49,7 @@ import ( "time" "github.com/opentracing/opentracing-go" + "github.com/pingcap/errors" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -60,7 +61,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/hack" "github.com/pingcap/tidb/util/memory" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/server/conn_stmt.go b/server/conn_stmt.go index 9a058e506d925..b46a2f7ca640b 100644 --- a/server/conn_stmt.go +++ b/server/conn_stmt.go @@ -41,10 +41,10 @@ import ( "strconv" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/server/driver_tidb.go b/server/driver_tidb.go index 065a9973cdb8d..8bdd542db1565 100644 --- a/server/driver_tidb.go +++ b/server/driver_tidb.go @@ -18,6 +18,7 @@ import ( "fmt" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/mysql" @@ -29,7 +30,6 @@ import ( "github.com/pingcap/tidb/util" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/server/http_handler.go b/server/http_handler.go index 9802b9e84c839..beb14014d4a75 100644 --- a/server/http_handler.go +++ b/server/http_handler.go @@ -28,6 +28,7 @@ import ( "time" "github.com/gorilla/mux" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/metapb" "github.com/pingcap/parser/model" @@ -48,7 +49,6 @@ import ( "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/server/http_status.go b/server/http_status.go index 5e872582592be..9026f36d7af7d 100644 --- a/server/http_status.go +++ b/server/http_status.go @@ -21,11 +21,11 @@ import ( "net/http/pprof" "github.com/gorilla/mux" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/util/printer" - "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" ) diff --git a/server/packetio.go b/server/packetio.go index 1e95b6a0e2e35..74b07b68bc291 100644 --- a/server/packetio.go +++ b/server/packetio.go @@ -38,9 +38,9 @@ import ( "bufio" "io" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" - "github.com/pkg/errors" ) const defaultWriterSize = 16 * 1024 diff --git a/server/server.go b/server/server.go index 51cc6930a6c9d..8854f9cb12050 100644 --- a/server/server.go +++ b/server/server.go @@ -43,13 +43,13 @@ import ( "time" "github.com/blacktear23/go-proxyprotocol" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/util" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/server/tidb_test.go b/server/tidb_test.go index f43b6ae31c4a7..a1713363d5e2c 100644 --- a/server/tidb_test.go +++ b/server/tidb_test.go @@ -28,6 +28,7 @@ import ( "github.com/go-sql-driver/mysql" . "github.com/pingcap/check" + "github.com/pingcap/errors" tmysql "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/domain" @@ -35,7 +36,6 @@ import ( "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/store/mockstore" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/server/util.go b/server/util.go index a2d351278fc69..ac1db185ed97b 100644 --- a/server/util.go +++ b/server/util.go @@ -43,12 +43,12 @@ import ( "strconv" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" ) func parseNullTermString(b []byte) (str []byte, remain []byte) { diff --git a/server/util_test.go b/server/util_test.go index cd18b4c8e98fa..0cad0507a7b90 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -15,6 +15,7 @@ package server import ( . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/kv" @@ -23,7 +24,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) var _ = Suite(&testUtilSuite{}) diff --git a/session/bootstrap.go b/session/bootstrap.go index 424779630306a..696c06eb2888e 100644 --- a/session/bootstrap.go +++ b/session/bootstrap.go @@ -25,6 +25,7 @@ import ( "strings" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -33,7 +34,6 @@ import ( "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/timeutil" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/session/session.go b/session/session.go index 32ba44cb68e13..c52d2fb71fda4 100644 --- a/session/session.go +++ b/session/session.go @@ -28,6 +28,7 @@ import ( "time" "github.com/ngaut/pools" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/auth" @@ -56,7 +57,6 @@ import ( "github.com/pingcap/tidb/util/sqlexec" "github.com/pingcap/tidb/util/timeutil" "github.com/pingcap/tipb/go-binlog" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/session/tidb.go b/session/tidb.go index 4f5fdd76ce428..32329ec76379f 100644 --- a/session/tidb.go +++ b/session/tidb.go @@ -23,6 +23,7 @@ import ( "sync" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" @@ -35,7 +36,6 @@ import ( "github.com/pingcap/tidb/util" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/session/tidb_test.go b/session/tidb_test.go index 38b3f693f1e80..6cb95320a7c0c 100644 --- a/session/tidb_test.go +++ b/session/tidb_test.go @@ -22,6 +22,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/auth" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/kv" @@ -30,7 +31,6 @@ import ( "github.com/pingcap/tidb/util/logutil" "github.com/pingcap/tidb/util/sqlexec" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/session/txn.go b/session/txn.go index 5b37b63ad29f3..0dc4445003eb2 100644 --- a/session/txn.go +++ b/session/txn.go @@ -14,6 +14,7 @@ package session import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/executor" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/sessionctx" @@ -22,7 +23,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" binlog "github.com/pingcap/tipb/go-binlog" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/sessionctx/binloginfo/binloginfo.go b/sessionctx/binloginfo/binloginfo.go index 1a5c100695796..3997bd481d247 100644 --- a/sessionctx/binloginfo/binloginfo.go +++ b/sessionctx/binloginfo/binloginfo.go @@ -21,6 +21,7 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb-tools/tidb-binlog/node" pumpcli "github.com/pingcap/tidb-tools/tidb-binlog/pump_client" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/sessionctx" binlog "github.com/pingcap/tipb/go-binlog" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "google.golang.org/grpc" ) diff --git a/sessionctx/binloginfo/binloginfo_test.go b/sessionctx/binloginfo/binloginfo_test.go index ca974637b4750..666df0e890aa5 100644 --- a/sessionctx/binloginfo/binloginfo_test.go +++ b/sessionctx/binloginfo/binloginfo_test.go @@ -22,6 +22,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" pumpcli "github.com/pingcap/tidb-tools/tidb-binlog/pump_client" "github.com/pingcap/tidb/ddl" @@ -36,7 +37,6 @@ import ( "github.com/pingcap/tidb/util/logutil" "github.com/pingcap/tidb/util/testkit" binlog "github.com/pingcap/tipb/go-binlog" - "github.com/pkg/errors" "golang.org/x/net/context" "google.golang.org/grpc" ) diff --git a/sessionctx/variable/session.go b/sessionctx/variable/session.go index b720753809ac4..b1c08416851b0 100644 --- a/sessionctx/variable/session.go +++ b/sessionctx/variable/session.go @@ -22,6 +22,7 @@ import ( "time" "github.com/klauspost/cpuid" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/auth" "github.com/pingcap/parser/mysql" @@ -34,7 +35,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/timeutil" - "github.com/pkg/errors" ) const ( diff --git a/sessionctx/variable/statusvar.go b/sessionctx/variable/statusvar.go index f7d6f1a65c21f..d041103015dbd 100644 --- a/sessionctx/variable/statusvar.go +++ b/sessionctx/variable/statusvar.go @@ -17,7 +17,7 @@ import ( "bytes" "crypto/tls" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) var statisticsList []Statistics diff --git a/sessionctx/variable/varsutil.go b/sessionctx/variable/varsutil.go index 5f95fae07cf71..71ce27cd028ba 100644 --- a/sessionctx/variable/varsutil.go +++ b/sessionctx/variable/varsutil.go @@ -22,11 +22,11 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/timeutil" - "github.com/pkg/errors" ) // secondsPerYear represents seconds in a normal year. Leap year is not considered here. diff --git a/statistics/bootstrap.go b/statistics/bootstrap.go index 8a346969f5a31..43e2d4fd2459b 100644 --- a/statistics/bootstrap.go +++ b/statistics/bootstrap.go @@ -16,6 +16,7 @@ package statistics import ( "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -24,7 +25,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/statistics/builder.go b/statistics/builder.go index 4a820240cbf00..c9a66e057b501 100644 --- a/statistics/builder.go +++ b/statistics/builder.go @@ -14,10 +14,10 @@ package statistics import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" - "github.com/pkg/errors" ) // SortedBuilder is used to build histograms for PK and index. diff --git a/statistics/cmsketch.go b/statistics/cmsketch.go index 6d16ad1546f89..18915ba5df25b 100644 --- a/statistics/cmsketch.go +++ b/statistics/cmsketch.go @@ -18,11 +18,11 @@ import ( "sort" "github.com/cznic/sortutil" + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "github.com/spaolacci/murmur3" ) diff --git a/statistics/cmsketch_test.go b/statistics/cmsketch_test.go index 2ad7a9868d86a..d9fcfce253b9e 100644 --- a/statistics/cmsketch_test.go +++ b/statistics/cmsketch_test.go @@ -19,10 +19,10 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" ) func (c *CMSketch) insert(val *types.Datum) error { diff --git a/statistics/ddl.go b/statistics/ddl.go index b8cedc71fee1c..b984e2e3d9ba0 100644 --- a/statistics/ddl.go +++ b/statistics/ddl.go @@ -16,13 +16,13 @@ package statistics import ( "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/ddl/util" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/statistics/dump.go b/statistics/dump.go index 49a08f127e838..907d380c3370c 100644 --- a/statistics/dump.go +++ b/statistics/dump.go @@ -16,13 +16,13 @@ package statistics import ( "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/infoschema" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) // JSONTable is used for dumping statistics. diff --git a/statistics/feedback.go b/statistics/feedback.go index 405c084943e63..7fe6478373676 100644 --- a/statistics/feedback.go +++ b/statistics/feedback.go @@ -23,6 +23,7 @@ import ( "time" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" @@ -32,7 +33,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/ranger" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/spaolacci/murmur3" ) diff --git a/statistics/fmsketch.go b/statistics/fmsketch.go index 8878a21f8e863..50c496b07db49 100644 --- a/statistics/fmsketch.go +++ b/statistics/fmsketch.go @@ -16,11 +16,11 @@ package statistics import ( "hash" + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "github.com/spaolacci/murmur3" ) diff --git a/statistics/gc.go b/statistics/gc.go index 8aaeba70d2115..84405d63e6bbc 100644 --- a/statistics/gc.go +++ b/statistics/gc.go @@ -18,10 +18,10 @@ import ( "time" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/tidb/infoschema" "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/statistics/handle.go b/statistics/handle.go index 7033df47deed1..574b688b33681 100644 --- a/statistics/handle.go +++ b/statistics/handle.go @@ -19,6 +19,7 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/ddl/util" "github.com/pingcap/tidb/infoschema" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/statistics/handle_test.go b/statistics/handle_test.go index 778e7cf06d7d6..08f5435fe6302 100644 --- a/statistics/handle_test.go +++ b/statistics/handle_test.go @@ -18,6 +18,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/kv" @@ -29,7 +30,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) var _ = Suite(&testStatsCacheSuite{}) diff --git a/statistics/histogram.go b/statistics/histogram.go index 75905ecdfab41..bdcf31b4c6e83 100644 --- a/statistics/histogram.go +++ b/statistics/histogram.go @@ -20,6 +20,7 @@ import ( "strings" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -32,7 +33,6 @@ import ( "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tidb/util/sqlexec" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/statistics/sample.go b/statistics/sample.go index 70eed697a812a..b044dea396dc3 100644 --- a/statistics/sample.go +++ b/statistics/sample.go @@ -17,6 +17,7 @@ import ( "fmt" "math/rand" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/statistics/selectivity.go b/statistics/selectivity.go index 58d4a6a9ffc62..d182adc565bce 100644 --- a/statistics/selectivity.go +++ b/statistics/selectivity.go @@ -16,12 +16,12 @@ package statistics import ( "math" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/ranger" - "github.com/pkg/errors" ) // If one condition can't be calculated, we will assume that the selectivity of this condition is 0.8. diff --git a/statistics/statistics_test.go b/statistics/statistics_test.go index fb79e934c18be..8b47c4ba9c6c1 100644 --- a/statistics/statistics_test.go +++ b/statistics/statistics_test.go @@ -19,6 +19,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -31,7 +32,6 @@ import ( "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/statistics/table.go b/statistics/table.go index f2995f3c181e0..294bf9efde781 100644 --- a/statistics/table.go +++ b/statistics/table.go @@ -19,6 +19,7 @@ import ( "strings" "sync" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" @@ -27,7 +28,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/ranger" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/statistics/update.go b/statistics/update.go index a66588487fed2..ce452c4a4ce0a 100644 --- a/statistics/update.go +++ b/statistics/update.go @@ -21,6 +21,7 @@ import ( "sync" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/infoschema" "github.com/pingcap/tidb/metrics" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/mockoracle/oracle.go b/store/mockoracle/oracle.go index 54933f0c10ef7..c918b3e474876 100644 --- a/store/mockoracle/oracle.go +++ b/store/mockoracle/oracle.go @@ -17,8 +17,8 @@ import ( "sync" "time" + "github.com/pingcap/errors" "github.com/pingcap/tidb/store/tikv/oracle" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/mockstore/mocktikv/aggregate.go b/store/mockstore/mocktikv/aggregate.go index 08dab065c6fb9..4c48df4fe0688 100644 --- a/store/mockstore/mocktikv/aggregate.go +++ b/store/mockstore/mocktikv/aggregate.go @@ -14,12 +14,12 @@ package mocktikv import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/expression/aggregation" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/mockstore/mocktikv/analyze.go b/store/mockstore/mocktikv/analyze.go index 2659a4cde994e..2727efe1ce48a 100644 --- a/store/mockstore/mocktikv/analyze.go +++ b/store/mockstore/mocktikv/analyze.go @@ -15,6 +15,7 @@ package mocktikv import ( "github.com/golang/protobuf/proto" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/coprocessor" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/mockstore/mocktikv/cop_handler_dag.go b/store/mockstore/mocktikv/cop_handler_dag.go index 913f839c6d9e0..f1a74cf3da489 100644 --- a/store/mockstore/mocktikv/cop_handler_dag.go +++ b/store/mockstore/mocktikv/cop_handler_dag.go @@ -19,6 +19,7 @@ import ( "time" "github.com/golang/protobuf/proto" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/coprocessor" "github.com/pingcap/kvproto/pkg/errorpb" "github.com/pingcap/kvproto/pkg/kvrpcpb" @@ -36,7 +37,6 @@ import ( mockpkg "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/timeutil" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/metadata" diff --git a/store/mockstore/mocktikv/executor.go b/store/mockstore/mocktikv/executor.go index 29f478b8e277f..8016947ab215c 100644 --- a/store/mockstore/mocktikv/executor.go +++ b/store/mockstore/mocktikv/executor.go @@ -18,6 +18,7 @@ import ( "encoding/binary" "sort" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" @@ -29,7 +30,6 @@ import ( "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/mockstore/mocktikv/mock.go b/store/mockstore/mocktikv/mock.go index 1b4e08334a54f..660772f261bba 100644 --- a/store/mockstore/mocktikv/mock.go +++ b/store/mockstore/mocktikv/mock.go @@ -14,8 +14,8 @@ package mocktikv import ( + "github.com/pingcap/errors" "github.com/pingcap/pd/client" - "github.com/pkg/errors" ) // NewTiKVAndPDClient creates a TiKV client and PD client from options. diff --git a/store/mockstore/mocktikv/mvcc.go b/store/mockstore/mocktikv/mvcc.go index 28983d9656eee..b55b284f081b3 100644 --- a/store/mockstore/mocktikv/mvcc.go +++ b/store/mockstore/mocktikv/mvcc.go @@ -21,9 +21,9 @@ import ( "sort" "github.com/google/btree" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" ) type mvccValueType int diff --git a/store/mockstore/mocktikv/mvcc_leveldb.go b/store/mockstore/mocktikv/mvcc_leveldb.go index 53cdb92c5a5d9..0b27ebee5dee1 100644 --- a/store/mockstore/mocktikv/mvcc_leveldb.go +++ b/store/mockstore/mocktikv/mvcc_leveldb.go @@ -18,6 +18,7 @@ import ( "math" "sync" + "github.com/pingcap/errors" "github.com/pingcap/goleveldb/leveldb" "github.com/pingcap/goleveldb/leveldb/iterator" "github.com/pingcap/goleveldb/leveldb/opt" @@ -26,7 +27,6 @@ import ( "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/store/mockstore/mocktikv/rpc.go b/store/mockstore/mocktikv/rpc.go index 34ff33c87c5ec..96458eb569aa3 100644 --- a/store/mockstore/mocktikv/rpc.go +++ b/store/mockstore/mocktikv/rpc.go @@ -20,6 +20,7 @@ import ( "time" "github.com/golang/protobuf/proto" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/coprocessor" "github.com/pingcap/kvproto/pkg/errorpb" "github.com/pingcap/kvproto/pkg/kvrpcpb" @@ -27,7 +28,6 @@ import ( "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/mockstore/mocktikv/topn.go b/store/mockstore/mocktikv/topn.go index b7a49110e429b..3b2a5d952c48a 100644 --- a/store/mockstore/mocktikv/topn.go +++ b/store/mockstore/mocktikv/topn.go @@ -16,10 +16,10 @@ package mocktikv import ( "container/heap" + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" ) type sortRow struct { diff --git a/store/mockstore/tikv.go b/store/mockstore/tikv.go index 7afbe7726bd23..a3c9fa75145db 100644 --- a/store/mockstore/tikv.go +++ b/store/mockstore/tikv.go @@ -17,12 +17,12 @@ import ( "net/url" "strings" + "github.com/pingcap/errors" "github.com/pingcap/pd/client" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store/mockstore/mocktikv" "github.com/pingcap/tidb/store/tikv" - "github.com/pkg/errors" ) // MockDriver is in memory mock TiKV driver. diff --git a/store/tikv/2pc.go b/store/tikv/2pc.go index cc5220fd11850..9d785f3a9fe4c 100644 --- a/store/tikv/2pc.go +++ b/store/tikv/2pc.go @@ -20,6 +20,7 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" pb "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/store/tikv/tikvrpc" "github.com/pingcap/tidb/tablecodec" binlog "github.com/pingcap/tipb/go-binlog" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/2pc_fail_test.go b/store/tikv/2pc_fail_test.go index 1f2368d8fa833..ba85163394b3d 100644 --- a/store/tikv/2pc_fail_test.go +++ b/store/tikv/2pc_fail_test.go @@ -16,8 +16,8 @@ package tikv import ( gofail "github.com/etcd-io/gofail/runtime" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/tikv/2pc_test.go b/store/tikv/2pc_test.go index 724590523e0c8..a11eca3cac198 100644 --- a/store/tikv/2pc_test.go +++ b/store/tikv/2pc_test.go @@ -20,10 +20,10 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/store/mockstore/mocktikv" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/tikv/backoff.go b/store/tikv/backoff.go index 297b3b45900ad..25c78cd9a60be 100644 --- a/store/tikv/backoff.go +++ b/store/tikv/backoff.go @@ -20,11 +20,11 @@ import ( "strings" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/client.go b/store/tikv/client.go index 1633a01cde8ee..45d9239ac230a 100644 --- a/store/tikv/client.go +++ b/store/tikv/client.go @@ -24,13 +24,13 @@ import ( "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" "github.com/grpc-ecosystem/go-grpc-prometheus" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/coprocessor" "github.com/pingcap/kvproto/pkg/tikvpb" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc" diff --git a/store/tikv/coprocessor.go b/store/tikv/coprocessor.go index 02d89a82dd4df..dc87f2454e62e 100644 --- a/store/tikv/coprocessor.go +++ b/store/tikv/coprocessor.go @@ -24,6 +24,7 @@ import ( "time" "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/coprocessor" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/kv" @@ -31,7 +32,6 @@ import ( "github.com/pingcap/tidb/store/tikv/tikvrpc" "github.com/pingcap/tidb/util/execdetails" "github.com/pingcap/tipb/go-tipb" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/delete_range.go b/store/tikv/delete_range.go index 521a6a8139f59..5d75fc5230a09 100644 --- a/store/tikv/delete_range.go +++ b/store/tikv/delete_range.go @@ -17,9 +17,9 @@ import ( "bytes" "context" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" ) // DeleteRangeTask is used to delete all keys in a range. After diff --git a/store/tikv/error.go b/store/tikv/error.go index 9329de2eaf221..c05682c16de74 100644 --- a/store/tikv/error.go +++ b/store/tikv/error.go @@ -14,9 +14,9 @@ package tikv import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" - "github.com/pkg/errors" ) var ( diff --git a/store/tikv/gcworker/gc_worker.go b/store/tikv/gcworker/gc_worker.go index 22a8726e86d6a..8aa0dec84d615 100644 --- a/store/tikv/gcworker/gc_worker.go +++ b/store/tikv/gcworker/gc_worker.go @@ -22,6 +22,7 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/errorpb" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/metapb" @@ -37,7 +38,6 @@ import ( "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/store/tikv/tikvrpc" tidbutil "github.com/pingcap/tidb/util" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/kv.go b/store/tikv/kv.go index fc834d1e530a3..68de31fa1ecc0 100644 --- a/store/tikv/kv.go +++ b/store/tikv/kv.go @@ -24,6 +24,7 @@ import ( "github.com/coreos/etcd/clientv3" "github.com/grpc-ecosystem/go-grpc-prometheus" + "github.com/pingcap/errors" "github.com/pingcap/pd/client" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/kv" @@ -32,7 +33,6 @@ import ( "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/store/tikv/oracle/oracles" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc" diff --git a/store/tikv/lock_resolver.go b/store/tikv/lock_resolver.go index a85415398dde6..e561d854d57b6 100644 --- a/store/tikv/lock_resolver.go +++ b/store/tikv/lock_resolver.go @@ -19,12 +19,12 @@ import ( "sync" "time" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/pd/client" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/oracle/oracles/pd.go b/store/tikv/oracle/oracles/pd.go index a8e7db8d8a02f..d618b91c74974 100644 --- a/store/tikv/oracle/oracles/pd.go +++ b/store/tikv/oracle/oracles/pd.go @@ -17,10 +17,10 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/pd/client" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/store/tikv/oracle" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/pd_codec.go b/store/tikv/pd_codec.go index 1e871c4a223e2..a17509d28c9a0 100644 --- a/store/tikv/pd_codec.go +++ b/store/tikv/pd_codec.go @@ -14,10 +14,10 @@ package tikv import ( + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/metapb" "github.com/pingcap/pd/client" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/tikv/rawkv.go b/store/tikv/rawkv.go index adbd12b656ed7..f296d9e00d1fe 100644 --- a/store/tikv/rawkv.go +++ b/store/tikv/rawkv.go @@ -17,12 +17,12 @@ import ( "bytes" "time" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/pd/client" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/tikv/region_cache.go b/store/tikv/region_cache.go index 381af34c5c6bf..21dd9f2037931 100644 --- a/store/tikv/region_cache.go +++ b/store/tikv/region_cache.go @@ -20,11 +20,11 @@ import ( "time" "github.com/google/btree" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/metapb" "github.com/pingcap/pd/client" "github.com/pingcap/tidb/metrics" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/region_request.go b/store/tikv/region_request.go index a599b56a9a831..5466ad37032a6 100644 --- a/store/tikv/region_request.go +++ b/store/tikv/region_request.go @@ -16,12 +16,12 @@ package tikv import ( "time" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/errorpb" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc" diff --git a/store/tikv/region_request_test.go b/store/tikv/region_request_test.go index fed561fd92288..f48e0f4a484fa 100644 --- a/store/tikv/region_request_test.go +++ b/store/tikv/region_request_test.go @@ -20,13 +20,13 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/coprocessor" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/tikvpb" "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/store/mockstore/mocktikv" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" "golang.org/x/net/context" "google.golang.org/grpc" ) diff --git a/store/tikv/safepoint.go b/store/tikv/safepoint.go index ea456c0c23162..4367811760e29 100644 --- a/store/tikv/safepoint.go +++ b/store/tikv/safepoint.go @@ -20,7 +20,7 @@ import ( "time" "github.com/coreos/etcd/clientv3" - "github.com/pkg/errors" + "github.com/pingcap/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/safepoint_test.go b/store/tikv/safepoint_test.go index e2142ccf9f1a2..0af5fcaa2ef92 100644 --- a/store/tikv/safepoint_test.go +++ b/store/tikv/safepoint_test.go @@ -18,9 +18,9 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/tikv/scan.go b/store/tikv/scan.go index ab0ba76bc0e60..93637a0c90589 100644 --- a/store/tikv/scan.go +++ b/store/tikv/scan.go @@ -14,10 +14,10 @@ package tikv import ( + "github.com/pingcap/errors" pb "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/snapshot.go b/store/tikv/snapshot.go index 730db0273c193..4a3c8c0862e23 100644 --- a/store/tikv/snapshot.go +++ b/store/tikv/snapshot.go @@ -20,12 +20,12 @@ import ( "time" "unsafe" + "github.com/pingcap/errors" pb "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/store/tikv/tikvrpc" "github.com/pingcap/tidb/tablecodec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/split_region.go b/store/tikv/split_region.go index 8be3e81c52dd3..5d01e3fede123 100644 --- a/store/tikv/split_region.go +++ b/store/tikv/split_region.go @@ -16,10 +16,10 @@ package tikv import ( "bytes" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/store/tikv/store_test.go b/store/tikv/store_test.go index 00735eee64a3f..8e54767417063 100644 --- a/store/tikv/store_test.go +++ b/store/tikv/store_test.go @@ -18,13 +18,13 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" pb "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/metapb" "github.com/pingcap/pd/client" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store/mockoracle" "github.com/pingcap/tidb/store/tikv/tikvrpc" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/tikv/test_util.go b/store/tikv/test_util.go index d4efcbbd0bc3e..ffa34637ba0e5 100644 --- a/store/tikv/test_util.go +++ b/store/tikv/test_util.go @@ -14,9 +14,9 @@ package tikv import ( + "github.com/pingcap/errors" "github.com/pingcap/pd/client" "github.com/pingcap/tidb/kv" - "github.com/pkg/errors" "github.com/twinj/uuid" ) diff --git a/store/tikv/ticlient_test.go b/store/tikv/ticlient_test.go index 1b4ea24ad5c82..e243dc396e7d1 100644 --- a/store/tikv/ticlient_test.go +++ b/store/tikv/ticlient_test.go @@ -20,10 +20,10 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store/mockstore/mocktikv" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/tikv/tikvrpc/tikvrpc.go b/store/tikv/tikvrpc/tikvrpc.go index 00fe8bcfcbf24..4331f34cf7d3c 100644 --- a/store/tikv/tikvrpc/tikvrpc.go +++ b/store/tikv/tikvrpc/tikvrpc.go @@ -18,12 +18,12 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/coprocessor" "github.com/pingcap/kvproto/pkg/errorpb" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/kvproto/pkg/metapb" "github.com/pingcap/kvproto/pkg/tikvpb" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/store/tikv/txn.go b/store/tikv/txn.go index 110135718667a..9b72431a0e07c 100644 --- a/store/tikv/txn.go +++ b/store/tikv/txn.go @@ -18,10 +18,10 @@ import ( "sync" "time" + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/sessionctx" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/structure/hash.go b/structure/hash.go index 8b04016c37bc1..ecc70b64517a2 100644 --- a/structure/hash.go +++ b/structure/hash.go @@ -18,8 +18,8 @@ import ( "encoding/binary" "strconv" + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" - "github.com/pkg/errors" ) // HashPair is the pair for (field, value) in a hash. diff --git a/structure/list.go b/structure/list.go index ae98232dc670e..24c781e606ebf 100644 --- a/structure/list.go +++ b/structure/list.go @@ -16,8 +16,8 @@ package structure import ( "encoding/binary" + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" - "github.com/pkg/errors" ) type listMeta struct { diff --git a/structure/string.go b/structure/string.go index ccf5b67c25cf5..38482d15b9b49 100644 --- a/structure/string.go +++ b/structure/string.go @@ -16,8 +16,8 @@ package structure import ( "strconv" + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" - "github.com/pkg/errors" ) // Set sets the string value of the key. diff --git a/structure/type.go b/structure/type.go index 79c58beddba7c..89759269871c9 100644 --- a/structure/type.go +++ b/structure/type.go @@ -16,9 +16,9 @@ package structure import ( "bytes" + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" ) // TypeFlag is for data structure meta/data flag. diff --git a/table/column.go b/table/column.go index 9902b83aa07da..67f6d35b6041b 100644 --- a/table/column.go +++ b/table/column.go @@ -21,6 +21,7 @@ import ( "strings" "unicode/utf8" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/model" @@ -31,7 +32,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/table/tables/gen_expr.go b/table/tables/gen_expr.go index f0f88e2924cc7..8296d1491c9c4 100644 --- a/table/tables/gen_expr.go +++ b/table/tables/gen_expr.go @@ -16,10 +16,10 @@ package tables import ( "fmt" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" - "github.com/pkg/errors" ) // getDefaultCharsetAndCollate is copyed from ddl/ddl_api.go. diff --git a/table/tables/index.go b/table/tables/index.go index e4253d9275537..3f9d77402a2ef 100644 --- a/table/tables/index.go +++ b/table/tables/index.go @@ -19,6 +19,7 @@ import ( "io" "unicode/utf8" + "github.com/pingcap/errors" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/kv" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" ) // EncodeHandle encodes handle in data. diff --git a/table/tables/partition.go b/table/tables/partition.go index efcaf596d7b62..7ad54ef9b1f1a 100644 --- a/table/tables/partition.go +++ b/table/tables/partition.go @@ -19,6 +19,7 @@ import ( "sort" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/kv" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" "github.com/pingcap/tidb/util/mock" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/table/tables/tables.go b/table/tables/tables.go index f244991c5d9cd..37dee1163c016 100644 --- a/table/tables/tables.go +++ b/table/tables/tables.go @@ -24,6 +24,7 @@ import ( "strings" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/kv" @@ -39,7 +40,6 @@ import ( "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/kvcache" binlog "github.com/pingcap/tipb/go-binlog" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/spaolacci/murmur3" "golang.org/x/net/context" diff --git a/tablecodec/tablecodec.go b/tablecodec/tablecodec.go index 3f31f5613a9c3..de9b31c31210e 100644 --- a/tablecodec/tablecodec.go +++ b/tablecodec/tablecodec.go @@ -19,13 +19,13 @@ import ( "math" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" ) var ( diff --git a/terror/terror.go b/terror/terror.go index c38e0e18a1b24..a5443653d71cd 100644 --- a/terror/terror.go +++ b/terror/terror.go @@ -18,8 +18,8 @@ import ( "fmt" "strconv" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/terror/terror_test.go b/terror/terror_test.go index 837ab32f4b2d9..fe93ef4a99fc3 100644 --- a/terror/terror_test.go +++ b/terror/terror_test.go @@ -19,8 +19,8 @@ import ( "testing" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) func TestT(t *testing.T) { diff --git a/tidb-server/main.go b/tidb-server/main.go index cbd74b2cbac49..1d24b3279f11e 100644 --- a/tidb-server/main.go +++ b/tidb-server/main.go @@ -23,6 +23,7 @@ import ( "time" "github.com/opentracing/opentracing-go" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/pd/client" @@ -47,7 +48,6 @@ import ( "github.com/pingcap/tidb/util/signal" "github.com/pingcap/tidb/util/systimemon" "github.com/pingcap/tidb/x-server" - "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/push" log "github.com/sirupsen/logrus" diff --git a/types/binary_literal.go b/types/binary_literal.go index da75a5d744807..91d85b98e6559 100644 --- a/types/binary_literal.go +++ b/types/binary_literal.go @@ -22,8 +22,8 @@ import ( "strconv" "strings" + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" - "github.com/pkg/errors" ) // BinaryLiteral is the internal type for storing bit / hex literal type. diff --git a/types/convert.go b/types/convert.go index 50fb7175be725..046a6c6488516 100644 --- a/types/convert.go +++ b/types/convert.go @@ -22,12 +22,12 @@ import ( "strconv" "strings" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" ) func truncateStr(str string, flen int) string { diff --git a/types/convert_test.go b/types/convert_test.go index a45bc18a1b985..4d6244fac8ea9 100644 --- a/types/convert_test.go +++ b/types/convert_test.go @@ -20,13 +20,13 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) var _ = Suite(&testTypeConvertSuite{}) diff --git a/types/datum.go b/types/datum.go index c6d4643c4c40a..09607c474d9b4 100644 --- a/types/datum.go +++ b/types/datum.go @@ -22,13 +22,13 @@ import ( "time" "unicode/utf8" + "github.com/pingcap/errors" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/types/datum_eval.go b/types/datum_eval.go index 9cbdaa4fa84fa..a2d4d744b4d60 100644 --- a/types/datum_eval.go +++ b/types/datum_eval.go @@ -15,8 +15,8 @@ package types import ( "github.com/cznic/mathutil" + "github.com/pingcap/errors" "github.com/pingcap/parser/opcode" - "github.com/pkg/errors" ) // ComputePlus computes the result of a+b. diff --git a/types/enum.go b/types/enum.go index 085e9b31874de..45c15a3d2208f 100644 --- a/types/enum.go +++ b/types/enum.go @@ -17,7 +17,7 @@ import ( "strconv" "strings" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) // Enum is for MySQL enum type. diff --git a/types/etc.go b/types/etc.go index 626139a7d328a..b8b5af64f38d5 100644 --- a/types/etc.go +++ b/types/etc.go @@ -20,12 +20,12 @@ package types import ( "io" + "github.com/pingcap/errors" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/opcode" "github.com/pingcap/parser/terror" ast "github.com/pingcap/parser/types" - "github.com/pkg/errors" ) // IsTypeBlob returns a boolean indicating whether the tp is a blob type. diff --git a/types/fsp.go b/types/fsp.go index 69dd32c352a0e..fe5a656cd87bb 100644 --- a/types/fsp.go +++ b/types/fsp.go @@ -18,7 +18,7 @@ import ( "strconv" "strings" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) const ( diff --git a/types/helper.go b/types/helper.go index ec95d824d2f1e..f03dc1390c6de 100644 --- a/types/helper.go +++ b/types/helper.go @@ -18,7 +18,7 @@ import ( "strings" "unicode" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) // RoundFloat rounds float val to the nearest integer value with float64 format, like MySQL Round function. diff --git a/types/helper_test.go b/types/helper_test.go index 4a18f650af5da..fa39980252901 100644 --- a/types/helper_test.go +++ b/types/helper_test.go @@ -17,7 +17,7 @@ import ( "strconv" . "github.com/pingcap/check" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) var _ = Suite(&testTypeHelperSuite{}) diff --git a/types/json/binary.go b/types/json/binary.go index 182c08dcd4683..c5c277d451cba 100644 --- a/types/json/binary.go +++ b/types/json/binary.go @@ -25,9 +25,9 @@ import ( "strings" "unicode/utf8" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" ) /* diff --git a/types/json/binary_functions.go b/types/json/binary_functions.go index 689dbad3768fd..3719367f042b8 100644 --- a/types/json/binary_functions.go +++ b/types/json/binary_functions.go @@ -22,8 +22,8 @@ import ( "unicode/utf8" "unsafe" + "github.com/pingcap/errors" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" ) // Type returns type of BinaryJSON as string. diff --git a/types/json/path_expr.go b/types/json/path_expr.go index b58bf9f2729ae..7ed5276231ae8 100644 --- a/types/json/path_expr.go +++ b/types/json/path_expr.go @@ -18,7 +18,7 @@ import ( "strconv" "strings" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) /* diff --git a/types/mydecimal.go b/types/mydecimal.go index dec19cfee333d..afb34eca3523f 100644 --- a/types/mydecimal.go +++ b/types/mydecimal.go @@ -17,9 +17,9 @@ import ( "math" "strconv" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" - "github.com/pkg/errors" ) // RoundMode is the type for round mode. diff --git a/types/mytime.go b/types/mytime.go index 0f546bf940913..6c9564dcbac49 100644 --- a/types/mytime.go +++ b/types/mytime.go @@ -16,7 +16,7 @@ package types import ( gotime "time" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) // MysqlTime is the internal struct type for Time. diff --git a/types/overflow.go b/types/overflow.go index 1be3742c29cc2..6253357cbe047 100644 --- a/types/overflow.go +++ b/types/overflow.go @@ -17,7 +17,7 @@ import ( "fmt" "math" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) // AddUint64 adds uint64 a and b if no overflow, else returns error. diff --git a/types/set.go b/types/set.go index 97d065e404160..0a337780c452f 100644 --- a/types/set.go +++ b/types/set.go @@ -17,7 +17,7 @@ import ( "strconv" "strings" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) var zeroSet = Set{Name: "", Value: 0} diff --git a/types/time.go b/types/time.go index c2694b2cd7ff1..e257682299eb8 100644 --- a/types/time.go +++ b/types/time.go @@ -23,10 +23,10 @@ import ( gotime "time" "unicode" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx/stmtctx" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/util/admin/admin.go b/util/admin/admin.go index a1985bd09a82c..e49fb2ee9f8d1 100644 --- a/util/admin/admin.go +++ b/util/admin/admin.go @@ -19,6 +19,7 @@ import ( "sort" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -34,7 +35,6 @@ import ( "github.com/pingcap/tidb/util" "github.com/pingcap/tidb/util/rowDecoder" "github.com/pingcap/tidb/util/sqlexec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/util/chunk/list.go b/util/chunk/list.go index 4acee7d199216..e7a939c69c70c 100644 --- a/util/chunk/list.go +++ b/util/chunk/list.go @@ -14,9 +14,9 @@ package chunk import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/memory" - "github.com/pkg/errors" ) // List holds a slice of chunks, use to append rows with max chunk size properly handled. diff --git a/util/codec/bytes.go b/util/codec/bytes.go index 0d988c4c69883..b590b7fa90221 100644 --- a/util/codec/bytes.go +++ b/util/codec/bytes.go @@ -18,7 +18,7 @@ import ( "runtime" "unsafe" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) const ( diff --git a/util/codec/codec.go b/util/codec/codec.go index 80839b5ca5340..fae2935538246 100644 --- a/util/codec/codec.go +++ b/util/codec/codec.go @@ -17,13 +17,13 @@ import ( "encoding/binary" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) // First byte in the encoded value which specifies the encoding type. diff --git a/util/codec/decimal.go b/util/codec/decimal.go index ed61aa1d5b752..8fcb849c70d23 100644 --- a/util/codec/decimal.go +++ b/util/codec/decimal.go @@ -14,8 +14,8 @@ package codec import ( + "github.com/pingcap/errors" "github.com/pingcap/tidb/types" - "github.com/pkg/errors" ) // EncodeDecimal encodes a decimal into a byte slice which can be sorted lexicographically later. diff --git a/util/codec/float.go b/util/codec/float.go index bf846b867c6c8..39ce634459cc6 100644 --- a/util/codec/float.go +++ b/util/codec/float.go @@ -16,7 +16,7 @@ package codec import ( "math" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) func encodeFloatToCmpUint64(f float64) uint64 { diff --git a/util/codec/number.go b/util/codec/number.go index d23117fa3ac10..47912e813b2fc 100644 --- a/util/codec/number.go +++ b/util/codec/number.go @@ -17,7 +17,7 @@ import ( "encoding/binary" "math" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) const signMask uint64 = 0x8000000000000000 diff --git a/util/encrypt/aes.go b/util/encrypt/aes.go index b1b90f3a524b8..76f93f60a5afa 100644 --- a/util/encrypt/aes.go +++ b/util/encrypt/aes.go @@ -18,7 +18,7 @@ import ( "crypto/aes" "crypto/cipher" - "github.com/pkg/errors" + "github.com/pingcap/errors" ) type ecb struct { diff --git a/util/filesort/filesort.go b/util/filesort/filesort.go index 5b61cc904b7c2..e87d9430ee394 100644 --- a/util/filesort/filesort.go +++ b/util/filesort/filesort.go @@ -25,11 +25,11 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" ) type comparableRow struct { diff --git a/util/kvencoder/kv_encoder.go b/util/kvencoder/kv_encoder.go index 9184e0d439aec..c5ab7cc32f947 100644 --- a/util/kvencoder/kv_encoder.go +++ b/util/kvencoder/kv_encoder.go @@ -20,6 +20,7 @@ import ( "sync" "sync/atomic" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/kv" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/store/mockstore" "github.com/pingcap/tidb/tablecodec" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" "golang.org/x/net/context" ) diff --git a/util/kvencoder/kv_encoder_test.go b/util/kvencoder/kv_encoder_test.go index 557dcc10fc475..55813a7fa83cc 100644 --- a/util/kvencoder/kv_encoder_test.go +++ b/util/kvencoder/kv_encoder_test.go @@ -24,6 +24,7 @@ import ( "github.com/pingcap/tidb/store/mockstore" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/session" @@ -34,7 +35,6 @@ import ( "github.com/pingcap/tidb/util/codec" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) var _ = Suite(&testKvEncoderSuite{}) diff --git a/util/logutil/log.go b/util/logutil/log.go index d9681cd56009b..342f1d5b951bf 100644 --- a/util/logutil/log.go +++ b/util/logutil/log.go @@ -22,7 +22,7 @@ import ( "sort" "strings" - "github.com/pkg/errors" + "github.com/pingcap/errors" log "github.com/sirupsen/logrus" "gopkg.in/natefinch/lumberjack.v2" ) diff --git a/util/misc.go b/util/misc.go index e34ee06e51bd4..3060f610c687d 100644 --- a/util/misc.go +++ b/util/misc.go @@ -17,7 +17,7 @@ import ( "runtime" "time" - "github.com/pkg/errors" + "github.com/pingcap/errors" log "github.com/sirupsen/logrus" ) diff --git a/util/misc_test.go b/util/misc_test.go index 517b34909f295..5060d25278ada 100644 --- a/util/misc_test.go +++ b/util/misc_test.go @@ -15,8 +15,8 @@ package util import ( . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) var _ = Suite(&testMiscSuite{}) diff --git a/util/mock/context.go b/util/mock/context.go index e33879460288b..198584c92b322 100644 --- a/util/mock/context.go +++ b/util/mock/context.go @@ -19,6 +19,7 @@ import ( "sync" "time" + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/owner" "github.com/pingcap/tidb/sessionctx" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/util/kvcache" "github.com/pingcap/tidb/util/sqlexec" binlog "github.com/pingcap/tipb/go-binlog" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/util/prefix_helper.go b/util/prefix_helper.go index ccfd1ece9d633..3fc172b02d783 100644 --- a/util/prefix_helper.go +++ b/util/prefix_helper.go @@ -20,8 +20,8 @@ package util import ( "bytes" + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" - "github.com/pkg/errors" ) // ScanMetaWithPrefix scans metadata with the prefix. diff --git a/util/ranger/detacher.go b/util/ranger/detacher.go index 529f4cb92c9a8..6180beee2066c 100644 --- a/util/ranger/detacher.go +++ b/util/ranger/detacher.go @@ -14,12 +14,12 @@ package ranger import ( + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/model" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" - "github.com/pkg/errors" ) // detachColumnCNFConditions detaches the condition for calculating range from the other conditions. diff --git a/util/ranger/points.go b/util/ranger/points.go index 0b830545e578f..db07588a861f6 100644 --- a/util/ranger/points.go +++ b/util/ranger/points.go @@ -18,6 +18,7 @@ import ( "math" "sort" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" @@ -25,7 +26,6 @@ import ( "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) // Error instances. diff --git a/util/ranger/ranger.go b/util/ranger/ranger.go index 5631c1ff7c995..0402209e25bb7 100644 --- a/util/ranger/ranger.go +++ b/util/ranger/ranger.go @@ -19,6 +19,7 @@ import ( "sort" "unicode/utf8" + "github.com/pingcap/errors" "github.com/pingcap/parser/ast" "github.com/pingcap/parser/charset" "github.com/pingcap/parser/mysql" @@ -28,7 +29,6 @@ import ( "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" - "github.com/pkg/errors" ) func validInterval(sc *stmtctx.StatementContext, low, high point) (bool, error) { diff --git a/util/ranger/ranger_test.go b/util/ranger/ranger_test.go index 8947aec481cc5..03be414c29e3f 100644 --- a/util/ranger/ranger_test.go +++ b/util/ranger/ranger_test.go @@ -18,6 +18,7 @@ import ( "testing" . "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/parser" "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/expression" @@ -31,7 +32,6 @@ import ( "github.com/pingcap/tidb/util/ranger" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" - "github.com/pkg/errors" ) func TestT(t *testing.T) { diff --git a/util/ranger/types.go b/util/ranger/types.go index c17964845d25d..5db46355353db 100644 --- a/util/ranger/types.go +++ b/util/ranger/types.go @@ -18,9 +18,9 @@ import ( "math" "strings" + "github.com/pingcap/errors" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" - "github.com/pkg/errors" ) // Range represents a range generated in physical plan building phase. diff --git a/util/rowDecoder/decoder.go b/util/rowDecoder/decoder.go index 86d69fa1e457f..bd4d778b91b81 100644 --- a/util/rowDecoder/decoder.go +++ b/util/rowDecoder/decoder.go @@ -16,6 +16,7 @@ package decoder import ( "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/model" "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" @@ -24,7 +25,6 @@ import ( "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pkg/errors" ) // Column contains the info and generated expr of column. diff --git a/util/stringutil/string_util.go b/util/stringutil/string_util.go index 6aa22b36736ff..4bdf43fda7e14 100644 --- a/util/stringutil/string_util.go +++ b/util/stringutil/string_util.go @@ -17,8 +17,8 @@ import ( "strings" "unicode/utf8" + "github.com/pingcap/errors" "github.com/pingcap/tidb/util/hack" - "github.com/pkg/errors" ) // ErrSyntax indicates that a value does not have the right syntax for the target type. diff --git a/util/testkit/testkit.go b/util/testkit/testkit.go index cea25aab3ef75..cdb76a65f14b3 100644 --- a/util/testkit/testkit.go +++ b/util/testkit/testkit.go @@ -20,11 +20,11 @@ import ( "sync/atomic" "github.com/pingcap/check" + "github.com/pingcap/errors" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/util/sqlexec" "github.com/pingcap/tidb/util/testutil" - "github.com/pkg/errors" "golang.org/x/net/context" ) diff --git a/x-server/conn.go b/x-server/conn.go index 940c6b09cfc8f..d06931bbb032f 100644 --- a/x-server/conn.go +++ b/x-server/conn.go @@ -17,9 +17,9 @@ import ( "io" "net" + "github.com/pingcap/errors" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/util/arena" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) diff --git a/x-server/server.go b/x-server/server.go index 5b1c9f7650ebb..cdb7ab78c3cd8 100644 --- a/x-server/server.go +++ b/x-server/server.go @@ -20,12 +20,12 @@ import ( "sync/atomic" "time" + "github.com/pingcap/errors" "github.com/pingcap/parser/mysql" "github.com/pingcap/parser/terror" "github.com/pingcap/tidb/server" "github.com/pingcap/tidb/util" "github.com/pingcap/tidb/util/arena" - "github.com/pkg/errors" log "github.com/sirupsen/logrus" )