From 2b4a4c6d7abc72f818d42031a4bbd99d48c1601c Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Tue, 7 Jun 2022 15:22:30 +0800 Subject: [PATCH] *: support bazel (#33691) close pingcap/tidb#34083 --- .bazelrc | 12 + .github/licenserc.yml | 5 + .gitignore | 6 + BUILD.bazel | 28 + DEPS.bzl | 3154 +++++++++++++++++ Makefile | 37 +- WORKSPACE | 48 + bindinfo/BUILD.bazel | 79 + br/cmd/br/BUILD.bazel | 57 + br/cmd/tidb-lightning-ctl/BUILD.bazel | 31 + br/cmd/tidb-lightning/BUILD.bazel | 28 + br/pkg/backup/BUILD.bazel | 94 + br/pkg/checksum/BUILD.bazel | 50 + br/pkg/conn/BUILD.bazel | 58 + br/pkg/errors/BUILD.bazel | 9 + br/pkg/glue/BUILD.bazel | 32 + br/pkg/gluetidb/BUILD.bazel | 27 + br/pkg/gluetikv/BUILD.bazel | 26 + br/pkg/httputil/BUILD.bazel | 8 + br/pkg/lightning/BUILD.bazel | 56 + br/pkg/lightning/backend/BUILD.bazel | 40 + br/pkg/lightning/backend/importer/BUILD.bazel | 0 br/pkg/lightning/backend/kv/BUILD.bazel | 73 + br/pkg/lightning/backend/local/BUILD.bazel | 130 + br/pkg/lightning/backend/noop/BUILD.bazel | 19 + br/pkg/lightning/backend/tidb/BUILD.bazel | 54 + br/pkg/lightning/checkpoints/BUILD.bazel | 54 + .../checkpoints/checkpointspb/BUILD.bazel | 12 + br/pkg/lightning/common/BUILD.bazel | 69 + br/pkg/lightning/config/BUILD.bazel | 45 + br/pkg/lightning/errormanager/BUILD.bazel | 34 + br/pkg/lightning/glue/BUILD.bazel | 20 + br/pkg/lightning/log/BUILD.bazel | 36 + br/pkg/lightning/manual/BUILD.bazel | 13 + br/pkg/lightning/metric/BUILD.bazel | 22 + br/pkg/lightning/mydump/BUILD.bazel | 83 + br/pkg/lightning/restore/BUILD.bazel | 137 + br/pkg/lightning/tikv/BUILD.bazel | 36 + br/pkg/lightning/verification/BUILD.bazel | 22 + br/pkg/lightning/web/BUILD.bazel | 19 + br/pkg/lightning/worker/BUILD.bazel | 18 + br/pkg/logutil/BUILD.bazel | 43 + br/pkg/membuf/BUILD.bazel | 15 + br/pkg/metautil/BUILD.bazel | 44 + br/pkg/mock/BUILD.bazel | 61 + br/pkg/mock/mockid/BUILD.bazel | 8 + br/pkg/mock/storage/BUILD.bazel | 12 + br/pkg/pdutil/BUILD.bazel | 47 + br/pkg/redact/BUILD.bazel | 19 + br/pkg/restore/BUILD.bazel | 145 + br/pkg/rtree/BUILD.bazel | 38 + br/pkg/storage/BUILD.bazel | 75 + br/pkg/stream/BUILD.bazel | 75 + br/pkg/summary/BUILD.bazel | 32 + br/pkg/task/BUILD.bazel | 96 + br/pkg/trace/BUILD.bazel | 31 + br/pkg/utils/BUILD.bazel | 83 + br/pkg/version/BUILD.bazel | 34 + br/pkg/version/build/BUILD.bazel | 22 + br/tests/br_gcs/BUILD.bazel | 14 + br/tests/br_key_locked/BUILD.bazel | 36 + br/tests/br_rawkv/BUILD.bazel | 21 + br/tests/br_z_gc_safepoint/BUILD.bazel | 20 + .../lightning_checkpoint_parquet/BUILD.bazel | 18 + build/BUILD.bazel | 7 + build/jenkins_unit_test.sh | 29 + build/patches/BUILD.bazel | 5 + .../patches/com_github_golang_protobuf.patch | 12 + ...m_github_grpc_ecosystem_grpc_gateway.patch | 73 + build/patches/io_etcd_go_etcd_api_v3.patch | 24 + build/patches/io_etcd_go_etcd_raft_v3.patch | 22 + build/patches/io_etcd_go_etcd_server_v3.patch | 12 + build/print-workspace-status.sh | 37 + cmd/benchdb/BUILD.bazel | 24 + cmd/benchkv/BUILD.bazel | 25 + cmd/benchraw/BUILD.bazel | 22 + cmd/ddltest/BUILD.bazel | 38 + cmd/explaintest/BUILD.bazel | 31 + cmd/importer/BUILD.bazel | 47 + cmd/pluginpkg/BUILD.bazel | 15 + cmd/portgenerator/BUILD.bazel | 19 + config/BUILD.bazel | 47 + config/config_test.go | 3 - ddl/BUILD.bazel | 231 ++ ddl/db_table_test.go | 1 + ddl/failtest/BUILD.bazel | 28 + ddl/label/BUILD.bazel | 35 + ddl/placement/BUILD.bazel | 45 + ddl/testutil/BUILD.bazel | 19 + ddl/util/BUILD.bazel | 59 + distsql/BUILD.bazel | 94 + domain/BUILD.bazel | 112 + domain/db_test.go | 10 +- domain/globalconfigsync/BUILD.bazel | 29 + domain/infosync/BUILD.bazel | 65 + dumpling/cli/BUILD.bazel | 12 + dumpling/cmd/dumpling/BUILD.bazel | 22 + dumpling/context/BUILD.bazel | 9 + dumpling/export/BUILD.bazel | 108 + dumpling/log/BUILD.bazel | 13 + dumpling/tests/s3/BUILD.bazel | 20 + errno/BUILD.bazel | 26 + executor/BUILD.bazel | 424 +++ executor/aggfuncs/BUILD.bazel | 113 + executor/compact_table_test.go | 23 + executor/kvtest/BUILD.bazel | 17 + executor/kvtest/kv_test.go | 53 + executor/kvtest/main_test.go | 44 + executor/oomtest/BUILD.bazel | 15 + executor/seqtest/BUILD.bazel | 49 + executor/show_stats_test.go | 12 - executor/showtest/BUILD.bazel | 29 + executor/showtest/main_test.go | 44 + executor/{ => showtest}/show_test.go | 2037 +++++------ executor/simple_test.go | 31 - executor/tiflashtest/BUILD.bazel | 31 + executor/tiflashtest/main_test.go | 44 + executor/{ => tiflashtest}/tiflash_test.go | 2 +- expression/BUILD.bazel | 229 ++ expression/aggregation/BUILD.bazel | 72 + expression/generator/helper/BUILD.bazel | 8 + infoschema/BUILD.bazel | 111 + infoschema/perfschema/BUILD.bazel | 53 + infoschema/perfschema/tables_test.go | 11 +- infoschema/perfschema/testdata/test.pprof | Bin 0 -> 1206 bytes kv/BUILD.bazel | 86 + lock/BUILD.bazel | 16 + meta/BUILD.bazel | 44 + meta/autoid/BUILD.bazel | 58 + metrics/BUILD.bazel | 48 + owner/BUILD.bazel | 52 + parser/BUILD.bazel | 56 + parser/ast/BUILD.bazel | 57 + parser/auth/BUILD.bazel | 27 + parser/charset/BUILD.bazel | 46 + parser/format/BUILD.bazel | 18 + parser/goyacc/BUILD.bazel | 26 + parser/model/BUILD.bazel | 32 + parser/mysql/BUILD.bazel | 35 + parser/opcode/BUILD.bazel | 15 + parser/terror/BUILD.bazel | 24 + parser/test_driver/BUILD.bazel | 21 + parser/tidb/BUILD.bazel | 8 + parser/types/BUILD.bazel | 35 + planner/BUILD.bazel | 33 + planner/cascades/BUILD.bazel | 60 + planner/core/BUILD.bazel | 247 ++ planner/funcdep/BUILD.bazel | 45 + planner/implementation/BUILD.bazel | 38 + planner/memo/BUILD.bazel | 43 + planner/property/BUILD.bazel | 22 + planner/util/BUILD.bazel | 40 + plugin/BUILD.bazel | 49 + plugin/conn_ip_example/BUILD.bazel | 28 + privilege/BUILD.bazel | 14 + privilege/privileges/BUILD.bazel | 67 + server/BUILD.bazel | 205 ++ session/BUILD.bazel | 165 + session/schema_test.go | 330 -- session/session_test/BUILD.bazel | 26 + session/session_test/main_test.go | 79 + session/session_test/session_test.go | 360 ++ session/txninfo/BUILD.bazel | 15 + sessionctx/BUILD.bazel | 36 + sessionctx/binloginfo/BUILD.bazel | 56 + sessionctx/stmtctx/BUILD.bazel | 42 + sessionctx/variable/BUILD.bazel | 89 + sessiontxn/BUILD.bazel | 44 + sessiontxn/isolation/BUILD.bazel | 53 + sessiontxn/legacy/BUILD.bazel | 40 + sessiontxn/staleread/BUILD.bazel | 50 + statistics/BUILD.bazel | 112 + statistics/handle/BUILD.bazel | 98 + store/BUILD.bazel | 41 + store/copr/BUILD.bazel | 79 + store/driver/BUILD.bazel | 55 + store/driver/backoff/BUILD.bazel | 13 + store/driver/error/BUILD.bazel | 30 + store/driver/options/BUILD.bazel | 12 + store/driver/txn/BUILD.bazel | 65 + store/gcworker/BUILD.bazel | 76 + store/helper/BUILD.bazel | 50 + store/mockstore/BUILD.bazel | 53 + store/mockstore/mockcopr/BUILD.bazel | 76 + store/mockstore/mockstorage/BUILD.bazel | 16 + store/mockstore/unistore/BUILD.bazel | 56 + store/mockstore/unistore/client/BUILD.bazel | 9 + store/mockstore/unistore/config/BUILD.bazel | 12 + .../mockstore/unistore/cophandler/BUILD.bazel | 84 + .../mockstore/unistore/lockstore/BUILD.bazel | 32 + store/mockstore/unistore/metrics/BUILD.bazel | 12 + store/mockstore/unistore/pd/BUILD.bazel | 17 + store/mockstore/unistore/server/BUILD.bazel | 18 + store/mockstore/unistore/tikv/BUILD.bazel | 86 + .../unistore/tikv/dbreader/BUILD.bazel | 16 + .../unistore/tikv/kverrors/BUILD.bazel | 13 + .../mockstore/unistore/tikv/mvcc/BUILD.bazel | 20 + .../unistore/tikv/pberror/BUILD.bazel | 9 + .../unistore/util/lockwaiter/BUILD.bazel | 31 + store/pdtypes/BUILD.bazel | 21 + structure/BUILD.bazel | 39 + table/BUILD.bazel | 66 + table/tables/BUILD.bazel | 116 + table/temptable/BUILD.bazel | 57 + tablecodec/BUILD.bazel | 50 + tablecodec/rowindexcodec/BUILD.bazel | 22 + telemetry/BUILD.bazel | 68 + telemetry/cte_test/BUILD.bazel | 20 + testkit/BUILD.bazel | 34 + testkit/external/BUILD.bazel | 16 + testkit/testdata/BUILD.bazel | 13 + testkit/testmain/BUILD.bazel | 12 + testkit/testsetup/BUILD.bazel | 25 + testkit/testutil/BUILD.bazel | 31 + tests/globalkilltest/BUILD.bazel | 20 + tests/graceshutdown/BUILD.bazel | 18 + tests/readonlytest/BUILD.bazel | 15 + tests/realtikvtest/BUILD.bazel | 24 + tests/realtikvtest/brietest/BUILD.bazel | 21 + .../realtikvtest/pessimistictest/BUILD.bazel | 35 + tests/realtikvtest/sessiontest/BUILD.bazel | 46 + tests/realtikvtest/statisticstest/BUILD.bazel | 15 + tests/realtikvtest/txntest/BUILD.bazel | 22 + tidb-binlog/driver/example/mysql/BUILD.bazel | 26 + tidb-binlog/driver/example/print/BUILD.bazel | 20 + tidb-binlog/driver/reader/BUILD.bazel | 29 + tidb-binlog/node/BUILD.bazel | 30 + tidb-binlog/proto/go-binlog/BUILD.bazel | 9 + tidb-binlog/pump_client/BUILD.bazel | 43 + tidb-server/BUILD.bazel | 96 + tools/check/BUILD.bazel | 35 + types/BUILD.bazel | 96 + types/json/BUILD.bazel | 37 + types/parser_driver/BUILD.bazel | 32 + util/BUILD.bazel | 84 + util/admin/BUILD.bazel | 45 + util/arena/BUILD.bazel | 22 + util/benchdaily/BUILD.bazel | 21 + util/bitmap/BUILD.bazel | 22 + util/checksum/BUILD.bazel | 23 + util/chunk/BUILD.bazel | 74 + util/codec/BUILD.bazel | 54 + util/collate/BUILD.bazel | 46 + util/column-mapping/BUILD.bazel | 19 + util/cpuprofile/BUILD.bazel | 31 + util/cpuprofile/testutil/BUILD.bazel | 8 + util/cteutil/BUILD.bazel | 32 + util/dbterror/BUILD.bazel | 32 + util/dbutil/BUILD.bazel | 63 + util/ddl-checker/BUILD.bazel | 32 + util/deadlockhistory/BUILD.bazel | 37 + util/disjointset/BUILD.bazel | 22 + util/disk/BUILD.bazel | 36 + util/domainutil/BUILD.bazel | 9 + util/encrypt/BUILD.bazel | 30 + util/etcd/BUILD.bazel | 24 + util/execdetails/BUILD.bazel | 30 + util/expensivequery/BUILD.bazel | 37 + util/fastrand/BUILD.bazel | 22 + util/filter/BUILD.bazel | 26 + util/format/BUILD.bazel | 22 + util/gcutil/BUILD.bazel | 17 + util/generatedexpr/BUILD.bazel | 32 + util/hack/BUILD.bazel | 21 + util/hint/BUILD.bazel | 20 + util/importer/BUILD.bazel | 28 + util/israce/BUILD.bazel | 11 + util/keydecoder/BUILD.bazel | 40 + util/kvcache/BUILD.bazel | 27 + util/localpool/BUILD.bazel | 27 + util/logutil/BUILD.bazel | 43 + util/logutil/consistency/BUILD.bazel | 22 + util/mathutil/BUILD.bazel | 27 + util/memory/BUILD.bazel | 41 + util/mock/BUILD.bazel | 51 + util/mvmap/BUILD.bazel | 27 + util/paging/BUILD.bazel | 22 + util/parser/BUILD.bazel | 35 + util/pdapi/BUILD.bazel | 8 + util/plancodec/BUILD.bazel | 33 + util/printer/BUILD.bazel | 30 + util/profile/BUILD.bazel | 42 + util/promutil/BUILD.bazel | 22 + util/ranger/BUILD.bazel | 62 + util/regexpr-router/BUILD.bazel | 24 + util/resourcegrouptag/BUILD.bazel | 37 + util/rowDecoder/BUILD.bazel | 47 + util/rowcodec/BUILD.bazel | 51 + util/schemacmp/BUILD.bazel | 44 + util/selection/BUILD.bazel | 22 + util/sem/BUILD.bazel | 29 + util/set/BUILD.bazel | 31 + util/signal/BUILD.bazel | 16 + util/sli/BUILD.bazel | 12 + util/slice/BUILD.bazel | 22 + util/sqlexec/BUILD.bazel | 37 + util/stmtsummary/BUILD.bazel | 54 + util/stringutil/BUILD.bazel | 27 + util/sys/linux/BUILD.bazel | 27 + util/sys/storage/BUILD.bazel | 32 + util/systimemon/BUILD.bazel | 27 + util/table-filter/BUILD.bazel | 29 + util/table-router/BUILD.bazel | 22 + util/table-rule-selector/BUILD.bazel | 16 + util/tableutil/BUILD.bazel | 12 + util/testleak/BUILD.bazel | 0 util/texttree/BUILD.bazel | 22 + util/tikvutil/BUILD.bazel | 9 + util/timeutil/BUILD.bazel | 27 + util/tls/BUILD.bazel | 9 + util/topsql/BUILD.bazel | 46 + util/topsql/collector/BUILD.bazel | 31 + util/topsql/collector/mock/BUILD.bazel | 17 + util/topsql/reporter/BUILD.bazel | 58 + util/topsql/reporter/mock/BUILD.bazel | 17 + util/topsql/state/BUILD.bazel | 9 + util/topsql/stmtstats/BUILD.bazel | 38 + util/tracing/BUILD.bazel | 33 + util/trxevents/BUILD.bazel | 9 + util/versioninfo/BUILD.bazel | 8 + util/vitess/BUILD.bazel | 23 + util/watcher/BUILD.bazel | 22 + 322 files changed, 17268 insertions(+), 1401 deletions(-) create mode 100644 .bazelrc create mode 100644 BUILD.bazel create mode 100644 DEPS.bzl create mode 100644 WORKSPACE create mode 100644 bindinfo/BUILD.bazel create mode 100644 br/cmd/br/BUILD.bazel create mode 100644 br/cmd/tidb-lightning-ctl/BUILD.bazel create mode 100644 br/cmd/tidb-lightning/BUILD.bazel create mode 100644 br/pkg/backup/BUILD.bazel create mode 100644 br/pkg/checksum/BUILD.bazel create mode 100644 br/pkg/conn/BUILD.bazel create mode 100644 br/pkg/errors/BUILD.bazel create mode 100644 br/pkg/glue/BUILD.bazel create mode 100644 br/pkg/gluetidb/BUILD.bazel create mode 100644 br/pkg/gluetikv/BUILD.bazel create mode 100644 br/pkg/httputil/BUILD.bazel create mode 100644 br/pkg/lightning/BUILD.bazel create mode 100644 br/pkg/lightning/backend/BUILD.bazel create mode 100644 br/pkg/lightning/backend/importer/BUILD.bazel create mode 100644 br/pkg/lightning/backend/kv/BUILD.bazel create mode 100644 br/pkg/lightning/backend/local/BUILD.bazel create mode 100644 br/pkg/lightning/backend/noop/BUILD.bazel create mode 100644 br/pkg/lightning/backend/tidb/BUILD.bazel create mode 100644 br/pkg/lightning/checkpoints/BUILD.bazel create mode 100644 br/pkg/lightning/checkpoints/checkpointspb/BUILD.bazel create mode 100644 br/pkg/lightning/common/BUILD.bazel create mode 100644 br/pkg/lightning/config/BUILD.bazel create mode 100644 br/pkg/lightning/errormanager/BUILD.bazel create mode 100644 br/pkg/lightning/glue/BUILD.bazel create mode 100644 br/pkg/lightning/log/BUILD.bazel create mode 100644 br/pkg/lightning/manual/BUILD.bazel create mode 100644 br/pkg/lightning/metric/BUILD.bazel create mode 100644 br/pkg/lightning/mydump/BUILD.bazel create mode 100644 br/pkg/lightning/restore/BUILD.bazel create mode 100644 br/pkg/lightning/tikv/BUILD.bazel create mode 100644 br/pkg/lightning/verification/BUILD.bazel create mode 100644 br/pkg/lightning/web/BUILD.bazel create mode 100644 br/pkg/lightning/worker/BUILD.bazel create mode 100644 br/pkg/logutil/BUILD.bazel create mode 100644 br/pkg/membuf/BUILD.bazel create mode 100644 br/pkg/metautil/BUILD.bazel create mode 100644 br/pkg/mock/BUILD.bazel create mode 100644 br/pkg/mock/mockid/BUILD.bazel create mode 100644 br/pkg/mock/storage/BUILD.bazel create mode 100644 br/pkg/pdutil/BUILD.bazel create mode 100644 br/pkg/redact/BUILD.bazel create mode 100644 br/pkg/restore/BUILD.bazel create mode 100644 br/pkg/rtree/BUILD.bazel create mode 100644 br/pkg/storage/BUILD.bazel create mode 100644 br/pkg/stream/BUILD.bazel create mode 100644 br/pkg/summary/BUILD.bazel create mode 100644 br/pkg/task/BUILD.bazel create mode 100644 br/pkg/trace/BUILD.bazel create mode 100644 br/pkg/utils/BUILD.bazel create mode 100644 br/pkg/version/BUILD.bazel create mode 100644 br/pkg/version/build/BUILD.bazel create mode 100644 br/tests/br_gcs/BUILD.bazel create mode 100644 br/tests/br_key_locked/BUILD.bazel create mode 100644 br/tests/br_rawkv/BUILD.bazel create mode 100644 br/tests/br_z_gc_safepoint/BUILD.bazel create mode 100644 br/tests/lightning_checkpoint_parquet/BUILD.bazel create mode 100644 build/BUILD.bazel create mode 100755 build/jenkins_unit_test.sh create mode 100644 build/patches/BUILD.bazel create mode 100644 build/patches/com_github_golang_protobuf.patch create mode 100644 build/patches/com_github_grpc_ecosystem_grpc_gateway.patch create mode 100644 build/patches/io_etcd_go_etcd_api_v3.patch create mode 100644 build/patches/io_etcd_go_etcd_raft_v3.patch create mode 100644 build/patches/io_etcd_go_etcd_server_v3.patch create mode 100755 build/print-workspace-status.sh create mode 100644 cmd/benchdb/BUILD.bazel create mode 100644 cmd/benchkv/BUILD.bazel create mode 100644 cmd/benchraw/BUILD.bazel create mode 100644 cmd/ddltest/BUILD.bazel create mode 100644 cmd/explaintest/BUILD.bazel create mode 100644 cmd/importer/BUILD.bazel create mode 100644 cmd/pluginpkg/BUILD.bazel create mode 100644 cmd/portgenerator/BUILD.bazel create mode 100644 config/BUILD.bazel create mode 100644 ddl/BUILD.bazel create mode 100644 ddl/failtest/BUILD.bazel create mode 100644 ddl/label/BUILD.bazel create mode 100644 ddl/placement/BUILD.bazel create mode 100644 ddl/testutil/BUILD.bazel create mode 100644 ddl/util/BUILD.bazel create mode 100644 distsql/BUILD.bazel create mode 100644 domain/BUILD.bazel create mode 100644 domain/globalconfigsync/BUILD.bazel create mode 100644 domain/infosync/BUILD.bazel create mode 100644 dumpling/cli/BUILD.bazel create mode 100644 dumpling/cmd/dumpling/BUILD.bazel create mode 100644 dumpling/context/BUILD.bazel create mode 100644 dumpling/export/BUILD.bazel create mode 100644 dumpling/log/BUILD.bazel create mode 100644 dumpling/tests/s3/BUILD.bazel create mode 100644 errno/BUILD.bazel create mode 100644 executor/BUILD.bazel create mode 100644 executor/aggfuncs/BUILD.bazel create mode 100644 executor/kvtest/BUILD.bazel create mode 100644 executor/kvtest/kv_test.go create mode 100644 executor/kvtest/main_test.go create mode 100644 executor/oomtest/BUILD.bazel create mode 100644 executor/seqtest/BUILD.bazel create mode 100644 executor/showtest/BUILD.bazel create mode 100644 executor/showtest/main_test.go rename executor/{ => showtest}/show_test.go (99%) create mode 100644 executor/tiflashtest/BUILD.bazel create mode 100644 executor/tiflashtest/main_test.go rename executor/{ => tiflashtest}/tiflash_test.go (99%) create mode 100644 expression/BUILD.bazel create mode 100644 expression/aggregation/BUILD.bazel create mode 100644 expression/generator/helper/BUILD.bazel create mode 100644 infoschema/BUILD.bazel create mode 100644 infoschema/perfschema/BUILD.bazel create mode 100644 infoschema/perfschema/testdata/test.pprof create mode 100644 kv/BUILD.bazel create mode 100644 lock/BUILD.bazel create mode 100644 meta/BUILD.bazel create mode 100644 meta/autoid/BUILD.bazel create mode 100644 metrics/BUILD.bazel create mode 100644 owner/BUILD.bazel create mode 100644 parser/BUILD.bazel create mode 100644 parser/ast/BUILD.bazel create mode 100644 parser/auth/BUILD.bazel create mode 100644 parser/charset/BUILD.bazel create mode 100644 parser/format/BUILD.bazel create mode 100644 parser/goyacc/BUILD.bazel create mode 100644 parser/model/BUILD.bazel create mode 100644 parser/mysql/BUILD.bazel create mode 100644 parser/opcode/BUILD.bazel create mode 100644 parser/terror/BUILD.bazel create mode 100644 parser/test_driver/BUILD.bazel create mode 100644 parser/tidb/BUILD.bazel create mode 100644 parser/types/BUILD.bazel create mode 100644 planner/BUILD.bazel create mode 100644 planner/cascades/BUILD.bazel create mode 100644 planner/core/BUILD.bazel create mode 100644 planner/funcdep/BUILD.bazel create mode 100644 planner/implementation/BUILD.bazel create mode 100644 planner/memo/BUILD.bazel create mode 100644 planner/property/BUILD.bazel create mode 100644 planner/util/BUILD.bazel create mode 100644 plugin/BUILD.bazel create mode 100644 plugin/conn_ip_example/BUILD.bazel create mode 100644 privilege/BUILD.bazel create mode 100644 privilege/privileges/BUILD.bazel create mode 100644 server/BUILD.bazel create mode 100644 session/BUILD.bazel create mode 100644 session/session_test/BUILD.bazel create mode 100644 session/session_test/main_test.go create mode 100644 session/session_test/session_test.go create mode 100644 session/txninfo/BUILD.bazel create mode 100644 sessionctx/BUILD.bazel create mode 100644 sessionctx/binloginfo/BUILD.bazel create mode 100644 sessionctx/stmtctx/BUILD.bazel create mode 100644 sessionctx/variable/BUILD.bazel create mode 100644 sessiontxn/BUILD.bazel create mode 100644 sessiontxn/isolation/BUILD.bazel create mode 100644 sessiontxn/legacy/BUILD.bazel create mode 100644 sessiontxn/staleread/BUILD.bazel create mode 100644 statistics/BUILD.bazel create mode 100644 statistics/handle/BUILD.bazel create mode 100644 store/BUILD.bazel create mode 100644 store/copr/BUILD.bazel create mode 100644 store/driver/BUILD.bazel create mode 100644 store/driver/backoff/BUILD.bazel create mode 100644 store/driver/error/BUILD.bazel create mode 100644 store/driver/options/BUILD.bazel create mode 100644 store/driver/txn/BUILD.bazel create mode 100644 store/gcworker/BUILD.bazel create mode 100644 store/helper/BUILD.bazel create mode 100644 store/mockstore/BUILD.bazel create mode 100644 store/mockstore/mockcopr/BUILD.bazel create mode 100644 store/mockstore/mockstorage/BUILD.bazel create mode 100644 store/mockstore/unistore/BUILD.bazel create mode 100644 store/mockstore/unistore/client/BUILD.bazel create mode 100644 store/mockstore/unistore/config/BUILD.bazel create mode 100644 store/mockstore/unistore/cophandler/BUILD.bazel create mode 100644 store/mockstore/unistore/lockstore/BUILD.bazel create mode 100644 store/mockstore/unistore/metrics/BUILD.bazel create mode 100644 store/mockstore/unistore/pd/BUILD.bazel create mode 100644 store/mockstore/unistore/server/BUILD.bazel create mode 100644 store/mockstore/unistore/tikv/BUILD.bazel create mode 100644 store/mockstore/unistore/tikv/dbreader/BUILD.bazel create mode 100644 store/mockstore/unistore/tikv/kverrors/BUILD.bazel create mode 100644 store/mockstore/unistore/tikv/mvcc/BUILD.bazel create mode 100644 store/mockstore/unistore/tikv/pberror/BUILD.bazel create mode 100644 store/mockstore/unistore/util/lockwaiter/BUILD.bazel create mode 100644 store/pdtypes/BUILD.bazel create mode 100644 structure/BUILD.bazel create mode 100644 table/BUILD.bazel create mode 100644 table/tables/BUILD.bazel create mode 100644 table/temptable/BUILD.bazel create mode 100644 tablecodec/BUILD.bazel create mode 100644 tablecodec/rowindexcodec/BUILD.bazel create mode 100644 telemetry/BUILD.bazel create mode 100644 telemetry/cte_test/BUILD.bazel create mode 100644 testkit/BUILD.bazel create mode 100644 testkit/external/BUILD.bazel create mode 100644 testkit/testdata/BUILD.bazel create mode 100644 testkit/testmain/BUILD.bazel create mode 100644 testkit/testsetup/BUILD.bazel create mode 100644 testkit/testutil/BUILD.bazel create mode 100644 tests/globalkilltest/BUILD.bazel create mode 100644 tests/graceshutdown/BUILD.bazel create mode 100644 tests/readonlytest/BUILD.bazel create mode 100644 tests/realtikvtest/BUILD.bazel create mode 100644 tests/realtikvtest/brietest/BUILD.bazel create mode 100644 tests/realtikvtest/pessimistictest/BUILD.bazel create mode 100644 tests/realtikvtest/sessiontest/BUILD.bazel create mode 100644 tests/realtikvtest/statisticstest/BUILD.bazel create mode 100644 tests/realtikvtest/txntest/BUILD.bazel create mode 100644 tidb-binlog/driver/example/mysql/BUILD.bazel create mode 100644 tidb-binlog/driver/example/print/BUILD.bazel create mode 100644 tidb-binlog/driver/reader/BUILD.bazel create mode 100644 tidb-binlog/node/BUILD.bazel create mode 100644 tidb-binlog/proto/go-binlog/BUILD.bazel create mode 100644 tidb-binlog/pump_client/BUILD.bazel create mode 100644 tidb-server/BUILD.bazel create mode 100644 tools/check/BUILD.bazel create mode 100644 types/BUILD.bazel create mode 100644 types/json/BUILD.bazel create mode 100644 types/parser_driver/BUILD.bazel create mode 100644 util/BUILD.bazel create mode 100644 util/admin/BUILD.bazel create mode 100644 util/arena/BUILD.bazel create mode 100644 util/benchdaily/BUILD.bazel create mode 100644 util/bitmap/BUILD.bazel create mode 100644 util/checksum/BUILD.bazel create mode 100644 util/chunk/BUILD.bazel create mode 100644 util/codec/BUILD.bazel create mode 100644 util/collate/BUILD.bazel create mode 100644 util/column-mapping/BUILD.bazel create mode 100644 util/cpuprofile/BUILD.bazel create mode 100644 util/cpuprofile/testutil/BUILD.bazel create mode 100644 util/cteutil/BUILD.bazel create mode 100644 util/dbterror/BUILD.bazel create mode 100644 util/dbutil/BUILD.bazel create mode 100644 util/ddl-checker/BUILD.bazel create mode 100644 util/deadlockhistory/BUILD.bazel create mode 100644 util/disjointset/BUILD.bazel create mode 100644 util/disk/BUILD.bazel create mode 100644 util/domainutil/BUILD.bazel create mode 100644 util/encrypt/BUILD.bazel create mode 100644 util/etcd/BUILD.bazel create mode 100644 util/execdetails/BUILD.bazel create mode 100644 util/expensivequery/BUILD.bazel create mode 100644 util/fastrand/BUILD.bazel create mode 100644 util/filter/BUILD.bazel create mode 100644 util/format/BUILD.bazel create mode 100644 util/gcutil/BUILD.bazel create mode 100644 util/generatedexpr/BUILD.bazel create mode 100644 util/hack/BUILD.bazel create mode 100644 util/hint/BUILD.bazel create mode 100644 util/importer/BUILD.bazel create mode 100644 util/israce/BUILD.bazel create mode 100644 util/keydecoder/BUILD.bazel create mode 100644 util/kvcache/BUILD.bazel create mode 100644 util/localpool/BUILD.bazel create mode 100644 util/logutil/BUILD.bazel create mode 100644 util/logutil/consistency/BUILD.bazel create mode 100644 util/mathutil/BUILD.bazel create mode 100644 util/memory/BUILD.bazel create mode 100644 util/mock/BUILD.bazel create mode 100644 util/mvmap/BUILD.bazel create mode 100644 util/paging/BUILD.bazel create mode 100644 util/parser/BUILD.bazel create mode 100644 util/pdapi/BUILD.bazel create mode 100644 util/plancodec/BUILD.bazel create mode 100644 util/printer/BUILD.bazel create mode 100644 util/profile/BUILD.bazel create mode 100644 util/promutil/BUILD.bazel create mode 100644 util/ranger/BUILD.bazel create mode 100644 util/regexpr-router/BUILD.bazel create mode 100644 util/resourcegrouptag/BUILD.bazel create mode 100644 util/rowDecoder/BUILD.bazel create mode 100644 util/rowcodec/BUILD.bazel create mode 100644 util/schemacmp/BUILD.bazel create mode 100644 util/selection/BUILD.bazel create mode 100644 util/sem/BUILD.bazel create mode 100644 util/set/BUILD.bazel create mode 100644 util/signal/BUILD.bazel create mode 100644 util/sli/BUILD.bazel create mode 100644 util/slice/BUILD.bazel create mode 100644 util/sqlexec/BUILD.bazel create mode 100644 util/stmtsummary/BUILD.bazel create mode 100644 util/stringutil/BUILD.bazel create mode 100644 util/sys/linux/BUILD.bazel create mode 100644 util/sys/storage/BUILD.bazel create mode 100644 util/systimemon/BUILD.bazel create mode 100644 util/table-filter/BUILD.bazel create mode 100644 util/table-router/BUILD.bazel create mode 100644 util/table-rule-selector/BUILD.bazel create mode 100644 util/tableutil/BUILD.bazel create mode 100644 util/testleak/BUILD.bazel create mode 100644 util/texttree/BUILD.bazel create mode 100644 util/tikvutil/BUILD.bazel create mode 100644 util/timeutil/BUILD.bazel create mode 100644 util/tls/BUILD.bazel create mode 100644 util/topsql/BUILD.bazel create mode 100644 util/topsql/collector/BUILD.bazel create mode 100644 util/topsql/collector/mock/BUILD.bazel create mode 100644 util/topsql/reporter/BUILD.bazel create mode 100644 util/topsql/reporter/mock/BUILD.bazel create mode 100644 util/topsql/state/BUILD.bazel create mode 100644 util/topsql/stmtstats/BUILD.bazel create mode 100644 util/tracing/BUILD.bazel create mode 100644 util/trxevents/BUILD.bazel create mode 100644 util/versioninfo/BUILD.bazel create mode 100644 util/vitess/BUILD.bazel create mode 100644 util/watcher/BUILD.bazel diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 0000000000000..3735abb9e09c1 --- /dev/null +++ b/.bazelrc @@ -0,0 +1,12 @@ +startup --host_jvm_args=-Xmx8g +startup --unlimit_coredumps + +run --color=yes +build:release --workspace_status_command=./build/print-workspace-status.sh --stamp +build:release --config=ci +build --incompatible_strict_action_env --incompatible_enable_cc_toolchain_resolution +build:ci --remote_cache=http://172.16.4.3:8084/tidb +test:ci --verbose_failures +test:ci --test_env=GO_TEST_WRAP_TESTV=1 +test:ci --remote_cache=http://172.16.4.3:8084/tidb +test:ci --test_env=TZ=Asia/Shanghai --test_output=errors --experimental_ui_max_stdouterr_bytes=104857600 diff --git a/.github/licenserc.yml b/.github/licenserc.yml index 9f4890a3a1329..0ee65d473e82b 100644 --- a/.github/licenserc.yml +++ b/.github/licenserc.yml @@ -10,6 +10,9 @@ header: - '.golangci.yml' - '.golangci_br.yml' - 'LICENSES/' + - '**/BUILD.bazel' + - 'WORKSPACE' + - '.bazelrc' - '**/*.key' - '**/*.md' - '**/*.json' @@ -19,6 +22,8 @@ header: - '**/*.test' - '**/*.result' - '**/*.example' + - '**/*.patch' + - 'DEPS.bzl' - '.codecov.yml' - 'Jenkinsfile' - '.editorconfig' diff --git a/.gitignore b/.gitignore index ec864762068de..e2cdcd078a0f1 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,9 @@ export-20*/ *-junit-report.xml # Files generated when testing out +/_bazel +bazel-bin +bazel-out +bazel-testlogs +bazel-tidb +.ijwb/ diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 0000000000000..00f4ed67a67c6 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,28 @@ +load("@bazel_gazelle//:def.bzl", "gazelle") + +# gazelle:proto disable_global +# gazelle:prefix github.com/pingcap/tidb +# gazelle:exclude tidb-binlog/proto/proto +# gazelle:exclude plugin/conn_ip_example +gazelle(name = "gazelle") + +package(default_visibility = ["//visibility:public"]) + +xcode_version( + name = "xcode_version", + version = "10.0", +) + +filegroup( + name = "package-srcs", + srcs = glob( + ["**"], + exclude = [ + "bazel-*/**", + ".git/**", + ".idea/**", + ], + ), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) diff --git a/DEPS.bzl b/DEPS.bzl new file mode 100644 index 0000000000000..6684651b0860d --- /dev/null +++ b/DEPS.bzl @@ -0,0 +1,3154 @@ +load("@bazel_gazelle//:deps.bzl", "go_repository") + +def go_deps(): + go_repository( + name = "co_honnef_go_tools", + build_file_proto_mode = "disable_global", + importpath = "honnef.co/go/tools", + sum = "h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=", + version = "v0.0.1-2020.1.4", + ) + go_repository( + name = "com_github_ajg_form", + build_file_proto_mode = "disable_global", + importpath = "github.com/ajg/form", + sum = "h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=", + version = "v1.5.1", + ) + go_repository( + name = "com_github_ajstarks_svgo", + build_file_proto_mode = "disable_global", + importpath = "github.com/ajstarks/svgo", + sum = "h1:wVe6/Ea46ZMeNkQjjBW6xcqyQA/j5e0D6GytH95g0gQ=", + version = "v0.0.0-20180226025133-644b8db467af", + ) + go_repository( + name = "com_github_alecthomas_template", + build_file_proto_mode = "disable_global", + importpath = "github.com/alecthomas/template", + sum = "h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=", + version = "v0.0.0-20190718012654-fb15b899a751", + ) + go_repository( + name = "com_github_alecthomas_units", + build_file_proto_mode = "disable_global", + importpath = "github.com/alecthomas/units", + sum = "h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=", + version = "v0.0.0-20190924025748-f65c72e2690d", + ) + go_repository( + name = "com_github_aliyun_alibaba_cloud_sdk_go", + build_file_proto_mode = "disable", + importpath = "github.com/aliyun/alibaba-cloud-sdk-go", + sum = "h1:Q/yk4z/cHUVZfgTqtD09qeYBxHwshQAjVRX73qs8UH0=", + version = "v1.61.1581", + ) + + go_repository( + name = "com_github_andreasbriese_bbloom", + build_file_proto_mode = "disable_global", + importpath = "github.com/AndreasBriese/bbloom", + sum = "h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4=", + version = "v0.0.0-20190306092124-e2d15f34fcf9", + ) + go_repository( + name = "com_github_antihax_optional", + build_file_proto_mode = "disable_global", + importpath = "github.com/antihax/optional", + sum = "h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_apache_thrift", + build_file_proto_mode = "disable_global", + importpath = "github.com/apache/thrift", + sum = "h1:Jz3KVLYY5+JO7rDiX0sAuRGtuv2vG01r17Y9nLMWNUw=", + version = "v0.13.1-0.20201008052519-daf620915714", + ) + go_repository( + name = "com_github_armon_circbuf", + build_file_proto_mode = "disable_global", + importpath = "github.com/armon/circbuf", + sum = "h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA=", + version = "v0.0.0-20150827004946-bbbad097214e", + ) + go_repository( + name = "com_github_armon_consul_api", + build_file_proto_mode = "disable_global", + importpath = "github.com/armon/consul-api", + sum = "h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA=", + version = "v0.0.0-20180202201655-eb2c6b5be1b6", + ) + go_repository( + name = "com_github_armon_go_metrics", + build_file_proto_mode = "disable_global", + importpath = "github.com/armon/go-metrics", + sum = "h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I=", + version = "v0.0.0-20180917152333-f0300d1749da", + ) + go_repository( + name = "com_github_armon_go_radix", + build_file_proto_mode = "disable_global", + importpath = "github.com/armon/go-radix", + sum = "h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to=", + version = "v0.0.0-20180808171621-7fddfc383310", + ) + go_repository( + name = "com_github_aws_aws_sdk_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/aws/aws-sdk-go", + sum = "h1:r0puXncSaAfRt7Btml2swUo74Kao+vKhO3VLjwDjK54=", + version = "v1.35.3", + ) + go_repository( + name = "com_github_aymerick_raymond", + build_file_proto_mode = "disable_global", + importpath = "github.com/aymerick/raymond", + sum = "h1:Ppm0npCCsmuR9oQaBtRuZcmILVE74aXE+AmrJj8L2ns=", + version = "v2.0.3-0.20180322193309-b565731e1464+incompatible", + ) + go_repository( + name = "com_github_azure_azure_sdk_for_go_sdk_azcore", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/azure-sdk-for-go/sdk/azcore", + sum = "h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA=", + version = "v0.20.0", + ) + go_repository( + name = "com_github_azure_azure_sdk_for_go_sdk_azidentity", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/azure-sdk-for-go/sdk/azidentity", + sum = "h1:VBvHGLJbaY0+c66NZHdS9cgjHVYSH6DDa0XJMyrblsI=", + version = "v0.12.0", + ) + go_repository( + name = "com_github_azure_azure_sdk_for_go_sdk_internal", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/azure-sdk-for-go/sdk/internal", + sum = "h1:BUYIbDf/mMZ8945v3QkG3OuqGVyS4Iek0AOLwdRAYoc=", + version = "v0.8.1", + ) + go_repository( + name = "com_github_azure_azure_sdk_for_go_sdk_storage_azblob", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob", + sum = "h1:62Ew5xXg5UCGIXDOM7+y4IL5/6mQJq1nenhBCJAeGX8=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_benbjohnson_clock", + build_file_proto_mode = "disable_global", + importpath = "github.com/benbjohnson/clock", + sum = "h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_beorn7_perks", + build_file_proto_mode = "disable_global", + importpath = "github.com/beorn7/perks", + sum = "h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_bgentry_speakeasy", + build_file_proto_mode = "disable_global", + importpath = "github.com/bgentry/speakeasy", + sum = "h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_bketelsen_crypt", + build_file_proto_mode = "disable_global", + importpath = "github.com/bketelsen/crypt", + sum = "h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc=", + version = "v0.0.3-0.20200106085610-5cbc8cc4026c", + ) + go_repository( + name = "com_github_blacktear23_go_proxyprotocol", + build_file_proto_mode = "disable_global", + importpath = "github.com/blacktear23/go-proxyprotocol", + sum = "h1:rQlvB2AYWme2bIB18r/SipGiMEVJYE9U0z+MGoU/LtQ=", + version = "v0.0.0-20180807104634-af7a81e8dd0d", + ) + go_repository( + name = "com_github_burntsushi_toml", + build_file_proto_mode = "disable_global", + importpath = "github.com/BurntSushi/toml", + sum = "h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=", + version = "v0.3.1", + ) + go_repository( + name = "com_github_burntsushi_xgb", + build_file_proto_mode = "disable_global", + importpath = "github.com/BurntSushi/xgb", + sum = "h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=", + version = "v0.0.0-20160522181843-27f122750802", + ) + go_repository( + name = "com_github_carlmjohnson_flagext", + build_file_proto_mode = "disable_global", + importpath = "github.com/carlmjohnson/flagext", + sum = "h1:/c4uK3ie786Z7caXLcIMvePNSSiH3bQVGDvmGLMme60=", + version = "v0.21.0", + ) + go_repository( + name = "com_github_census_instrumentation_opencensus_proto", + build_file_proto_mode = "disable_global", + importpath = "github.com/census-instrumentation/opencensus-proto", + sum = "h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=", + version = "v0.2.1", + ) + go_repository( + name = "com_github_certifi_gocertifi", + build_file_proto_mode = "disable_global", + importpath = "github.com/certifi/gocertifi", + sum = "h1:uH66TXeswKn5PW5zdZ39xEwfS9an067BirqA+P4QaLI=", + version = "v0.0.0-20200922220541-2c3bb06c6054", + ) + go_repository( + name = "com_github_cespare_xxhash", + build_file_proto_mode = "disable_global", + importpath = "github.com/cespare/xxhash", + sum = "h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_cespare_xxhash_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/cespare/xxhash/v2", + sum = "h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=", + version = "v2.1.2", + ) + go_repository( + name = "com_github_cheggaaa_pb_v3", + build_file_proto_mode = "disable_global", + importpath = "github.com/cheggaaa/pb/v3", + sum = "h1:bC8oemdChbke2FHIIGy9mn4DPJ2caZYQnfbRqwmdCoA=", + version = "v3.0.8", + ) + go_repository( + name = "com_github_cheynewallace_tabby", + build_file_proto_mode = "disable_global", + importpath = "github.com/cheynewallace/tabby", + sum = "h1:JvUR8waht4Y0S3JF17G6Vhyt+FRhnqVCkk8l4YrOU54=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_chzyer_logex", + build_file_proto_mode = "disable_global", + importpath = "github.com/chzyer/logex", + sum = "h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=", + version = "v1.1.10", + ) + go_repository( + name = "com_github_chzyer_readline", + build_file_proto_mode = "disable_global", + importpath = "github.com/chzyer/readline", + sum = "h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=", + version = "v0.0.0-20180603132655-2972be24d48e", + ) + go_repository( + name = "com_github_chzyer_test", + build_file_proto_mode = "disable_global", + importpath = "github.com/chzyer/test", + sum = "h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=", + version = "v0.0.0-20180213035817-a1ea475d72b1", + ) + go_repository( + name = "com_github_client9_misspell", + build_file_proto_mode = "disable_global", + importpath = "github.com/client9/misspell", + sum = "h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=", + version = "v0.3.4", + ) + go_repository( + name = "com_github_cloudykit_fastprinter", + build_file_proto_mode = "disable_global", + importpath = "github.com/CloudyKit/fastprinter", + sum = "h1:3SgJcK9l5uPdBC/X17wanyJAMxM33+4ZhEIV96MIH8U=", + version = "v0.0.0-20170127035650-74b38d55f37a", + ) + go_repository( + name = "com_github_cloudykit_jet", + build_file_proto_mode = "disable_global", + importpath = "github.com/CloudyKit/jet", + sum = "h1:rZgFj+Gtf3NMi/U5FvCvhzaxzW/TaPYgUYx3bAPz9DE=", + version = "v2.1.3-0.20180809161101-62edd43e4f88+incompatible", + ) + go_repository( + name = "com_github_cncf_udpa_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/cncf/udpa/go", + sum = "h1:hzAQntlaYRkVSFEfj9OTWlVV1H155FMD8BTKktLv0QI=", + version = "v0.0.0-20210930031921-04548b0d99d4", + ) + go_repository( + name = "com_github_cncf_xds_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/cncf/xds/go", + sum = "h1:zH8ljVhhq7yC0MIeUL/IviMtY8hx2mK8cN9wEYb8ggw=", + version = "v0.0.0-20211011173535-cb28da3451f1", + ) + go_repository( + name = "com_github_cockroachdb_datadriven", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/datadriven", + sum = "h1:uhZrAfEayBecH2w2tZmhe20HJ7hDvrrA4x2Bg9YdZKM=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_cockroachdb_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/errors", + sum = "h1:A5+txlVZfOqFBDa4mGz2bUWSp0aHElvHX2bKkdbQu+Y=", + version = "v1.8.1", + ) + go_repository( + name = "com_github_cockroachdb_logtags", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/logtags", + sum = "h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY=", + version = "v0.0.0-20190617123548-eb05cc24525f", + ) + go_repository( + name = "com_github_cockroachdb_pebble", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/pebble", + sum = "h1:Igd6YmtOZ77EgLAIaE9+mHl7+sAKaZ5m4iMI0Dz/J2A=", + version = "v0.0.0-20210719141320-8c3bd06debb5", + ) + go_repository( + name = "com_github_cockroachdb_redact", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/redact", + sum = "h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw=", + version = "v1.0.8", + ) + go_repository( + name = "com_github_cockroachdb_sentry_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/sentry-go", + sum = "h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM=", + version = "v0.6.1-cockroachdb.2", + ) + go_repository( + name = "com_github_codahale_hdrhistogram", + build_file_proto_mode = "disable_global", + importpath = "github.com/codahale/hdrhistogram", + sum = "h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w=", + version = "v0.0.0-20161010025455-3a0bb77429bd", + ) + go_repository( + name = "com_github_codegangsta_inject", + build_file_proto_mode = "disable_global", + importpath = "github.com/codegangsta/inject", + sum = "h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q=", + version = "v0.0.0-20150114235600-33e0aa1cb7c0", + ) + go_repository( + name = "com_github_colinmarc_hdfs_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/colinmarc/hdfs/v2", + sum = "h1:x0hw/m+o3UE20Scso/KCkvYNc9Di39TBlCfGMkJ1/a0=", + version = "v2.1.1", + ) + go_repository( + name = "com_github_coocood_bbloom", + build_file_proto_mode = "disable_global", + importpath = "github.com/coocood/bbloom", + sum = "h1:W1SHiII3e0jVwvaQFglwu3kS9NLxOeTpvik7MbKCyuQ=", + version = "v0.0.0-20190830030839-58deb6228d64", + ) + go_repository( + name = "com_github_coocood_freecache", + build_file_proto_mode = "disable_global", + importpath = "github.com/coocood/freecache", + sum = "h1:/v1CqMq45NFH9mp/Pt142reundeBM0dVUD3osQBeu/U=", + version = "v1.2.1", + ) + go_repository( + name = "com_github_coocood_rtutil", + build_file_proto_mode = "disable_global", + importpath = "github.com/coocood/rtutil", + sum = "h1:NnLfQ77q0G4k2Of2c1ceQ0ec6MkLQyDp+IGdVM0D8XM=", + version = "v0.0.0-20190304133409-c84515f646f2", + ) + go_repository( + name = "com_github_coreos_bbolt", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/bbolt", + sum = "h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s=", + version = "v1.3.2", + ) + go_repository( + name = "com_github_coreos_etcd", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/etcd", + sum = "h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ=", + version = "v3.3.13+incompatible", + ) + go_repository( + name = "com_github_coreos_go_etcd", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/go-etcd", + sum = "h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo=", + version = "v2.0.0+incompatible", + ) + go_repository( + name = "com_github_coreos_go_semver", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/go-semver", + sum = "h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_coreos_go_systemd", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/go-systemd", + sum = "h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8=", + version = "v0.0.0-20190321100706-95778dfbb74e", + ) + go_repository( + name = "com_github_coreos_go_systemd_v22", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/go-systemd/v22", + sum = "h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=", + version = "v22.3.2", + ) + go_repository( + name = "com_github_coreos_pkg", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/pkg", + sum = "h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=", + version = "v0.0.0-20180928190104-399ea9e2e55f", + ) + go_repository( + name = "com_github_cpuguy83_go_md2man", + build_file_proto_mode = "disable_global", + importpath = "github.com/cpuguy83/go-md2man", + sum = "h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=", + version = "v1.0.10", + ) + go_repository( + name = "com_github_cpuguy83_go_md2man_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/cpuguy83/go-md2man/v2", + sum = "h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU=", + version = "v2.0.1", + ) + go_repository( + name = "com_github_creack_pty", + build_file_proto_mode = "disable_global", + importpath = "github.com/creack/pty", + sum = "h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=", + version = "v1.1.11", + ) + go_repository( + name = "com_github_cznic_mathutil", + build_file_proto_mode = "disable_global", + importpath = "github.com/cznic/mathutil", + sum = "h1:iwZdTE0PVqJCos1vaoKsclOGD3ADKpshg3SRtYBbwso=", + version = "v0.0.0-20181122101859-297441e03548", + ) + go_repository( + name = "com_github_cznic_sortutil", + build_file_proto_mode = "disable_global", + importpath = "github.com/cznic/sortutil", + sum = "h1:LpMLYGyy67BoAFGda1NeOBQwqlv7nUXpm+rIVHGxZZ4=", + version = "v0.0.0-20181122101858-f5f958428db8", + ) + go_repository( + name = "com_github_cznic_strutil", + build_file_proto_mode = "disable_global", + importpath = "github.com/cznic/strutil", + sum = "h1:0rkFMAbn5KBKNpJyHQ6Prb95vIKanmAe62KxsrN+sqA=", + version = "v0.0.0-20171016134553-529a34b1c186", + ) + go_repository( + name = "com_github_danjacques_gofslock", + build_file_proto_mode = "disable_global", + importpath = "github.com/danjacques/gofslock", + sum = "h1:X6mKGhCFOxrKeeHAjv/3UvT6e5RRxW6wRdlqlV6/H4w=", + version = "v0.0.0-20191023191349-0a45f885bc37", + ) + go_repository( + name = "com_github_data_dog_go_sqlmock", + build_file_proto_mode = "disable_global", + importpath = "github.com/DATA-DOG/go-sqlmock", + sum = "h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_datadog_zstd", + build_file_proto_mode = "disable_global", + importpath = "github.com/DataDog/zstd", + sum = "h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=", + version = "v1.4.5", + ) + go_repository( + name = "com_github_davecgh_go_spew", + build_file_proto_mode = "disable_global", + importpath = "github.com/davecgh/go-spew", + sum = "h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_dgraph_io_badger", + build_file_proto_mode = "disable_global", + importpath = "github.com/dgraph-io/badger", + sum = "h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_dgraph_io_ristretto", + build_file_proto_mode = "disable_global", + importpath = "github.com/dgraph-io/ristretto", + sum = "h1:Wrc3UKTS+cffkOx0xRGFC+ZesNuTfn0ThvEC72N0krk=", + version = "v0.1.1-0.20220403145359-8e850b710d6d", + ) + go_repository( + name = "com_github_dgrijalva_jwt_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/dgrijalva/jwt-go", + replace = "github.com/form3tech-oss/jwt-go", + sum = "h1:0sWoh2EtO7UrQdNTAN+hnU3QXa4AoivplyPLLHkcrLk=", + version = "v3.2.6-0.20210809144907-32ab6a8243d7+incompatible", + ) + go_repository( + name = "com_github_dgryski_go_farm", + build_file_proto_mode = "disable_global", + importpath = "github.com/dgryski/go-farm", + sum = "h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=", + version = "v0.0.0-20200201041132-a6ae2369ad13", + ) + go_repository( + name = "com_github_dgryski_go_sip13", + build_file_proto_mode = "disable_global", + importpath = "github.com/dgryski/go-sip13", + sum = "h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4=", + version = "v0.0.0-20181026042036-e10d5fee7954", + ) + go_repository( + name = "com_github_dnaeon_go_vcr", + build_file_proto_mode = "disable_global", + importpath = "github.com/dnaeon/go-vcr", + sum = "h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_docker_go_units", + build_file_proto_mode = "disable_global", + importpath = "github.com/docker/go-units", + sum = "h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_dustin_go_humanize", + build_file_proto_mode = "disable_global", + importpath = "github.com/dustin/go-humanize", + sum = "h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_eapache_go_resiliency", + build_file_proto_mode = "disable_global", + importpath = "github.com/eapache/go-resiliency", + sum = "h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_eapache_go_xerial_snappy", + build_file_proto_mode = "disable_global", + importpath = "github.com/eapache/go-xerial-snappy", + sum = "h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=", + version = "v0.0.0-20180814174437-776d5712da21", + ) + go_repository( + name = "com_github_eapache_queue", + build_file_proto_mode = "disable_global", + importpath = "github.com/eapache/queue", + sum = "h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_eknkc_amber", + build_file_proto_mode = "disable_global", + importpath = "github.com/eknkc/amber", + sum = "h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o=", + version = "v0.0.0-20171010120322-cdade1c07385", + ) + go_repository( + name = "com_github_envoyproxy_go_control_plane", + build_file_proto_mode = "disable_global", + importpath = "github.com/envoyproxy/go-control-plane", + sum = "h1:fP+fF0up6oPY49OrjPrhIJ8yQfdIM85NXMLkMg1EXVs=", + version = "v0.9.10-0.20210907150352-cf90f659a021", + ) + go_repository( + name = "com_github_envoyproxy_protoc_gen_validate", + build_file_proto_mode = "disable_global", + importpath = "github.com/envoyproxy/protoc-gen-validate", + sum = "h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_etcd_io_bbolt", + build_file_proto_mode = "disable_global", + importpath = "github.com/etcd-io/bbolt", + sum = "h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM=", + version = "v1.3.3", + ) + go_repository( + name = "com_github_etcd_io_gofail", + build_file_proto_mode = "disable_global", + importpath = "github.com/etcd-io/gofail", + sum = "h1:Y2I0lxOttdUKz+hNaIdG3FtjuQrTmwXun1opRV65IZc=", + version = "v0.0.0-20190801230047-ad7f989257ca", + ) + go_repository( + name = "com_github_fasthttp_contrib_websocket", + build_file_proto_mode = "disable_global", + importpath = "github.com/fasthttp-contrib/websocket", + sum = "h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc=", + version = "v0.0.0-20160511215533-1f3b11f56072", + ) + go_repository( + name = "com_github_fatih_color", + build_file_proto_mode = "disable_global", + importpath = "github.com/fatih/color", + sum = "h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=", + version = "v1.13.0", + ) + go_repository( + name = "com_github_fatih_structs", + build_file_proto_mode = "disable_global", + importpath = "github.com/fatih/structs", + sum = "h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_felixge_httpsnoop", + build_file_proto_mode = "disable_global", + importpath = "github.com/felixge/httpsnoop", + sum = "h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_flosch_pongo2", + build_file_proto_mode = "disable_global", + importpath = "github.com/flosch/pongo2", + sum = "h1:GY1+t5Dr9OKADM64SYnQjw/w99HMYvQ0A8/JoUkxVmc=", + version = "v0.0.0-20190707114632-bbf5a6c351f4", + ) + go_repository( + name = "com_github_fogleman_gg", + build_file_proto_mode = "disable_global", + importpath = "github.com/fogleman/gg", + sum = "h1:WXb3TSNmHp2vHoCroCIB1foO/yQ36swABL8aOVeDpgg=", + version = "v1.2.1-0.20190220221249-0403632d5b90", + ) + go_repository( + name = "com_github_form3tech_oss_jwt_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/form3tech-oss/jwt-go", + sum = "h1:/l4kBbb4/vGSsdtB5nUe8L7B9mImVMaBPw9L/0TBHU8=", + version = "v3.2.5+incompatible", + ) + go_repository( + name = "com_github_fortytw2_leaktest", + build_file_proto_mode = "disable_global", + importpath = "github.com/fortytw2/leaktest", + sum = "h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_frankban_quicktest", + build_file_proto_mode = "disable_global", + importpath = "github.com/frankban/quicktest", + sum = "h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY=", + version = "v1.11.3", + ) + go_repository( + name = "com_github_fsnotify_fsnotify", + build_file_proto_mode = "disable_global", + importpath = "github.com/fsnotify/fsnotify", + sum = "h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=", + version = "v1.5.1", + ) + go_repository( + name = "com_github_fsouza_fake_gcs_server", + build_file_proto_mode = "disable_global", + importpath = "github.com/fsouza/fake-gcs-server", + sum = "h1:XyaGOlqo+R5sjT03x2ymk0xepaQlgwhRLTT2IopW0zA=", + version = "v1.19.0", + ) + go_repository( + name = "com_github_fzipp_gocyclo", + build_file_proto_mode = "disable_global", + importpath = "github.com/fzipp/gocyclo", + sum = "h1:A9UeX3HJSXTBzvHzhqoYVuE0eAhe+aM8XBCCwsPMZOc=", + version = "v0.3.1", + ) + go_repository( + name = "com_github_gavv_httpexpect", + build_file_proto_mode = "disable_global", + importpath = "github.com/gavv/httpexpect", + sum = "h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8=", + version = "v2.0.0+incompatible", + ) + go_repository( + name = "com_github_getsentry_raven_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/getsentry/raven-go", + sum = "h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_ghemawat_stream", + build_file_proto_mode = "disable_global", + importpath = "github.com/ghemawat/stream", + sum = "h1:r5GgOLGbza2wVHRzK7aAj6lWZjfbAwiu/RDCVOKjRyM=", + version = "v0.0.0-20171120220530-696b145b53b9", + ) + go_repository( + name = "com_github_ghodss_yaml", + build_file_proto_mode = "disable_global", + importpath = "github.com/ghodss/yaml", + sum = "h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_gin_contrib_sse", + build_file_proto_mode = "disable_global", + importpath = "github.com/gin-contrib/sse", + sum = "h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g=", + version = "v0.0.0-20190301062529-5545eab6dad3", + ) + go_repository( + name = "com_github_gin_gonic_gin", + build_file_proto_mode = "disable_global", + importpath = "github.com/gin-gonic/gin", + sum = "h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ=", + version = "v1.4.0", + ) + go_repository( + name = "com_github_go_check_check", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-check/check", + sum = "h1:0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI=", + version = "v0.0.0-20180628173108-788fd7840127", + ) + go_repository( + name = "com_github_go_errors_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-errors/errors", + sum = "h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_go_gl_glfw", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-gl/glfw", + sum = "h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0=", + version = "v0.0.0-20190409004039-e6da0acd62b1", + ) + go_repository( + name = "com_github_go_gl_glfw_v3_3_glfw", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-gl/glfw/v3.3/glfw", + sum = "h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I=", + version = "v0.0.0-20200222043503-6f7a984d4dc4", + ) + go_repository( + name = "com_github_go_kit_kit", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-kit/kit", + sum = "h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=", + version = "v0.9.0", + ) + go_repository( + name = "com_github_go_kit_log", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-kit/log", + sum = "h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_go_logfmt_logfmt", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-logfmt/logfmt", + sum = "h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=", + version = "v0.5.0", + ) + go_repository( + name = "com_github_go_martini_martini", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-martini/martini", + sum = "h1:xveKWz2iaueeTaUgdetzel+U7exyigDYBryyVfV/rZk=", + version = "v0.0.0-20170121215854-22fa46961aab", + ) + go_repository( + name = "com_github_go_ole_go_ole", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-ole/go-ole", + sum = "h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=", + version = "v1.2.6", + ) + go_repository( + name = "com_github_go_sql_driver_mysql", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-sql-driver/mysql", + sum = "h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_go_stack_stack", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-stack/stack", + sum = "h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_go_task_slim_sprig", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-task/slim-sprig", + sum = "h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=", + version = "v0.0.0-20210107165309-348f09dbbbc0", + ) + go_repository( + name = "com_github_gobwas_httphead", + build_file_proto_mode = "disable_global", + importpath = "github.com/gobwas/httphead", + sum = "h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=", + version = "v0.0.0-20180130184737-2c6c146eadee", + ) + go_repository( + name = "com_github_gobwas_pool", + build_file_proto_mode = "disable_global", + importpath = "github.com/gobwas/pool", + sum = "h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_gobwas_ws", + build_file_proto_mode = "disable_global", + importpath = "github.com/gobwas/ws", + sum = "h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_godbus_dbus_v5", + build_file_proto_mode = "disable_global", + importpath = "github.com/godbus/dbus/v5", + sum = "h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA=", + version = "v5.0.4", + ) + go_repository( + name = "com_github_gogo_googleapis", + build_file_proto_mode = "disable_global", + importpath = "github.com/gogo/googleapis", + sum = "h1:dR8+Q0uO5S2ZBcs2IH6VBKYwSxPo2vYCYq0ot0mu7xA=", + version = "v0.0.0-20180223154316-0cd9801be74a", + ) + go_repository( + name = "com_github_gogo_protobuf", + build_file_proto_mode = "disable_global", + importpath = "github.com/gogo/protobuf", + sum = "h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=", + version = "v1.3.2", + ) + go_repository( + name = "com_github_gogo_status", + build_file_proto_mode = "disable_global", + importpath = "github.com/gogo/status", + sum = "h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_goji_httpauth", + build_file_proto_mode = "disable", + importpath = "github.com/goji/httpauth", + sum = "h1:lBXNCxVENCipq4D1Is42JVOP4eQjlB8TQ6H69Yx5J9Q=", + version = "v0.0.0-20160601135302-2da839ab0f4d", + ) + + go_repository( + name = "com_github_golang_freetype", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/freetype", + sum = "h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=", + version = "v0.0.0-20170609003504-e2365dfdc4a0", + ) + go_repository( + name = "com_github_golang_glog", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/glog", + sum = "h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_golang_groupcache", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/groupcache", + sum = "h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=", + version = "v0.0.0-20210331224755-41bb18bfe9da", + ) + go_repository( + name = "com_github_golang_mock", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/mock", + sum = "h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_golang_protobuf", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/protobuf", + patch_args = ["-p1"], + patches = [ + "//build/patches:com_github_golang_protobuf.patch", + ], + sum = "h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=", + version = "v1.5.2", + ) + go_repository( + name = "com_github_golang_snappy", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/snappy", + sum = "h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=", + version = "v0.0.4", + ) + go_repository( + name = "com_github_gomodule_redigo", + build_file_proto_mode = "disable_global", + importpath = "github.com/gomodule/redigo", + sum = "h1:y0Wmhvml7cGnzPa9nocn/fMraMH/lMDdeG+rkx4VgYY=", + version = "v1.7.1-0.20190724094224-574c33c3df38", + ) + go_repository( + name = "com_github_google_btree", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/btree", + sum = "h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_google_go_cmp", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/go-cmp", + sum = "h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=", + version = "v0.5.7", + ) + go_repository( + name = "com_github_google_go_querystring", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/go-querystring", + sum = "h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_google_gofuzz", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/gofuzz", + sum = "h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_google_martian", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/martian", + sum = "h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=", + version = "v2.1.0+incompatible", + ) + go_repository( + name = "com_github_google_martian_v3", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/martian/v3", + sum = "h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ=", + version = "v3.2.1", + ) + go_repository( + name = "com_github_google_pprof", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/pprof", + sum = "h1:c8EUapQFi+kjzedr4c6WqbwMdmB95+oDBWZ5XFHFYxY=", + version = "v0.0.0-20211122183932-1daafda22083", + ) + go_repository( + name = "com_github_google_renameio", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/renameio", + sum = "h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_google_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/uuid", + sum = "h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=", + version = "v1.1.2", + ) + go_repository( + name = "com_github_googleapis_gax_go_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/googleapis/gax-go/v2", + sum = "h1:dp3bWCh+PPO1zjRRiCSczJav13sBvG4UhNyVTa1KqdU=", + version = "v2.1.1", + ) + go_repository( + name = "com_github_gopherjs_gopherjs", + build_file_proto_mode = "disable_global", + importpath = "github.com/gopherjs/gopherjs", + sum = "h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=", + version = "v0.0.0-20181017120253-0766667cb4d1", + ) + go_repository( + name = "com_github_gorilla_handlers", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/handlers", + sum = "h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=", + version = "v1.5.1", + ) + go_repository( + name = "com_github_gorilla_mux", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/mux", + sum = "h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_gorilla_securecookie", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/securecookie", + sum = "h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_gorilla_sessions", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/sessions", + sum = "h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=", + version = "v1.2.1", + ) + go_repository( + name = "com_github_gorilla_websocket", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/websocket", + sum = "h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=", + version = "v1.4.2", + ) + go_repository( + name = "com_github_grpc_ecosystem_go_grpc_middleware", + build_file_proto_mode = "disable_global", + importpath = "github.com/grpc-ecosystem/go-grpc-middleware", + sum = "h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_grpc_ecosystem_go_grpc_prometheus", + build_file_proto_mode = "disable_global", + importpath = "github.com/grpc-ecosystem/go-grpc-prometheus", + sum = "h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_grpc_ecosystem_grpc_gateway", + build_file_proto_mode = "disable_global", + build_naming_convention = "go_default_library", + importpath = "github.com/grpc-ecosystem/grpc-gateway", + patch_args = ["-p1"], + patches = [ + "//build/patches:com_github_grpc_ecosystem_grpc_gateway.patch", + ], + sum = "h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=", + version = "v1.16.0", + ) + go_repository( + name = "com_github_hashicorp_consul_api", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/consul/api", + sum = "h1:BNQPM9ytxj6jbjjdRPioQ94T6YXriSopn0i8COv6SRA=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_hashicorp_consul_sdk", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/consul/sdk", + sum = "h1:LnuDWGNsoajlhGyHJvuWW6FVqRl8JOTPqS6CPTsYjhY=", + version = "v0.1.1", + ) + go_repository( + name = "com_github_hashicorp_errwrap", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/errwrap", + sum = "h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_go_cleanhttp", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-cleanhttp", + sum = "h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM=", + version = "v0.5.1", + ) + go_repository( + name = "com_github_hashicorp_go_immutable_radix", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-immutable-radix", + sum = "h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_go_msgpack", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-msgpack", + sum = "h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4=", + version = "v0.5.3", + ) + go_repository( + name = "com_github_hashicorp_go_multierror", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-multierror", + sum = "h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_go_net", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go.net", + sum = "h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw=", + version = "v0.0.1", + ) + go_repository( + name = "com_github_hashicorp_go_rootcerts", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-rootcerts", + sum = "h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_go_sockaddr", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-sockaddr", + sum = "h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_go_syslog", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-syslog", + sum = "h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_go_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-uuid", + sum = "h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_hashicorp_go_version", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-version", + sum = "h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_hashicorp_golang_lru", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/golang-lru", + sum = "h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=", + version = "v0.5.1", + ) + go_repository( + name = "com_github_hashicorp_hcl", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/hcl", + sum = "h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_logutils", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/logutils", + sum = "h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_mdns", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/mdns", + sum = "h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hashicorp_memberlist", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/memberlist", + sum = "h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M=", + version = "v0.1.3", + ) + go_repository( + name = "com_github_hashicorp_serf", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/serf", + sum = "h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0=", + version = "v0.8.2", + ) + go_repository( + name = "com_github_hdrhistogram_hdrhistogram_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/HdrHistogram/hdrhistogram-go", + sum = "h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM=", + version = "v1.1.2", + ) + go_repository( + name = "com_github_hpcloud_tail", + build_file_proto_mode = "disable_global", + importpath = "github.com/hpcloud/tail", + sum = "h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hydrogen18_memlistener", + build_file_proto_mode = "disable_global", + importpath = "github.com/hydrogen18/memlistener", + sum = "h1:EPRgaDqXpLFUJLXZdGLnBTy1l6CLiNAPnvn2l+kHit0=", + version = "v0.0.0-20141126152155-54553eb933fb", + ) + go_repository( + name = "com_github_iancoleman_strcase", + build_file_proto_mode = "disable_global", + importpath = "github.com/iancoleman/strcase", + sum = "h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_ianlancetaylor_demangle", + build_file_proto_mode = "disable_global", + importpath = "github.com/ianlancetaylor/demangle", + sum = "h1:uGg2frlt3IcT7kbV6LEp5ONv4vmoO2FW4qSO+my/aoM=", + version = "v0.0.0-20210905161508-09a460cdf81d", + ) + go_repository( + name = "com_github_imkira_go_interpol", + build_file_proto_mode = "disable_global", + importpath = "github.com/imkira/go-interpol", + sum = "h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_inconshreveable_mousetrap", + build_file_proto_mode = "disable_global", + importpath = "github.com/inconshreveable/mousetrap", + sum = "h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_iris_contrib_blackfriday", + build_file_proto_mode = "disable_global", + importpath = "github.com/iris-contrib/blackfriday", + sum = "h1:o5sHQHHm0ToHUlAJSTjW9UWicjJSDDauOOQ2AHuIVp4=", + version = "v2.0.0+incompatible", + ) + go_repository( + name = "com_github_iris_contrib_go_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/iris-contrib/go.uuid", + sum = "h1:XZubAYg61/JwnJNbZilGjf3b3pB80+OQg2qf6c8BfWE=", + version = "v2.0.0+incompatible", + ) + go_repository( + name = "com_github_iris_contrib_i18n", + build_file_proto_mode = "disable_global", + importpath = "github.com/iris-contrib/i18n", + sum = "h1:Kyp9KiXwsyZRTeoNjgVCrWks7D8ht9+kg6yCjh8K97o=", + version = "v0.0.0-20171121225848-987a633949d0", + ) + go_repository( + name = "com_github_iris_contrib_schema", + build_file_proto_mode = "disable_global", + importpath = "github.com/iris-contrib/schema", + sum = "h1:10g/WnoRR+U+XXHWKBHeNy/+tZmM2kcAVGLOsz+yaDA=", + version = "v0.0.1", + ) + go_repository( + name = "com_github_jcmturner_aescts_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/aescts/v2", + sum = "h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_jcmturner_dnsutils_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/dnsutils/v2", + sum = "h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_jcmturner_gofork", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/gofork", + sum = "h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_jcmturner_goidentity_v6", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/goidentity/v6", + sum = "h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o=", + version = "v6.0.1", + ) + go_repository( + name = "com_github_jcmturner_gokrb5_v8", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/gokrb5/v8", + sum = "h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA=", + version = "v8.4.2", + ) + go_repository( + name = "com_github_jcmturner_rpc_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/rpc/v2", + sum = "h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=", + version = "v2.0.3", + ) + go_repository( + name = "com_github_jedib0t_go_pretty_v6", + build_file_proto_mode = "disable_global", + importpath = "github.com/jedib0t/go-pretty/v6", + sum = "h1:o3McN0rQ4X+IU+HduppSp9TwRdGLRW2rhJXy9CJaCRw=", + version = "v6.2.2", + ) + go_repository( + name = "com_github_jeffail_gabs_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/Jeffail/gabs/v2", + sum = "h1:ANfZYjpMlfTTKebycu4X1AgkVWumFVDYQl7JwOr4mDk=", + version = "v2.5.1", + ) + go_repository( + name = "com_github_jmespath_go_jmespath", + build_file_proto_mode = "disable_global", + importpath = "github.com/jmespath/go-jmespath", + sum = "h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_jmespath_go_jmespath_internal_testify", + build_file_proto_mode = "disable_global", + importpath = "github.com/jmespath/go-jmespath/internal/testify", + sum = "h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=", + version = "v1.5.1", + ) + go_repository( + name = "com_github_joho_sqltocsv", + build_file_proto_mode = "disable_global", + importpath = "github.com/joho/sqltocsv", + sum = "h1:Zrb0IbuLOGHL7nrO2WrcuNWgDTlzFv3zY69QMx4ggQE=", + version = "v0.0.0-20210428211105-a6d6801d59df", + ) + go_repository( + name = "com_github_joker_hpp", + build_file_proto_mode = "disable_global", + importpath = "github.com/Joker/hpp", + sum = "h1:65+iuJYdRXv/XyN62C1uEmmOx3432rNG/rKlX6V7Kkc=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_joker_jade", + build_file_proto_mode = "disable_global", + importpath = "github.com/Joker/jade", + sum = "h1:mreN1m/5VJ/Zc3b4pzj9qU6D9SRQ6Vm+3KfI328t3S8=", + version = "v1.0.1-0.20190614124447-d475f43051e7", + ) + go_repository( + name = "com_github_jonboulle_clockwork", + build_file_proto_mode = "disable_global", + importpath = "github.com/jonboulle/clockwork", + sum = "h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=", + version = "v0.2.2", + ) + go_repository( + name = "com_github_jpillora_backoff", + build_file_proto_mode = "disable_global", + importpath = "github.com/jpillora/backoff", + sum = "h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_json_iterator_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/json-iterator/go", + sum = "h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=", + version = "v1.1.12", + ) + go_repository( + name = "com_github_jstemmer_go_junit_report", + build_file_proto_mode = "disable_global", + importpath = "github.com/jstemmer/go-junit-report", + sum = "h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=", + version = "v0.9.1", + ) + go_repository( + name = "com_github_jtolds_gls", + build_file_proto_mode = "disable_global", + importpath = "github.com/jtolds/gls", + sum = "h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=", + version = "v4.20.0+incompatible", + ) + go_repository( + name = "com_github_juju_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/juju/errors", + sum = "h1:rhqTjzJlm7EbkELJDKMTU7udov+Se0xZkWmugr6zGok=", + version = "v0.0.0-20181118221551-089d3ea4e4d5", + ) + go_repository( + name = "com_github_juju_loggo", + build_file_proto_mode = "disable_global", + importpath = "github.com/juju/loggo", + sum = "h1:MK144iBQF9hTSwBW/9eJm034bVoG30IshVm688T2hi8=", + version = "v0.0.0-20180524022052-584905176618", + ) + go_repository( + name = "com_github_juju_testing", + build_file_proto_mode = "disable_global", + importpath = "github.com/juju/testing", + sum = "h1:WQM1NildKThwdP7qWrNAFGzp4ijNLw8RlgENkaI4MJs=", + version = "v0.0.0-20180920084828-472a3e8b2073", + ) + go_repository( + name = "com_github_julienschmidt_httprouter", + build_file_proto_mode = "disable_global", + importpath = "github.com/julienschmidt/httprouter", + sum = "h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_jung_kurt_gofpdf", + build_file_proto_mode = "disable_global", + importpath = "github.com/jung-kurt/gofpdf", + sum = "h1:PJr+ZMXIecYc1Ey2zucXdR73SMBtgjPgwa31099IMv0=", + version = "v1.0.3-0.20190309125859-24315acbbda5", + ) + go_repository( + name = "com_github_k0kubun_colorstring", + build_file_proto_mode = "disable_global", + importpath = "github.com/k0kubun/colorstring", + sum = "h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM=", + version = "v0.0.0-20150214042306-9440f1994b88", + ) + go_repository( + name = "com_github_kataras_golog", + build_file_proto_mode = "disable_global", + importpath = "github.com/kataras/golog", + sum = "h1:J7Dl82843nbKQDrQM/abbNJZvQjS6PfmkkffhOTXEpM=", + version = "v0.0.9", + ) + go_repository( + name = "com_github_kataras_iris_v12", + build_file_proto_mode = "disable_global", + importpath = "github.com/kataras/iris/v12", + sum = "h1:Wo5S7GMWv5OAzJmvFTvss/C4TS1W0uo6LkDlSymT4rM=", + version = "v12.0.1", + ) + go_repository( + name = "com_github_kataras_neffos", + build_file_proto_mode = "disable_global", + importpath = "github.com/kataras/neffos", + sum = "h1:O06dvQlxjdWvzWbm2Bq+Si6psUhvSmEctAMk9Xujqms=", + version = "v0.0.10", + ) + go_repository( + name = "com_github_kataras_pio", + build_file_proto_mode = "disable_global", + importpath = "github.com/kataras/pio", + sum = "h1:V5Rs9ztEWdp58oayPq/ulmlqJJZeJP6pP79uP3qjcao=", + version = "v0.0.0-20190103105442-ea782b38602d", + ) + go_repository( + name = "com_github_kisielk_errcheck", + build_file_proto_mode = "disable_global", + importpath = "github.com/kisielk/errcheck", + sum = "h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_kisielk_gotool", + build_file_proto_mode = "disable_global", + importpath = "github.com/kisielk/gotool", + sum = "h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_klauspost_compress", + build_file_proto_mode = "disable_global", + importpath = "github.com/klauspost/compress", + sum = "h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A=", + version = "v1.15.1", + ) + go_repository( + name = "com_github_klauspost_cpuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/klauspost/cpuid", + sum = "h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s=", + version = "v1.3.1", + ) + go_repository( + name = "com_github_konsorten_go_windows_terminal_sequences", + build_file_proto_mode = "disable_global", + importpath = "github.com/konsorten/go-windows-terminal-sequences", + sum = "h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=", + version = "v1.0.3", + ) + go_repository( + name = "com_github_kr_logfmt", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/logfmt", + sum = "h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=", + version = "v0.0.0-20140226030751-b84e30acd515", + ) + go_repository( + name = "com_github_kr_pretty", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/pretty", + sum = "h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_kr_pty", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/pty", + sum = "h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_kr_text", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/text", + sum = "h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_labstack_echo_v4", + build_file_proto_mode = "disable_global", + importpath = "github.com/labstack/echo/v4", + sum = "h1:z0BZoArY4FqdpUEl+wlHp4hnr/oSR6MTmQmv8OHSoww=", + version = "v4.1.11", + ) + go_repository( + name = "com_github_labstack_gommon", + build_file_proto_mode = "disable_global", + importpath = "github.com/labstack/gommon", + sum = "h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_lufia_plan9stats", + build_file_proto_mode = "disable_global", + importpath = "github.com/lufia/plan9stats", + sum = "h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=", + version = "v0.0.0-20211012122336-39d0f177ccd0", + ) + go_repository( + name = "com_github_magiconair_properties", + build_file_proto_mode = "disable_global", + importpath = "github.com/magiconair/properties", + sum = "h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=", + version = "v1.8.1", + ) + go_repository( + name = "com_github_mattn_go_colorable", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-colorable", + sum = "h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=", + version = "v0.1.12", + ) + go_repository( + name = "com_github_mattn_go_isatty", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-isatty", + sum = "h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=", + version = "v0.0.14", + ) + go_repository( + name = "com_github_mattn_go_runewidth", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-runewidth", + sum = "h1:Y41i/hVW3Pgwr8gV+J23B9YEY0zxjptBuCWEaxmAOow=", + version = "v0.0.12", + ) + go_repository( + name = "com_github_mattn_goveralls", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/goveralls", + sum = "h1:7eJB6EqsPhRVxvwEXGnqdO2sJI0PTsrWoTMXEk9/OQc=", + version = "v0.0.2", + ) + go_repository( + name = "com_github_matttproud_golang_protobuf_extensions", + build_file_proto_mode = "disable_global", + importpath = "github.com/matttproud/golang_protobuf_extensions", + sum = "h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_mediocregopher_mediocre_go_lib", + build_file_proto_mode = "disable_global", + importpath = "github.com/mediocregopher/mediocre-go-lib", + sum = "h1:3dQJqqDouawQgl3gBE1PNHKFkJYGEuFb1DbSlaxdosE=", + version = "v0.0.0-20181029021733-cb65787f37ed", + ) + go_repository( + name = "com_github_mediocregopher_radix_v3", + build_file_proto_mode = "disable_global", + importpath = "github.com/mediocregopher/radix/v3", + sum = "h1:oacPXPKHJg0hcngVVrdtTnfGJiS+PtwoQwTBZGFlV4k=", + version = "v3.3.0", + ) + go_repository( + name = "com_github_microcosm_cc_bluemonday", + build_file_proto_mode = "disable_global", + importpath = "github.com/microcosm-cc/bluemonday", + sum = "h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_miekg_dns", + build_file_proto_mode = "disable_global", + importpath = "github.com/miekg/dns", + sum = "h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA=", + version = "v1.0.14", + ) + go_repository( + name = "com_github_mitchellh_cli", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/cli", + sum = "h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_mitchellh_go_homedir", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/go-homedir", + sum = "h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_mitchellh_go_testing_interface", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/go-testing-interface", + sum = "h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_mitchellh_gox", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/gox", + sum = "h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_mitchellh_iochan", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/iochan", + sum = "h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_mitchellh_mapstructure", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/mapstructure", + sum = "h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=", + version = "v1.1.2", + ) + go_repository( + name = "com_github_modern_go_concurrent", + build_file_proto_mode = "disable_global", + importpath = "github.com/modern-go/concurrent", + sum = "h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=", + version = "v0.0.0-20180306012644-bacd9c7ef1dd", + ) + go_repository( + name = "com_github_modern_go_reflect2", + build_file_proto_mode = "disable_global", + importpath = "github.com/modern-go/reflect2", + sum = "h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_modocache_gover", + build_file_proto_mode = "disable_global", + importpath = "github.com/modocache/gover", + sum = "h1:8Q0qkMVC/MmWkpIdlvZgcv2o2jrlF6zqVOh7W5YHdMA=", + version = "v0.0.0-20171022184752-b58185e213c5", + ) + go_repository( + name = "com_github_moul_http2curl", + build_file_proto_mode = "disable_global", + importpath = "github.com/moul/http2curl", + sum = "h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_mwitkow_go_conntrack", + build_file_proto_mode = "disable_global", + importpath = "github.com/mwitkow/go-conntrack", + sum = "h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=", + version = "v0.0.0-20190716064945-2f068394615f", + ) + go_repository( + name = "com_github_nats_io_nats_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/nats-io/nats.go", + sum = "h1:6lF/f1/NN6kzUDBz6pyvQDEXO39jqXcWRLu/tKjtOUQ=", + version = "v1.8.1", + ) + go_repository( + name = "com_github_nats_io_nkeys", + build_file_proto_mode = "disable_global", + importpath = "github.com/nats-io/nkeys", + sum = "h1:+qM7QpgXnvDDixitZtQUBDY9w/s9mu1ghS+JIbsrx6M=", + version = "v0.0.2", + ) + go_repository( + name = "com_github_nats_io_nuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/nats-io/nuid", + sum = "h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_ncw_directio", + build_file_proto_mode = "disable_global", + importpath = "github.com/ncw/directio", + sum = "h1:JSUBhdjEvVaJvOoyPAbcW0fnd0tvRXD76wEfZ1KcQz4=", + version = "v1.0.5", + ) + go_repository( + name = "com_github_ngaut_pools", + build_file_proto_mode = "disable_global", + importpath = "github.com/ngaut/pools", + sum = "h1:7KAv7KMGTTqSmYZtNdcNTgsos+vFzULLwyElndwn+5c=", + version = "v0.0.0-20180318154953-b7bc8c42aac7", + ) + go_repository( + name = "com_github_ngaut_sync2", + build_file_proto_mode = "disable_global", + importpath = "github.com/ngaut/sync2", + sum = "h1:K0Fn+DoFqNqktdZtdV3bPQ/0cuYh2H4rkg0tytX/07k=", + version = "v0.0.0-20141008032647-7a24ed77b2ef", + ) + go_repository( + name = "com_github_niemeyer_pretty", + build_file_proto_mode = "disable_global", + importpath = "github.com/niemeyer/pretty", + sum = "h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=", + version = "v0.0.0-20200227124842-a10e7caefd8e", + ) + go_repository( + name = "com_github_nxadm_tail", + build_file_proto_mode = "disable_global", + importpath = "github.com/nxadm/tail", + sum = "h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=", + version = "v1.4.8", + ) + go_repository( + name = "com_github_oklog_ulid", + build_file_proto_mode = "disable_global", + importpath = "github.com/oklog/ulid", + sum = "h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=", + version = "v1.3.1", + ) + go_repository( + name = "com_github_olekukonko_tablewriter", + build_file_proto_mode = "disable_global", + importpath = "github.com/olekukonko/tablewriter", + sum = "h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=", + version = "v0.0.5", + ) + go_repository( + name = "com_github_oneofone_xxhash", + build_file_proto_mode = "disable_global", + importpath = "github.com/OneOfOne/xxhash", + sum = "h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=", + version = "v1.2.2", + ) + go_repository( + name = "com_github_onsi_ginkgo", + build_file_proto_mode = "disable_global", + importpath = "github.com/onsi/ginkgo", + sum = "h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=", + version = "v1.16.5", + ) + go_repository( + name = "com_github_onsi_ginkgo_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/onsi/ginkgo/v2", + sum = "h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_onsi_gomega", + build_file_proto_mode = "disable_global", + importpath = "github.com/onsi/gomega", + sum = "h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=", + version = "v1.18.1", + ) + go_repository( + name = "com_github_opentracing_basictracer_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/opentracing/basictracer-go", + sum = "h1:YyUAhaEfjoWXclZVJ9sGoNct7j4TVk7lZWlQw5UXuoo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_opentracing_opentracing_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/opentracing/opentracing-go", + sum = "h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_pascaldekloe_goe", + build_file_proto_mode = "disable_global", + importpath = "github.com/pascaldekloe/goe", + sum = "h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs=", + version = "v0.0.0-20180627143212-57f6aae5913c", + ) + go_repository( + name = "com_github_pborman_getopt", + build_file_proto_mode = "disable_global", + importpath = "github.com/pborman/getopt", + sum = "h1:7822vZ646Atgxkp3tqrSufChvAAYgIy+iFEGpQntwlI=", + version = "v0.0.0-20180729010549-6fdd0a2c7117", + ) + go_repository( + name = "com_github_pelletier_go_toml", + build_file_proto_mode = "disable_global", + importpath = "github.com/pelletier/go-toml", + sum = "h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_phayes_freeport", + build_file_proto_mode = "disable_global", + importpath = "github.com/phayes/freeport", + sum = "h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc=", + version = "v0.0.0-20180830031419-95f893ade6f2", + ) + go_repository( + name = "com_github_pierrec_lz4", + build_file_proto_mode = "disable_global", + importpath = "github.com/pierrec/lz4", + sum = "h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=", + version = "v2.6.1+incompatible", + ) + go_repository( + name = "com_github_pingcap_badger", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/badger", + sum = "h1:MKVFZuqFvAMiDtv3AbihOQ6rY5IE8LWflI1BuZ/hF0Y=", + version = "v1.5.1-0.20220314162537-ab58fbf40580", + ) + go_repository( + name = "com_github_pingcap_check", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/check", + sum = "h1:HVl5539r48eA+uDuX/ziBmQCxzT1pGrzWbKuXT46Bq0=", + version = "v0.0.0-20211026125417-57bd13f7b5f0", + ) + go_repository( + name = "com_github_pingcap_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/errors", + sum = "h1:xpW9bvK+HuuTmyFqUwr+jcCvpVkK7sumiz+ko5H9eq4=", + version = "v0.11.5-0.20211224045212-9687c2b0f87c", + ) + go_repository( + name = "com_github_pingcap_failpoint", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/failpoint", + sum = "h1:kJolJWbyadVeL8RKBlqmXQR7FRKPsIeU85TUYyhbhiQ=", + version = "v0.0.0-20220423142525-ae43b7f4e5c3", + ) + go_repository( + name = "com_github_pingcap_fn", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/fn", + sum = "h1:Pe2LbxRmbTfAoKJ65bZLmhahmvHm7n9DUxGRQT00208=", + version = "v0.0.0-20200306044125-d5540d389059", + ) + go_repository( + name = "com_github_pingcap_goleveldb", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/goleveldb", + sum = "h1:surzm05a8C9dN8dIUmo4Be2+pMRb6f55i+UIYrluu2E=", + version = "v0.0.0-20191226122134-f82aafb29989", + ) + go_repository( + name = "com_github_pingcap_kvproto", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/kvproto", + sum = "h1:dsMpneacHyuVslSVndgUfJKrXFNG7VPdXip2ulG6glo=", + version = "v0.0.0-20220517085838-12e2f5a9d167", + ) + go_repository( + name = "com_github_pingcap_log", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/log", + sum = "h1:ELiPxACz7vdo1qAvvaWJg1NrYFoY6gqAh/+Uo6aXdD8=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_pingcap_sysutil", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/sysutil", + sum = "h1:HYbcxtnkN3s5tqrZ/z3eJS4j3Db8wMphEm1q10lY/TM=", + version = "v0.0.0-20220114020952-ea68d2dbf5b4", + ) + go_repository( + name = "com_github_pingcap_tipb", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/tipb", + sum = "h1:+46isFI9fR9R+nJVDMI55tCC/TCwp+bvVA4HLGEv1rY=", + version = "v0.0.0-20220314125451-bfb5c2c55188", + ) + go_repository( + name = "com_github_pkg_browser", + build_file_proto_mode = "disable_global", + importpath = "github.com/pkg/browser", + sum = "h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98=", + version = "v0.0.0-20180916011732-0a3d74bf9ce4", + ) + go_repository( + name = "com_github_pkg_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/pkg/errors", + sum = "h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=", + version = "v0.9.1", + ) + go_repository( + name = "com_github_pkg_profile", + build_file_proto_mode = "disable_global", + importpath = "github.com/pkg/profile", + sum = "h1:F++O52m40owAmADcojzM+9gyjmMOY/T4oYJkgFDH8RE=", + version = "v1.2.1", + ) + go_repository( + name = "com_github_pmezard_go_difflib", + build_file_proto_mode = "disable_global", + importpath = "github.com/pmezard/go-difflib", + sum = "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_posener_complete", + build_file_proto_mode = "disable_global", + importpath = "github.com/posener/complete", + sum = "h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_power_devops_perfstat", + build_file_proto_mode = "disable_global", + importpath = "github.com/power-devops/perfstat", + sum = "h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=", + version = "v0.0.0-20210106213030-5aafc221ea8c", + ) + go_repository( + name = "com_github_prometheus_client_golang", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/client_golang", + sum = "h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34=", + version = "v1.12.2", + ) + go_repository( + name = "com_github_prometheus_client_model", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/client_model", + sum = "h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_prometheus_common", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/common", + sum = "h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4=", + version = "v0.32.1", + ) + go_repository( + name = "com_github_prometheus_procfs", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/procfs", + sum = "h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=", + version = "v0.7.3", + ) + go_repository( + name = "com_github_prometheus_tsdb", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/tsdb", + sum = "h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA=", + version = "v0.7.1", + ) + go_repository( + name = "com_github_rcrowley_go_metrics", + build_file_proto_mode = "disable_global", + importpath = "github.com/rcrowley/go-metrics", + sum = "h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=", + version = "v0.0.0-20201227073835-cf1acfcdf475", + ) + go_repository( + name = "com_github_remyoudompheng_bigfft", + build_file_proto_mode = "disable_global", + importpath = "github.com/remyoudompheng/bigfft", + sum = "h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=", + version = "v0.0.0-20200410134404-eec4a21b6bb0", + ) + go_repository( + name = "com_github_rivo_uniseg", + build_file_proto_mode = "disable_global", + importpath = "github.com/rivo/uniseg", + sum = "h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_rogpeppe_fastuuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/rogpeppe/fastuuid", + sum = "h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_rogpeppe_go_internal", + build_file_proto_mode = "disable_global", + importpath = "github.com/rogpeppe/go-internal", + sum = "h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=", + version = "v1.6.1", + ) + go_repository( + name = "com_github_russross_blackfriday", + build_file_proto_mode = "disable_global", + importpath = "github.com/russross/blackfriday", + sum = "h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=", + version = "v1.5.2", + ) + go_repository( + name = "com_github_russross_blackfriday_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/russross/blackfriday/v2", + sum = "h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=", + version = "v2.1.0", + ) + go_repository( + name = "com_github_ryanuber_columnize", + build_file_proto_mode = "disable_global", + importpath = "github.com/ryanuber/columnize", + sum = "h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUWQxHW5TkBe7YUl+2s=", + version = "v2.1.0+incompatible", + ) + go_repository( + name = "com_github_sclevine_agouti", + build_file_proto_mode = "disable_global", + importpath = "github.com/sclevine/agouti", + sum = "h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4=", + version = "v3.0.0+incompatible", + ) + go_repository( + name = "com_github_sean_seed", + build_file_proto_mode = "disable_global", + importpath = "github.com/sean-/seed", + sum = "h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=", + version = "v0.0.0-20170313163322-e2103e2c3529", + ) + go_repository( + name = "com_github_sergi_go_diff", + build_file_proto_mode = "disable_global", + importpath = "github.com/sergi/go-diff", + sum = "h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_shirou_gopsutil_v3", + build_file_proto_mode = "disable_global", + importpath = "github.com/shirou/gopsutil/v3", + sum = "h1:VoGxEW2hpmz0Vt3wUvHIl9fquzYLNpVpgNNB7pGJimA=", + version = "v3.21.12", + ) + go_repository( + name = "com_github_shopify_goreferrer", + build_file_proto_mode = "disable_global", + importpath = "github.com/Shopify/goreferrer", + sum = "h1:WDC6ySpJzbxGWFh4aMxFFC28wwGp5pEuoTtvA4q/qQ4=", + version = "v0.0.0-20181106222321-ec9c9a553398", + ) + go_repository( + name = "com_github_shopify_sarama", + build_file_proto_mode = "disable_global", + importpath = "github.com/Shopify/sarama", + sum = "h1:ARid8o8oieau9XrHI55f/L3EoRAhm9px6sonbD7yuUE=", + version = "v1.29.0", + ) + go_repository( + name = "com_github_shopify_toxiproxy", + build_file_proto_mode = "disable_global", + importpath = "github.com/Shopify/toxiproxy", + sum = "h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=", + version = "v2.1.4+incompatible", + ) + go_repository( + name = "com_github_shurcool_httpfs", + build_file_proto_mode = "disable_global", + importpath = "github.com/shurcooL/httpfs", + sum = "h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk=", + version = "v0.0.0-20190707220628-8d4bc4ba7749", + ) + go_repository( + name = "com_github_shurcool_httpgzip", + build_file_proto_mode = "disable_global", + importpath = "github.com/shurcooL/httpgzip", + sum = "h1:mj/nMDAwTBiaCqMEs4cYCqF7pO6Np7vhy1D1wcQGz+E=", + version = "v0.0.0-20190720172056-320755c1c1b0", + ) + go_repository( + name = "com_github_shurcool_sanitized_anchor_name", + build_file_proto_mode = "disable_global", + importpath = "github.com/shurcooL/sanitized_anchor_name", + sum = "h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_shurcool_vfsgen", + build_file_proto_mode = "disable_global", + importpath = "github.com/shurcooL/vfsgen", + sum = "h1:pXY9qYc/MP5zdvqWEUH6SjNiu7VhSjuVFTFiTcphaLU=", + version = "v0.0.0-20200824052919-0d455de96546", + ) + go_repository( + name = "com_github_sirupsen_logrus", + build_file_proto_mode = "disable_global", + importpath = "github.com/sirupsen/logrus", + sum = "h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=", + version = "v1.8.1", + ) + go_repository( + name = "com_github_smartystreets_assertions", + build_file_proto_mode = "disable_global", + importpath = "github.com/smartystreets/assertions", + sum = "h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=", + version = "v0.0.0-20180927180507-b2de0cb4f26d", + ) + go_repository( + name = "com_github_smartystreets_goconvey", + build_file_proto_mode = "disable_global", + importpath = "github.com/smartystreets/goconvey", + sum = "h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=", + version = "v1.6.4", + ) + go_repository( + name = "com_github_soheilhy_cmux", + build_file_proto_mode = "disable_global", + importpath = "github.com/soheilhy/cmux", + sum = "h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=", + version = "v0.1.5", + ) + go_repository( + name = "com_github_spaolacci_murmur3", + build_file_proto_mode = "disable_global", + importpath = "github.com/spaolacci/murmur3", + sum = "h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=", + version = "v0.0.0-20180118202830-f09979ecbc72", + ) + go_repository( + name = "com_github_spf13_afero", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/afero", + sum = "h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=", + version = "v1.2.2", + ) + go_repository( + name = "com_github_spf13_cast", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/cast", + sum = "h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_spf13_cobra", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/cobra", + sum = "h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=", + version = "v1.4.0", + ) + go_repository( + name = "com_github_spf13_jwalterweatherman", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/jwalterweatherman", + sum = "h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_spf13_pflag", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/pflag", + sum = "h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=", + version = "v1.0.5", + ) + go_repository( + name = "com_github_spf13_viper", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/viper", + sum = "h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM=", + version = "v1.7.0", + ) + go_repository( + name = "com_github_stathat_consistent", + build_file_proto_mode = "disable", + importpath = "github.com/stathat/consistent", + sum = "h1:ZFJ1QTRn8npNBKW065raSZ8xfOqhpb8vLOkfp4CcL/U=", + version = "v1.0.0", + ) + + go_repository( + name = "com_github_stretchr_objx", + build_file_proto_mode = "disable_global", + importpath = "github.com/stretchr/objx", + sum = "h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=", + version = "v0.1.1", + ) + go_repository( + name = "com_github_stretchr_testify", + build_file_proto_mode = "disable_global", + importpath = "github.com/stretchr/testify", + sum = "h1:rh3VYpfvzXRbJ90ymx1yfhGl/wq8ac2m/cUbao61kwY=", + version = "v1.7.2-0.20220504104629-106ec21d14df", + ) + go_repository( + name = "com_github_subosito_gotenv", + build_file_proto_mode = "disable_global", + importpath = "github.com/subosito/gotenv", + sum = "h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_tiancaiamao_appdash", + build_file_proto_mode = "disable_global", + importpath = "github.com/tiancaiamao/appdash", + sum = "h1:mbAskLJ0oJfDRtkanvQPiooDH8HvJ2FBh+iKT/OmiQQ=", + version = "v0.0.0-20181126055449-889f96f722a2", + ) + go_repository( + name = "com_github_tikv_client_go_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/tikv/client-go/v2", + sum = "h1:KhOkCnqpxh/B2gGZdXSUyKgNRZaPzYsCIWGjNdrFmOA=", + version = "v2.0.1-0.20220531081749-2807409d4968", + ) + go_repository( + name = "com_github_tikv_pd_client", + build_file_proto_mode = "disable_global", + importpath = "github.com/tikv/pd/client", + sum = "h1:jxgmKOscXSjaFEKQGRyY5qOpK8hLqxs2irb/uDJMtwk=", + version = "v0.0.0-20220307081149-841fa61e9710", + ) + go_repository( + name = "com_github_tklauser_go_sysconf", + build_file_proto_mode = "disable_global", + importpath = "github.com/tklauser/go-sysconf", + sum = "h1:JeUVdAOWhhxVcU6Eqr/ATFHgXk/mmiItdKeJPev3vTo=", + version = "v0.3.9", + ) + go_repository( + name = "com_github_tklauser_numcpus", + build_file_proto_mode = "disable_global", + importpath = "github.com/tklauser/numcpus", + sum = "h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2biQ=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_tmc_grpc_websocket_proxy", + build_file_proto_mode = "disable_global", + importpath = "github.com/tmc/grpc-websocket-proxy", + sum = "h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA=", + version = "v0.0.0-20201229170055-e5319fda7802", + ) + go_repository( + name = "com_github_twmb_murmur3", + build_file_proto_mode = "disable_global", + importpath = "github.com/twmb/murmur3", + sum = "h1:D83U0XYKcHRYwYIpBKf3Pks91Z0Byda/9SJ8B6EMRcA=", + version = "v1.1.3", + ) + go_repository( + name = "com_github_uber_jaeger_client_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/uber/jaeger-client-go", + sum = "h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM=", + version = "v2.22.1+incompatible", + ) + go_repository( + name = "com_github_uber_jaeger_lib", + build_file_proto_mode = "disable_global", + importpath = "github.com/uber/jaeger-lib", + sum = "h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg=", + version = "v2.4.1+incompatible", + ) + go_repository( + name = "com_github_ugorji_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/ugorji/go", + sum = "h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw=", + version = "v1.1.4", + ) + go_repository( + name = "com_github_ugorji_go_codec", + build_file_proto_mode = "disable_global", + importpath = "github.com/ugorji/go/codec", + sum = "h1:3SVOIvH7Ae1KRYyQWRjXWJEA9sS/c/pjvH++55Gr648=", + version = "v0.0.0-20181204163529-d75b2dcb6bc8", + ) + go_repository( + name = "com_github_urfave_negroni", + build_file_proto_mode = "disable_global", + importpath = "github.com/urfave/negroni", + sum = "h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_valyala_bytebufferpool", + build_file_proto_mode = "disable_global", + importpath = "github.com/valyala/bytebufferpool", + sum = "h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_valyala_fasthttp", + build_file_proto_mode = "disable_global", + importpath = "github.com/valyala/fasthttp", + sum = "h1:uWF8lgKmeaIewWVPwi4GRq2P6+R46IgYZdxWtM+GtEY=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_valyala_fasttemplate", + build_file_proto_mode = "disable_global", + importpath = "github.com/valyala/fasttemplate", + sum = "h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_valyala_tcplisten", + build_file_proto_mode = "disable_global", + importpath = "github.com/valyala/tcplisten", + sum = "h1:0R4NLDRDZX6JcmhJgXi5E4b8Wg84ihbmUKp/GvSPEzc=", + version = "v0.0.0-20161114210144-ceec8f93295a", + ) + go_repository( + name = "com_github_vividcortex_ewma", + build_file_proto_mode = "disable_global", + importpath = "github.com/VividCortex/ewma", + sum = "h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_wangjohn_quickselect", + build_file_proto_mode = "disable_global", + importpath = "github.com/wangjohn/quickselect", + sum = "h1:9DDCDwOyEy/gId+IEMrFHLuQ5R/WV0KNxWLler8X2OY=", + version = "v0.0.0-20161129230411-ed8402a42d5f", + ) + go_repository( + name = "com_github_xdg_scram", + build_file_proto_mode = "disable_global", + importpath = "github.com/xdg/scram", + sum = "h1:nTadYh2Fs4BK2xdldEa2g5bbaZp0/+1nJMMPtPxS/to=", + version = "v1.0.3", + ) + go_repository( + name = "com_github_xdg_stringprep", + build_file_proto_mode = "disable_global", + importpath = "github.com/xdg/stringprep", + sum = "h1:cmL5Enob4W83ti/ZHuZLuKD/xqJfus4fVPwE+/BDm+4=", + version = "v1.0.3", + ) + go_repository( + name = "com_github_xeipuuv_gojsonpointer", + build_file_proto_mode = "disable_global", + importpath = "github.com/xeipuuv/gojsonpointer", + sum = "h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=", + version = "v0.0.0-20180127040702-4e3ac2762d5f", + ) + go_repository( + name = "com_github_xeipuuv_gojsonreference", + build_file_proto_mode = "disable_global", + importpath = "github.com/xeipuuv/gojsonreference", + sum = "h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=", + version = "v0.0.0-20180127040603-bd5ef7bd5415", + ) + go_repository( + name = "com_github_xeipuuv_gojsonschema", + build_file_proto_mode = "disable_global", + importpath = "github.com/xeipuuv/gojsonschema", + sum = "h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_xiang90_probing", + build_file_proto_mode = "disable_global", + importpath = "github.com/xiang90/probing", + sum = "h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=", + version = "v0.0.0-20190116061207-43a291ad63a2", + ) + go_repository( + name = "com_github_xitongsys_parquet_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/xitongsys/parquet-go", + sum = "h1:tBbuFCtyJNKT+BFAv6qjvTFpVdy97IYNaBwGUXifIUs=", + version = "v1.5.5-0.20201110004701-b09c49d6d457", + ) + go_repository( + name = "com_github_xitongsys_parquet_go_source", + build_file_proto_mode = "disable_global", + importpath = "github.com/xitongsys/parquet-go-source", + sum = "h1:a742S4V5A15F93smuVxA60LQWsrCnN8bKeWDBARU1/k=", + version = "v0.0.0-20200817004010-026bad9b25d0", + ) + go_repository( + name = "com_github_xordataexchange_crypt", + build_file_proto_mode = "disable_global", + importpath = "github.com/xordataexchange/crypt", + sum = "h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow=", + version = "v0.0.3-0.20170626215501-b2862e3d0a77", + ) + go_repository( + name = "com_github_yalp_jsonpath", + build_file_proto_mode = "disable_global", + importpath = "github.com/yalp/jsonpath", + sum = "h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY=", + version = "v0.0.0-20180802001716-5cc68e5049a0", + ) + go_repository( + name = "com_github_yudai_gojsondiff", + build_file_proto_mode = "disable_global", + importpath = "github.com/yudai/gojsondiff", + sum = "h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_yudai_golcs", + build_file_proto_mode = "disable_global", + importpath = "github.com/yudai/golcs", + sum = "h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=", + version = "v0.0.0-20170316035057-ecda9a501e82", + ) + go_repository( + name = "com_github_yudai_pp", + build_file_proto_mode = "disable_global", + importpath = "github.com/yudai/pp", + sum = "h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI=", + version = "v2.0.1+incompatible", + ) + go_repository( + name = "com_github_yuin_goldmark", + build_file_proto_mode = "disable_global", + importpath = "github.com/yuin/goldmark", + sum = "h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM=", + version = "v1.4.1", + ) + go_repository( + name = "com_github_yusufpapurcu_wmi", + build_file_proto_mode = "disable_global", + importpath = "github.com/yusufpapurcu/wmi", + sum = "h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=", + version = "v1.2.2", + ) + go_repository( + name = "com_google_cloud_go", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go", + sum = "h1:t9Iw5QH5v4XtlEQaCtUY7x6sCABps8sW0acw7e2WQ6Y=", + version = "v0.100.2", + ) + go_repository( + name = "com_google_cloud_go_bigquery", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/bigquery", + sum = "h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA=", + version = "v1.8.0", + ) + go_repository( + name = "com_google_cloud_go_compute", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/compute", + sum = "h1:EKki8sSdvDU0OO9mAXGwPXOTOgPz2l08R0/IutDH11I=", + version = "v1.2.0", + ) + go_repository( + name = "com_google_cloud_go_datastore", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/datastore", + sum = "h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ=", + version = "v1.1.0", + ) + go_repository( + name = "com_google_cloud_go_firestore", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/firestore", + sum = "h1:9x7Bx0A9R5/M9jibeJeZWqjeVEIxYW9fZYqB9a70/bY=", + version = "v1.1.0", + ) + go_repository( + name = "com_google_cloud_go_iam", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/iam", + sum = "h1:4CapQyNFjiksks1/x7jsvsygFPhihslYk5GptIrlX68=", + version = "v0.1.1", + ) + go_repository( + name = "com_google_cloud_go_pubsub", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/pubsub", + sum = "h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU=", + version = "v1.3.1", + ) + go_repository( + name = "com_google_cloud_go_storage", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go/storage", + sum = "h1:HwnT2u2D309SFDHQII6m18HlrCi3jAXhUMTLOWXYH14=", + version = "v1.21.0", + ) + go_repository( + name = "com_shuralyov_dmitri_gpu_mtl", + build_file_proto_mode = "disable_global", + importpath = "dmitri.shuralyov.com/gpu/mtl", + sum = "h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY=", + version = "v0.0.0-20190408044501-666a987793e9", + ) + go_repository( + name = "com_sourcegraph_sourcegraph_appdash", + build_file_proto_mode = "disable_global", + importpath = "sourcegraph.com/sourcegraph/appdash", + sum = "h1:ucqkfpjg9WzSUubAO62csmucvxl4/JeW3F4I4909XkM=", + version = "v0.0.0-20190731080439-ebfcffb1b5c0", + ) + go_repository( + name = "com_sourcegraph_sourcegraph_appdash_data", + build_file_proto_mode = "disable_global", + importpath = "sourcegraph.com/sourcegraph/appdash-data", + sum = "h1:e1sMhtVq9AfcEy8AXNb8eSg6gbzfdpYhoNqnPJa+GzI=", + version = "v0.0.0-20151005221446-73f23eafcf67", + ) + go_repository( + name = "com_stathat_c_consistent", + build_file_proto_mode = "disable", + importpath = "stathat.com/c/consistent", + sum = "h1:ezyc51EGcRPJUxfHGSgJjWzJdj3NiMU9pNfLNGiXV0c=", + version = "v1.0.0", + ) + + go_repository( + name = "in_gopkg_alecthomas_kingpin_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/alecthomas/kingpin.v2", + sum = "h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=", + version = "v2.2.6", + ) + go_repository( + name = "in_gopkg_check_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/check.v1", + sum = "h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=", + version = "v1.0.0-20201130134442-10cb98267c6c", + ) + go_repository( + name = "in_gopkg_errgo_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/errgo.v2", + sum = "h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=", + version = "v2.1.0", + ) + go_repository( + name = "in_gopkg_fsnotify_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/fsnotify.v1", + sum = "h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=", + version = "v1.4.7", + ) + go_repository( + name = "in_gopkg_go_playground_assert_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/go-playground/assert.v1", + sum = "h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=", + version = "v1.2.1", + ) + go_repository( + name = "in_gopkg_go_playground_validator_v8", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/go-playground/validator.v8", + sum = "h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ=", + version = "v8.18.2", + ) + go_repository( + name = "in_gopkg_ini_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/ini.v1", + sum = "h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI=", + version = "v1.66.2", + ) + go_repository( + name = "in_gopkg_jcmturner_aescts_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/jcmturner/aescts.v1", + sum = "h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw=", + version = "v1.0.1", + ) + go_repository( + name = "in_gopkg_jcmturner_dnsutils_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/jcmturner/dnsutils.v1", + sum = "h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM=", + version = "v1.0.1", + ) + go_repository( + name = "in_gopkg_jcmturner_goidentity_v3", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/jcmturner/goidentity.v3", + sum = "h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI=", + version = "v3.0.0", + ) + go_repository( + name = "in_gopkg_jcmturner_gokrb5_v7", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/jcmturner/gokrb5.v7", + sum = "h1:0709Jtq/6QXEuWRfAm260XqlpcwL1vxtO1tUE2qK8Z4=", + version = "v7.3.0", + ) + go_repository( + name = "in_gopkg_jcmturner_rpc_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/jcmturner/rpc.v1", + sum = "h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU=", + version = "v1.1.0", + ) + go_repository( + name = "in_gopkg_mgo_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/mgo.v2", + sum = "h1:xcEWjVhvbDy+nHP67nPDDpbYrY+ILlfndk4bRioVHaU=", + version = "v2.0.0-20180705113604-9856a29383ce", + ) + go_repository( + name = "in_gopkg_natefinch_lumberjack_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/natefinch/lumberjack.v2", + sum = "h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=", + version = "v2.0.0", + ) + go_repository( + name = "in_gopkg_resty_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/resty.v1", + sum = "h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI=", + version = "v1.12.0", + ) + go_repository( + name = "in_gopkg_tomb_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/tomb.v1", + sum = "h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=", + version = "v1.0.0-20141024135613-dd632973f1e7", + ) + go_repository( + name = "in_gopkg_yaml_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/yaml.v2", + sum = "h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=", + version = "v2.4.0", + ) + go_repository( + name = "in_gopkg_yaml_v3", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/yaml.v3", + sum = "h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=", + version = "v3.0.0-20210107192922-496545a6307b", + ) + go_repository( + name = "io_etcd_go_bbolt", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/bbolt", + sum = "h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=", + version = "v1.3.6", + ) + go_repository( + name = "io_etcd_go_etcd_api_v3", + build_file_proto_mode = "disable", + importpath = "go.etcd.io/etcd/api/v3", + patch_args = ["-p2"], + patches = [ + "//build/patches:io_etcd_go_etcd_api_v3.patch", + ], + sum = "h1:tXok5yLlKyuQ/SXSjtqHc4uzNaMqZi2XsoSPr/LlJXI=", + version = "v3.5.2", + ) + go_repository( + name = "io_etcd_go_etcd_client_pkg_v3", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/client/pkg/v3", + sum = "h1:4hzqQ6hIb3blLyQ8usCU4h3NghkqcsohEQ3o3VetYxE=", + version = "v3.5.2", + ) + go_repository( + name = "io_etcd_go_etcd_client_v2", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/client/v2", + sum = "h1:ymrVwTkefuqA/rPkSW7/B4ApijbPVefRumkY+stNfS0=", + version = "v2.305.2", + ) + go_repository( + name = "io_etcd_go_etcd_client_v3", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/client/v3", + sum = "h1:WdnejrUtQC4nCxK0/dLTMqKOB+U5TP/2Ya0BJL+1otA=", + version = "v3.5.2", + ) + go_repository( + name = "io_etcd_go_etcd_etcdutl_v3", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/etcdutl/v3", + sum = "h1:XDNv2bGD6Ylz3Gb9lIGV/IYLk1bwTvyCIi1EI4hyyqo=", + version = "v3.5.2", + ) + go_repository( + name = "io_etcd_go_etcd_pkg_v3", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/pkg/v3", + sum = "h1:YZUojdoPhOyl5QILYnR8LTUbbNefu/sV4ma+ZMr2tto=", + version = "v3.5.2", + ) + go_repository( + name = "io_etcd_go_etcd_raft_v3", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/raft/v3", + patch_args = ["-p1"], + patches = [ + "//build/patches:io_etcd_go_etcd_raft_v3.patch", + ], + sum = "h1:uCC37qOXqBvKqTGHGyhASsaCsnTuJugl1GvneJNwHWo=", + version = "v3.5.2", + ) + go_repository( + name = "io_etcd_go_etcd_server_v3", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/server/v3", + sum = "h1:B6ytJvS4Fmt8nkjzS2/8POf4tuPhFMluE0lWd4dx/7U=", + version = "v3.5.2", + ) + go_repository( + name = "io_etcd_go_etcd_tests_v3", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd/tests/v3", + sum = "h1:uk7/uMGVebpBDl+roivowHt6gJ5Fnqwik3syDkoSKdo=", + version = "v3.5.2", + ) + go_repository( + name = "io_k8s_sigs_yaml", + build_file_proto_mode = "disable_global", + importpath = "sigs.k8s.io/yaml", + sum = "h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=", + version = "v1.2.0", + ) + go_repository( + name = "io_opencensus_go", + build_file_proto_mode = "disable_global", + importpath = "go.opencensus.io", + sum = "h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=", + version = "v0.23.0", + ) + go_repository( + name = "io_opentelemetry_go_contrib", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/contrib", + sum = "h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0=", + version = "v0.20.0", + ) + go_repository( + name = "io_opentelemetry_go_contrib_instrumentation_google_golang_org_grpc_otelgrpc", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc", + sum = "h1:sO4WKdPAudZGKPcpZT4MJn6JaDmpyLrMPDGGyA1SttE=", + version = "v0.20.0", + ) + go_repository( + name = "io_opentelemetry_go_otel", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel", + sum = "h1:eaP0Fqu7SXHwvjiqDq83zImeehOHX8doTvU9AwXON8g=", + version = "v0.20.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_exporters_otlp", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/exporters/otlp", + sum = "h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg=", + version = "v0.20.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_metric", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/metric", + sum = "h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8=", + version = "v0.20.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_oteltest", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/oteltest", + sum = "h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw=", + version = "v0.20.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_sdk", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/sdk", + sum = "h1:JsxtGXd06J8jrnya7fdI/U/MR6yXA5DtbZy+qoHQlr8=", + version = "v0.20.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_sdk_export_metric", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/sdk/export/metric", + sum = "h1:c5VRjxCXdQlx1HjzwGdQHzZaVI82b5EbBgOu2ljD92g=", + version = "v0.20.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_sdk_metric", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/sdk/metric", + sum = "h1:7ao1wpzHRVKf0OQ7GIxiQJA6X7DLX9o14gmVon7mMK8=", + version = "v0.20.0", + ) + go_repository( + name = "io_opentelemetry_go_otel_trace", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/otel/trace", + sum = "h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw=", + version = "v0.20.0", + ) + go_repository( + name = "io_opentelemetry_go_proto_otlp", + build_file_proto_mode = "disable_global", + importpath = "go.opentelemetry.io/proto/otlp", + sum = "h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8=", + version = "v0.7.0", + ) + go_repository( + name = "io_rsc_binaryregexp", + build_file_proto_mode = "disable_global", + importpath = "rsc.io/binaryregexp", + sum = "h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE=", + version = "v0.2.0", + ) + go_repository( + name = "io_rsc_pdf", + build_file_proto_mode = "disable_global", + importpath = "rsc.io/pdf", + sum = "h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4=", + version = "v0.1.1", + ) + go_repository( + name = "io_rsc_quote_v3", + build_file_proto_mode = "disable_global", + importpath = "rsc.io/quote/v3", + sum = "h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY=", + version = "v3.1.0", + ) + go_repository( + name = "io_rsc_sampler", + build_file_proto_mode = "disable_global", + importpath = "rsc.io/sampler", + sum = "h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=", + version = "v1.3.0", + ) + go_repository( + name = "org_golang_google_api", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/api", + sum = "h1:yHW5s2SFyDapr/43kYtIQmoaaFVW4baLMLwqV4auj2A=", + version = "v0.69.0", + ) + go_repository( + name = "org_golang_google_appengine", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/appengine", + sum = "h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=", + version = "v1.6.7", + ) + go_repository( + name = "org_golang_google_genproto", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/genproto", + sum = "h1:divpuJZKgX3Qt7MFDE5v62yu0yQcQbTCD9VJp9leX58=", + version = "v0.0.0-20220216160803-4663080d8bc8", + ) + go_repository( + name = "org_golang_google_grpc", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/grpc", + sum = "h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg=", + version = "v1.44.0", + ) + go_repository( + name = "org_golang_google_grpc_cmd_protoc_gen_go_grpc", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/grpc/cmd/protoc-gen-go-grpc", + sum = "h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE=", + version = "v1.1.0", + ) + go_repository( + name = "org_golang_google_protobuf", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/protobuf", + sum = "h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=", + version = "v1.27.1", + ) + go_repository( + name = "org_golang_x_crypto", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/crypto", + sum = "h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE=", + version = "v0.0.0-20220214200702-86341886e292", + ) + go_repository( + name = "org_golang_x_exp", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/exp", + sum = "h1:rxKZ2gOnYxjfmakvUUqh9Gyb6KXfrj7JWTxORTYqb0E=", + version = "v0.0.0-20220426173459-3bcf042a4bf5", + ) + go_repository( + name = "org_golang_x_image", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/image", + sum = "h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=", + version = "v0.0.0-20190802002840-cff245a6509b", + ) + go_repository( + name = "org_golang_x_lint", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/lint", + sum = "h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=", + version = "v0.0.0-20210508222113-6edffad5e616", + ) + go_repository( + name = "org_golang_x_mobile", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/mobile", + sum = "h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=", + version = "v0.0.0-20190719004257-d2bd2a29d028", + ) + go_repository( + name = "org_golang_x_mod", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/mod", + sum = "h1:LQmS1nU0twXLA96Kt7U9qtHJEbBk3z6Q0V4UXjZkpr4=", + version = "v0.6.0-dev.0.20211013180041-c96bc1413d57", + ) + go_repository( + name = "org_golang_x_net", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/net", + sum = "h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=", + version = "v0.0.0-20220127200216-cd36cc0744dd", + ) + go_repository( + name = "org_golang_x_oauth2", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/oauth2", + sum = "h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg=", + version = "v0.0.0-20211104180415-d3ed0bb246c8", + ) + go_repository( + name = "org_golang_x_sync", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/sync", + sum = "h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4=", + version = "v0.0.0-20220513210516-0976fa681c29", + ) + go_repository( + name = "org_golang_x_sys", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/sys", + sum = "h1:8w7RhxzTVgUzw/AH/9mUV5q0vMgy40SQRursCcfmkCw=", + version = "v0.0.0-20220408201424-a24fb2fb8a0f", + ) + go_repository( + name = "org_golang_x_term", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/term", + sum = "h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=", + version = "v0.0.0-20210927222741-03fcf44c2211", + ) + go_repository( + name = "org_golang_x_text", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/text", + sum = "h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=", + version = "v0.3.7", + ) + go_repository( + name = "org_golang_x_time", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/time", + sum = "h1:M73Iuj3xbbb9Uk1DYhzydthsj6oOd6l9bpuFcNoUvTs=", + version = "v0.0.0-20220224211638-0e9765cccd65", + ) + go_repository( + name = "org_golang_x_tools", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/tools", + sum = "h1:P1HhGGuLW4aAclzjtmJdf0mJOjVUZUzOTqkAkWL+l6w=", + version = "v0.1.8", + ) + go_repository( + name = "org_golang_x_xerrors", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/xerrors", + sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=", + version = "v0.0.0-20200804184101-5ec99f83aff1", + ) + go_repository( + name = "org_gonum_v1_gonum", + build_file_proto_mode = "disable_global", + importpath = "gonum.org/v1/gonum", + sum = "h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM=", + version = "v0.8.2", + ) + go_repository( + name = "org_gonum_v1_netlib", + build_file_proto_mode = "disable_global", + importpath = "gonum.org/v1/netlib", + sum = "h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc=", + version = "v0.0.0-20190313105609-8cb42192e0e0", + ) + go_repository( + name = "org_gonum_v1_plot", + build_file_proto_mode = "disable_global", + importpath = "gonum.org/v1/plot", + sum = "h1:Qh4dB5D/WpoUUp3lSod7qgoyEHbDGPUWjIbnqdqqe1k=", + version = "v0.0.0-20190515093506-e2840ee46a6b", + ) + go_repository( + name = "org_modernc_fileutil", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/fileutil", + sum = "h1:Z1AFLZwl6BO8A5NldQg/xTSjGLetp+1Ubvl4alfGx8w=", + version = "v1.0.0", + ) + go_repository( + name = "org_modernc_golex", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/golex", + sum = "h1:EYKY1a3wStt0RzHaH8mdSRNg78Ub0OHxYfCRWw35YtM=", + version = "v1.0.1", + ) + go_repository( + name = "org_modernc_lex", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/lex", + sum = "h1:w0dxp18i1q+aSE7GkepvwzvVWTLoCIQ2oDgTFAV2JZU=", + version = "v1.0.0", + ) + go_repository( + name = "org_modernc_lexer", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/lexer", + sum = "h1:D2xE6YTaH7aiEC7o/+rbx6qTAEr1uY83peKwkamIdQ0=", + version = "v1.0.0", + ) + go_repository( + name = "org_modernc_mathutil", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/mathutil", + sum = "h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8=", + version = "v1.4.1", + ) + go_repository( + name = "org_modernc_parser", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/parser", + sum = "h1:/qHLDn1ezrcRk9/XbErYp84bPPM4+w0kIDuvMdRk6Vc=", + version = "v1.0.2", + ) + go_repository( + name = "org_modernc_scanner", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/scanner", + sum = "h1:rmWBTztgQKLM2CYx0uTQGhAxgnrILDEOVXJsEq/I4Js=", + version = "v1.0.1", + ) + go_repository( + name = "org_modernc_sortutil", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/sortutil", + sum = "h1:SUTM1sCR0Ldpv7dbB/KCPC2zHHsZ1KrSkhmGmmV22CQ=", + version = "v1.0.0", + ) + go_repository( + name = "org_modernc_strutil", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/strutil", + sum = "h1:+1/yCzZxY2pZwwrsbH+4T7BQMoLQ9QiBshRC9eicYsc=", + version = "v1.1.0", + ) + go_repository( + name = "org_modernc_y", + build_file_proto_mode = "disable_global", + importpath = "modernc.org/y", + sum = "h1:+QT+MtLkwkvLkh3fYQq+YD5vw2s5paVE73jdl5R/Py8=", + version = "v1.0.1", + ) + go_repository( + name = "org_uber_go_atomic", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/atomic", + sum = "h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=", + version = "v1.9.0", + ) + go_repository( + name = "org_uber_go_automaxprocs", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/automaxprocs", + sum = "h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0=", + version = "v1.4.0", + ) + go_repository( + name = "org_uber_go_goleak", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/goleak", + sum = "h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA=", + version = "v1.1.12", + ) + go_repository( + name = "org_uber_go_multierr", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/multierr", + sum = "h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=", + version = "v1.8.0", + ) + go_repository( + name = "org_uber_go_tools", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/tools", + sum = "h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=", + version = "v0.0.0-20190618225709-2cfd321de3ee", + ) + go_repository( + name = "org_uber_go_zap", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/zap", + sum = "h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=", + version = "v1.21.0", + ) diff --git a/Makefile b/Makefile index 64ad558481539..b390937b80319 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ include Makefile.common -.PHONY: all clean test gotest server dev benchkv benchraw check checklist parser tidy ddltest build_br build_lightning build_lightning-ctl build_dumpling ut +.PHONY: all clean test gotest server dev benchkv benchraw check checklist parser tidy ddltest build_br build_lightning build_lightning-ctl build_dumpling ut bazel_build bazel_prepare bazel_test default: server buildsucc @@ -420,3 +420,38 @@ tools/bin/gotestsum: tools/check/go.mod generate_grafana_scripts: @cd metrics/grafana && mv tidb_summary.json tidb_summary.json.committed && ./generate_json.sh && diff -u tidb_summary.json.committed tidb_summary.json && rm tidb_summary.json.committed + +bazel_ci_prepare: + bazel --output_user_root=/home/jenkins/.tidb/tmp run --config=ci //:gazelle + +bazel_prepare: + bazel run //:gazelle + +bazel_test: failpoint-enable bazel_ci_prepare + bazel --output_user_root=/home/jenkins/.tidb/tmp test --config=ci \ + -- //... -//cmd/... -//tests/graceshutdown/... \ + -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/lightning/log:log_test -//br/pkg/task:task_test + + +bazel_coverage_test: failpoint-enable bazel_ci_prepare + bazel --output_user_root=/home/jenkins/.tidb/tmp coverage --config=ci --@io_bazel_rules_go//go/config:cover_format=go_cover \ + -- //... -//cmd/... -//tests/graceshutdown/... \ + -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/lightning/log:log_test -//br/pkg/task:task_test + +bazel_build: bazel_ci_prepare + mkdir -p bin + bazel --output_user_root=/home/jenkins/.tidb/tmp build --config=ci //tidb-server/... //br/cmd/... //cmd/... + cp bazel-out/k8-fastbuild/bin/tidb-server/tidb-server_/tidb-server ./bin + cp bazel-out/k8-fastbuild/bin/cmd/importer/importer_/importer ./bin + cp bazel-out/k8-fastbuild/bin/tidb-server/tidb-server-check_/tidb-server-check ./bin + +bazel_fail_build: failpoint-enable bazel_ci_prepare + bazel --output_user_root=/home/jenkins/.tidb/tmp build --config=ci //... + +bazel_clean: + bazel --output_user_root=/home/jenkins/.tidb/tmp clean + +bazel_junit: + bazel_collect + @mkdir -p $(TEST_COVERAGE_DIR) + mv ./junit.xml `$(TEST_COVERAGE_DIR)/junit.xml` diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 0000000000000..7f9a8815b39f9 --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,48 @@ +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "io_bazel_rules_go", + sha256 = "685052b498b6ddfe562ca7a97736741d87916fe536623afb7da2824c0211c369", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.33.0/rules_go-v0.33.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.33.0/rules_go-v0.33.0.zip", + ], +) + +http_archive( + name = "bazel_gazelle", + sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz", + ], +) + +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") + +load("//:DEPS.bzl", "go_deps") + +# gazelle:repository_macro DEPS.bzl%go_deps +go_deps() + +load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") +go_rules_dependencies() + +go_register_toolchains(version = "1.18.3") + +gazelle_dependencies() + +http_archive( + name = "com_google_protobuf", + sha256 = "bc3dbf1f09dba1b2eb3f2f70352ee97b9049066c9040ce0c9b67fb3294e91e4b", + strip_prefix = "protobuf-3.15.5", + # latest, as of 2021-03-08 + urls = [ + "https://github.com/protocolbuffers/protobuf/archive/v3.15.5.tar.gz", + "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.15.5.tar.gz", + ], +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() diff --git a/bindinfo/BUILD.bazel b/bindinfo/BUILD.bazel new file mode 100644 index 0000000000000..22cb9e355d99e --- /dev/null +++ b/bindinfo/BUILD.bazel @@ -0,0 +1,79 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bindinfo", + srcs = [ + "bind_cache.go", + "bind_record.go", + "handle.go", + "session_handle.go", + "stat.go", + ], + importpath = "github.com/pingcap/tidb/bindinfo", + visibility = ["//visibility:public"], + deps = [ + "//metrics", + "//parser", + "//parser/ast", + "//parser/format", + "//parser/mysql", + "//parser/terror", + "//sessionctx", + "//sessionctx/stmtctx", + "//sessionctx/variable", + "//types", + "//types/parser_driver", + "//util/chunk", + "//util/hack", + "//util/hint", + "//util/kvcache", + "//util/logutil", + "//util/mathutil", + "//util/memory", + "//util/parser", + "//util/sqlexec", + "//util/stmtsummary", + "//util/table-filter", + "//util/timeutil", + "@org_golang_x_exp//maps", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "bindinfo_test", + srcs = [ + "bind_cache_test.go", + "bind_test.go", + "capture_test.go", + "handle_test.go", + "main_test.go", + "optimize_test.go", + "session_handle_test.go", + "temptable_test.go", + ], + embed = [":bindinfo"], + deps = [ + "//config", + "//domain", + "//errno", + "//metrics", + "//parser", + "//parser/auth", + "//parser/model", + "//parser/terror", + "//planner/core", + "//session/txninfo", + "//sessionctx/variable", + "//testkit", + "//testkit/testsetup", + "//util", + "//util/hack", + "//util/parser", + "//util/stmtsummary", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_prometheus_client_model//go", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/br/cmd/br/BUILD.bazel b/br/cmd/br/BUILD.bazel new file mode 100644 index 0000000000000..2958366d93c4f --- /dev/null +++ b/br/cmd/br/BUILD.bazel @@ -0,0 +1,57 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "br_lib", + srcs = [ + "backup.go", + "cmd.go", + "debug.go", + "main.go", + "restore.go", + "stream.go", + ], + importpath = "github.com/pingcap/tidb/br/cmd/br", + visibility = ["//visibility:private"], + deps = [ + "//br/pkg/errors", + "//br/pkg/gluetidb", + "//br/pkg/gluetikv", + "//br/pkg/logutil", + "//br/pkg/metautil", + "//br/pkg/mock/mockid", + "//br/pkg/redact", + "//br/pkg/restore", + "//br/pkg/rtree", + "//br/pkg/summary", + "//br/pkg/task", + "//br/pkg/trace", + "//br/pkg/utils", + "//br/pkg/version/build", + "//config", + "//ddl", + "//parser/model", + "//session", + "//util", + "//util/logutil", + "@com_github_gogo_protobuf//proto", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@com_github_pingcap_log//:log", + "@com_github_spf13_cobra//:cobra", + "@com_sourcegraph_sourcegraph_appdash//:appdash", + "@org_uber_go_zap//:zap", + ], +) + +go_binary( + name = "br", + embed = [":br_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "br_test", + srcs = ["main_test.go"], + embed = [":br_lib"], +) diff --git a/br/cmd/tidb-lightning-ctl/BUILD.bazel b/br/cmd/tidb-lightning-ctl/BUILD.bazel new file mode 100644 index 0000000000000..33aa0bdfa37e0 --- /dev/null +++ b/br/cmd/tidb-lightning-ctl/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "tidb-lightning-ctl_lib", + srcs = ["main.go"], + importpath = "github.com/pingcap/tidb/br/cmd/tidb-lightning-ctl", + visibility = ["//visibility:private"], + deps = [ + "//br/pkg/lightning", + "//br/pkg/lightning/backend", + "//br/pkg/lightning/backend/local", + "//br/pkg/lightning/checkpoints", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/restore", + "//br/pkg/lightning/tikv", + "@com_github_pingcap_errors//:errors", + ], +) + +go_binary( + name = "tidb-lightning-ctl", + embed = [":tidb-lightning-ctl_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "tidb-lightning-ctl_test", + srcs = ["main_test.go"], + embed = [":tidb-lightning-ctl_lib"], +) diff --git a/br/cmd/tidb-lightning/BUILD.bazel b/br/cmd/tidb-lightning/BUILD.bazel new file mode 100644 index 0000000000000..6098f1db43f84 --- /dev/null +++ b/br/cmd/tidb-lightning/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "tidb-lightning_lib", + srcs = ["main.go"], + importpath = "github.com/pingcap/tidb/br/cmd/tidb-lightning", + visibility = ["//visibility:private"], + deps = [ + "//br/pkg/lightning", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/log", + "//br/pkg/lightning/web", + "@org_uber_go_zap//:zap", + ], +) + +go_binary( + name = "tidb-lightning", + embed = [":tidb-lightning_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "tidb-lightning_test", + srcs = ["main_test.go"], + embed = [":tidb-lightning_lib"], +) diff --git a/br/pkg/backup/BUILD.bazel b/br/pkg/backup/BUILD.bazel new file mode 100644 index 0000000000000..14f4d1a87c6f9 --- /dev/null +++ b/br/pkg/backup/BUILD.bazel @@ -0,0 +1,94 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "backup", + srcs = [ + "check.go", + "client.go", + "metrics.go", + "push.go", + "schema.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/backup", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/checksum", + "//br/pkg/conn", + "//br/pkg/errors", + "//br/pkg/glue", + "//br/pkg/logutil", + "//br/pkg/metautil", + "//br/pkg/redact", + "//br/pkg/rtree", + "//br/pkg/storage", + "//br/pkg/summary", + "//br/pkg/utils", + "//ddl", + "//distsql", + "//kv", + "//meta", + "//meta/autoid", + "//parser/model", + "//statistics/handle", + "//util", + "//util/codec", + "//util/ranger", + "//util/table-filter", + "@com_github_google_btree//:btree", + "@com_github_opentracing_opentracing_go//:opentracing-go", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/errorpb", + "@com_github_pingcap_kvproto//pkg/kvrpcpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_log//:log", + "@com_github_prometheus_client_golang//prometheus", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_client_go_v2//tikv", + "@com_github_tikv_client_go_v2//txnkv/txnlock", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_golang_x_sync//errgroup", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "backup_test", + srcs = [ + "client_test.go", + "main_test.go", + "schema_test.go", + ], + embed = [":backup"], + deps = [ + "//br/pkg/conn", + "//br/pkg/metautil", + "//br/pkg/mock", + "//br/pkg/pdutil", + "//br/pkg/storage", + "//br/pkg/utils", + "//kv", + "//parser/model", + "//sessionctx/variable", + "//tablecodec", + "//testkit", + "//testkit/testsetup", + "//types", + "//util/codec", + "//util/table-filter", + "@com_github_golang_protobuf//proto", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/encryptionpb", + "@com_github_pingcap_kvproto//pkg/errorpb", + "@com_github_stretchr_testify//require", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_client_go_v2//testutils", + "@com_github_tikv_client_go_v2//tikv", + "@com_github_tikv_client_go_v2//txnkv/txnlock", + "@com_github_tikv_pd_client//:client", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/br/pkg/checksum/BUILD.bazel b/br/pkg/checksum/BUILD.bazel new file mode 100644 index 0000000000000..db1bf73ea87bd --- /dev/null +++ b/br/pkg/checksum/BUILD.bazel @@ -0,0 +1,50 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "checksum", + srcs = [ + "executor.go", + "validate.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/checksum", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/errors", + "//br/pkg/metautil", + "//br/pkg/storage", + "//br/pkg/summary", + "//distsql", + "//kv", + "//parser/model", + "//sessionctx/variable", + "//tablecodec", + "//util/ranger", + "@com_github_gogo_protobuf//proto", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_log//:log", + "@com_github_pingcap_tipb//go-tipb", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "checksum_test", + srcs = [ + "executor_test.go", + "main_test.go", + ], + embed = [":checksum"], + deps = [ + "//br/pkg/backup", + "//br/pkg/metautil", + "//br/pkg/mock", + "//kv", + "//parser/model", + "//sessionctx/variable", + "//testkit", + "//testkit/testsetup", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/br/pkg/conn/BUILD.bazel b/br/pkg/conn/BUILD.bazel new file mode 100644 index 0000000000000..b61518eb2f44d --- /dev/null +++ b/br/pkg/conn/BUILD.bazel @@ -0,0 +1,58 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "conn", + srcs = ["conn.go"], + importpath = "github.com/pingcap/tidb/br/pkg/conn", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/errors", + "//br/pkg/glue", + "//br/pkg/logutil", + "//br/pkg/pdutil", + "//br/pkg/utils", + "//br/pkg/version", + "//domain", + "//kv", + "@com_github_docker_go_units//:go-units", + "@com_github_opentracing_opentracing_go//:opentracing-go", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_log//:log", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_client_go_v2//tikv", + "@com_github_tikv_client_go_v2//txnkv/txnlock", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//backoff", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//credentials", + "@org_golang_google_grpc//keepalive", + "@org_golang_google_grpc//status", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "conn_test", + srcs = [ + "conn_test.go", + "main_test.go", + ], + embed = [":conn"], + deps = [ + "//br/pkg/pdutil", + "//br/pkg/utils", + "//testkit/testsetup", + "@com_github_docker_go_units//:go-units", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_stretchr_testify//require", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/br/pkg/errors/BUILD.bazel b/br/pkg/errors/BUILD.bazel new file mode 100644 index 0000000000000..d07b0c723102a --- /dev/null +++ b/br/pkg/errors/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "errors", + srcs = ["errors.go"], + importpath = "github.com/pingcap/tidb/br/pkg/errors", + visibility = ["//visibility:public"], + deps = ["@com_github_pingcap_errors//:errors"], +) diff --git a/br/pkg/glue/BUILD.bazel b/br/pkg/glue/BUILD.bazel new file mode 100644 index 0000000000000..812b2b2c8b6a7 --- /dev/null +++ b/br/pkg/glue/BUILD.bazel @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "glue", + srcs = [ + "console_glue.go", + "glue.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/glue", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/logutil", + "//domain", + "//kv", + "//parser/model", + "@com_github_fatih_color//:color", + "@com_github_pingcap_log//:log", + "@com_github_tikv_pd_client//:client", + "@org_golang_x_term//:term", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "glue_test", + srcs = ["console_glue_test.go"], + deps = [ + ":glue", + "@com_github_fatih_color//:color", + "@com_github_stretchr_testify//require", + ], +) diff --git a/br/pkg/gluetidb/BUILD.bazel b/br/pkg/gluetidb/BUILD.bazel new file mode 100644 index 0000000000000..5340729c1d548 --- /dev/null +++ b/br/pkg/gluetidb/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "gluetidb", + srcs = ["glue.go"], + importpath = "github.com/pingcap/tidb/br/pkg/gluetidb", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/glue", + "//br/pkg/gluetikv", + "//br/pkg/logutil", + "//config", + "//ddl", + "//domain", + "//executor", + "//kv", + "//meta/autoid", + "//parser/model", + "//parser/mysql", + "//session", + "//sessionctx", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_log//:log", + "@com_github_tikv_pd_client//:client", + "@org_uber_go_zap//:zap", + ], +) diff --git a/br/pkg/gluetikv/BUILD.bazel b/br/pkg/gluetikv/BUILD.bazel new file mode 100644 index 0000000000000..7d8c6118604e4 --- /dev/null +++ b/br/pkg/gluetikv/BUILD.bazel @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "gluetikv", + srcs = ["glue.go"], + importpath = "github.com/pingcap/tidb/br/pkg/gluetikv", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/glue", + "//br/pkg/summary", + "//br/pkg/utils", + "//br/pkg/version/build", + "//config", + "//domain", + "//kv", + "//store/driver", + "@com_github_tikv_pd_client//:client", + ], +) + +go_test( + name = "gluetikv_test", + srcs = ["glue_test.go"], + embed = [":gluetikv"], + deps = ["@com_github_stretchr_testify//require"], +) diff --git a/br/pkg/httputil/BUILD.bazel b/br/pkg/httputil/BUILD.bazel new file mode 100644 index 0000000000000..2520f0b97a5ab --- /dev/null +++ b/br/pkg/httputil/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "httputil", + srcs = ["http.go"], + importpath = "github.com/pingcap/tidb/br/pkg/httputil", + visibility = ["//visibility:public"], +) diff --git a/br/pkg/lightning/BUILD.bazel b/br/pkg/lightning/BUILD.bazel new file mode 100644 index 0000000000000..68c5c8fcb1d1e --- /dev/null +++ b/br/pkg/lightning/BUILD.bazel @@ -0,0 +1,56 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "lightning", + srcs = [ + "lightning.go", + "run_options.go", + "sigusr1_other.go", + "sigusr1_unix.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/lightning", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/backend/local", + "//br/pkg/lightning/checkpoints", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/glue", + "//br/pkg/lightning/log", + "//br/pkg/lightning/mydump", + "//br/pkg/lightning/restore", + "//br/pkg/lightning/tikv", + "//br/pkg/lightning/web", + "//br/pkg/redact", + "//br/pkg/storage", + "//br/pkg/utils", + "//br/pkg/version/build", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@com_github_prometheus_client_golang//prometheus/promhttp", + "@com_github_shurcool_httpgzip//:httpgzip", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) + +go_test( + name = "lightning_test", + srcs = [ + "lightning_serial_test.go", + "lightning_server_serial_test.go", + "main_test.go", + ], + embed = [":lightning"], + deps = [ + "//br/pkg/lightning/checkpoints", + "//br/pkg/lightning/config", + "//br/pkg/lightning/glue", + "//br/pkg/lightning/mydump", + "//br/pkg/lightning/web", + "@com_github_docker_go_units//:go-units", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_stretchr_testify//require", + ], +) diff --git a/br/pkg/lightning/backend/BUILD.bazel b/br/pkg/lightning/backend/BUILD.bazel new file mode 100644 index 0000000000000..87239db5e1442 --- /dev/null +++ b/br/pkg/lightning/backend/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "backend", + srcs = ["backend.go"], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/backend", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/backend/kv", + "//br/pkg/lightning/checkpoints", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/log", + "//br/pkg/lightning/metric", + "//br/pkg/lightning/mydump", + "//parser/model", + "//table", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "backend_test", + srcs = ["backend_test.go"], + deps = [ + ":backend", + "//br/pkg/lightning/backend/kv", + "//br/pkg/mock", + "//parser/mysql", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_golang_mock//gomock", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_stretchr_testify//require", + "@com_github_tikv_client_go_v2//oracle", + ], +) diff --git a/br/pkg/lightning/backend/importer/BUILD.bazel b/br/pkg/lightning/backend/importer/BUILD.bazel new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/br/pkg/lightning/backend/kv/BUILD.bazel b/br/pkg/lightning/backend/kv/BUILD.bazel new file mode 100644 index 0000000000000..bbf86ff484d9e --- /dev/null +++ b/br/pkg/lightning/backend/kv/BUILD.bazel @@ -0,0 +1,73 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "kv", + srcs = [ + "allocator.go", + "kv2sql.go", + "session.go", + "sql2kv.go", + "types.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/backend/kv", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/common", + "//br/pkg/lightning/log", + "//br/pkg/lightning/manual", + "//br/pkg/lightning/metric", + "//br/pkg/lightning/verification", + "//br/pkg/logutil", + "//br/pkg/redact", + "//br/pkg/utils", + "//expression", + "//kv", + "//meta/autoid", + "//parser/model", + "//parser/mysql", + "//planner/core", + "//sessionctx", + "//sessionctx/variable", + "//table", + "//table/tables", + "//tablecodec", + "//types", + "//util/chunk", + "//util/mathutil", + "//util/topsql/stmtstats", + "@com_github_docker_go_units//:go-units", + "@com_github_pingcap_errors//:errors", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) + +go_test( + name = "kv_test", + srcs = [ + "session_test.go", + "sql2kv_test.go", + ], + embed = [":kv"], + deps = [ + "//br/pkg/lightning/common", + "//br/pkg/lightning/log", + "//br/pkg/lightning/verification", + "//ddl", + "//kv", + "//meta/autoid", + "//parser", + "//parser/ast", + "//parser/model", + "//parser/mysql", + "//sessionctx", + "//table", + "//table/tables", + "//tablecodec", + "//types", + "//util/mock", + "@com_github_stretchr_testify//require", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) diff --git a/br/pkg/lightning/backend/local/BUILD.bazel b/br/pkg/lightning/backend/local/BUILD.bazel new file mode 100644 index 0000000000000..4b3102aca7f34 --- /dev/null +++ b/br/pkg/lightning/backend/local/BUILD.bazel @@ -0,0 +1,130 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "local", + srcs = [ + "duplicate.go", + "engine.go", + "iterator.go", + "key_adapter.go", + "local.go", + "local_freebsd.go", + "local_unix.go", + "local_unix_generic.go", + "local_windows.go", + "localhelper.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/backend/local", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/backend", + "//br/pkg/lightning/backend/kv", + "//br/pkg/lightning/checkpoints", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/errormanager", + "//br/pkg/lightning/glue", + "//br/pkg/lightning/log", + "//br/pkg/lightning/manual", + "//br/pkg/lightning/metric", + "//br/pkg/lightning/tikv", + "//br/pkg/lightning/worker", + "//br/pkg/logutil", + "//br/pkg/membuf", + "//br/pkg/pdutil", + "//br/pkg/restore", + "//br/pkg/utils", + "//br/pkg/version", + "//distsql", + "//infoschema", + "//kv", + "//parser/model", + "//parser/mysql", + "//table", + "//tablecodec", + "//util/codec", + "//util/hack", + "//util/mathutil", + "//util/ranger", + "@com_github_cockroachdb_pebble//:pebble", + "@com_github_cockroachdb_pebble//sstable", + "@com_github_coreos_go_semver//semver", + "@com_github_docker_go_units//:go-units", + "@com_github_google_btree//:btree", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/errorpb", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@com_github_pingcap_kvproto//pkg/kvrpcpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_kvproto//pkg/pdpb", + "@com_github_tikv_client_go_v2//error", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_client_go_v2//tikv", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//backoff", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//credentials", + "@org_golang_google_grpc//keepalive", + "@org_golang_google_grpc//status", + "@org_golang_x_sync//errgroup", + "@org_golang_x_time//rate", + "@org_uber_go_atomic//:atomic", + "@org_uber_go_multierr//:multierr", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "local_test", + srcs = [ + "engine_test.go", + "iterator_test.go", + "key_adapter_test.go", + "local_test.go", + "localhelper_test.go", + ], + embed = [":local"], + deps = [ + "//br/pkg/lightning/backend", + "//br/pkg/lightning/backend/kv", + "//br/pkg/lightning/common", + "//br/pkg/lightning/glue", + "//br/pkg/lightning/log", + "//br/pkg/lightning/mydump", + "//br/pkg/membuf", + "//br/pkg/mock", + "//br/pkg/pdutil", + "//br/pkg/restore", + "//br/pkg/utils", + "//br/pkg/version", + "//kv", + "//parser/mysql", + "//sessionctx/stmtctx", + "//store/pdtypes", + "//tablecodec", + "//types", + "//util/codec", + "//util/hack", + "@com_github_cockroachdb_pebble//:pebble", + "@com_github_cockroachdb_pebble//sstable", + "@com_github_coreos_go_semver//semver", + "@com_github_docker_go_units//:go-units", + "@com_github_golang_mock//gomock", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/errorpb", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_kvproto//pkg/pdpb", + "@com_github_stretchr_testify//require", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_uber_go_atomic//:atomic", + ], +) diff --git a/br/pkg/lightning/backend/noop/BUILD.bazel b/br/pkg/lightning/backend/noop/BUILD.bazel new file mode 100644 index 0000000000000..a38fcd8195761 --- /dev/null +++ b/br/pkg/lightning/backend/noop/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "noop", + srcs = ["noop.go"], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/backend/noop", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/backend", + "//br/pkg/lightning/backend/kv", + "//br/pkg/lightning/config", + "//br/pkg/lightning/log", + "//br/pkg/lightning/verification", + "//parser/model", + "//table", + "//types", + "@com_github_google_uuid//:uuid", + ], +) diff --git a/br/pkg/lightning/backend/tidb/BUILD.bazel b/br/pkg/lightning/backend/tidb/BUILD.bazel new file mode 100644 index 0000000000000..9dd8a9a876c14 --- /dev/null +++ b/br/pkg/lightning/backend/tidb/BUILD.bazel @@ -0,0 +1,54 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tidb", + srcs = ["tidb.go"], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/backend/tidb", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/backend", + "//br/pkg/lightning/backend/kv", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/errormanager", + "//br/pkg/lightning/log", + "//br/pkg/lightning/verification", + "//br/pkg/redact", + "//br/pkg/utils", + "//br/pkg/version", + "//parser/model", + "//parser/mysql", + "//sessionctx", + "//table", + "//types", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) + +go_test( + name = "tidb_test", + srcs = ["tidb_test.go"], + deps = [ + ":tidb", + "//br/pkg/lightning/backend", + "//br/pkg/lightning/backend/kv", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/errormanager", + "//br/pkg/lightning/log", + "//br/pkg/lightning/verification", + "//parser/charset", + "//parser/model", + "//parser/mysql", + "//table", + "//table/tables", + "//types", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_stretchr_testify//require", + "@org_uber_go_atomic//:atomic", + ], +) diff --git a/br/pkg/lightning/checkpoints/BUILD.bazel b/br/pkg/lightning/checkpoints/BUILD.bazel new file mode 100644 index 0000000000000..241ec95201e76 --- /dev/null +++ b/br/pkg/lightning/checkpoints/BUILD.bazel @@ -0,0 +1,54 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "checkpoints", + srcs = [ + "checkpoints.go", + "glue_checkpoint.go", + "tidb.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/checkpoints", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/checkpoints/checkpointspb", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/log", + "//br/pkg/lightning/mydump", + "//br/pkg/lightning/verification", + "//br/pkg/storage", + "//br/pkg/version/build", + "//parser/ast", + "//parser/model", + "//types", + "//util/chunk", + "//util/mathutil", + "//util/sqlexec", + "@com_github_joho_sqltocsv//:sqltocsv", + "@com_github_pingcap_errors//:errors", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "checkpoints_test", + srcs = [ + "checkpoints_file_test.go", + "checkpoints_sql_test.go", + "checkpoints_test.go", + "main_test.go", + ], + embed = [":checkpoints"], + deps = [ + "//br/pkg/lightning/checkpoints/checkpointspb", + "//br/pkg/lightning/config", + "//br/pkg/lightning/mydump", + "//br/pkg/lightning/verification", + "//br/pkg/version/build", + "//testkit/testsetup", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_pingcap_errors//:errors", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/br/pkg/lightning/checkpoints/checkpointspb/BUILD.bazel b/br/pkg/lightning/checkpoints/checkpointspb/BUILD.bazel new file mode 100644 index 0000000000000..92bdf9dbcf654 --- /dev/null +++ b/br/pkg/lightning/checkpoints/checkpointspb/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "checkpointspb", + srcs = ["file_checkpoints.pb.go"], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/checkpoints/checkpointspb", + visibility = ["//visibility:public"], + deps = [ + "@com_github_gogo_protobuf//gogoproto", + "@com_github_gogo_protobuf//proto", + ], +) diff --git a/br/pkg/lightning/common/BUILD.bazel b/br/pkg/lightning/common/BUILD.bazel new file mode 100644 index 0000000000000..c64a3fdf85654 --- /dev/null +++ b/br/pkg/lightning/common/BUILD.bazel @@ -0,0 +1,69 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "common", + srcs = [ + "conn.go", + "errors.go", + "once_error.go", + "pause.go", + "retry.go", + "security.go", + "storage.go", + "storage_unix.go", + "storage_windows.go", + "util.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/common", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/errors", + "//br/pkg/httputil", + "//br/pkg/lightning/log", + "//br/pkg/utils", + "//errno", + "//parser/model", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_tikv_client_go_v2//config", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//credentials", + "@org_golang_google_grpc//status", + "@org_golang_x_sys//unix", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "common_test", + srcs = [ + "errors_test.go", + "main_test.go", + "once_error_test.go", + "pause_test.go", + "retry_test.go", + "security_test.go", + "storage_test.go", + "util_test.go", + ], + embed = [":common"], + deps = [ + "//br/pkg/errors", + "//br/pkg/lightning/log", + "//errno", + "//testkit/testsetup", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_uber_go_goleak//:goleak", + "@org_uber_go_multierr//:multierr", + ], +) diff --git a/br/pkg/lightning/config/BUILD.bazel b/br/pkg/lightning/config/BUILD.bazel new file mode 100644 index 0000000000000..04e5e38403b2b --- /dev/null +++ b/br/pkg/lightning/config/BUILD.bazel @@ -0,0 +1,45 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "config", + srcs = [ + "bytesize.go", + "config.go", + "configlist.go", + "const.go", + "global.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/config", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/common", + "//br/pkg/lightning/log", + "//br/pkg/version/build", + "//config", + "//parser/mysql", + "//util/table-filter", + "//util/table-router", + "@com_github_burntsushi_toml//:toml", + "@com_github_carlmjohnson_flagext//:flagext", + "@com_github_docker_go_units//:go-units", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_pingcap_errors//:errors", + "@org_uber_go_atomic//:atomic", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "config_test", + srcs = [ + "bytesize_test.go", + "config_test.go", + "configlist_test.go", + ], + deps = [ + ":config", + "//parser/mysql", + "@com_github_burntsushi_toml//:toml", + "@com_github_stretchr_testify//require", + ], +) diff --git a/br/pkg/lightning/errormanager/BUILD.bazel b/br/pkg/lightning/errormanager/BUILD.bazel new file mode 100644 index 0000000000000..e8c61ab00f0b2 --- /dev/null +++ b/br/pkg/lightning/errormanager/BUILD.bazel @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "errormanager", + srcs = ["errormanager.go"], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/errormanager", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/log", + "//br/pkg/redact", + "//br/pkg/utils", + "@com_github_jedib0t_go_pretty_v6//table", + "@com_github_jedib0t_go_pretty_v6//text", + "@com_github_pingcap_errors//:errors", + "@org_golang_x_sync//errgroup", + "@org_uber_go_multierr//:multierr", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "errormanager_test", + srcs = ["errormanager_test.go"], + embed = [":errormanager"], + deps = [ + "//br/pkg/lightning/config", + "//br/pkg/utils", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_stretchr_testify//require", + "@org_uber_go_atomic//:atomic", + ], +) diff --git a/br/pkg/lightning/glue/BUILD.bazel b/br/pkg/lightning/glue/BUILD.bazel new file mode 100644 index 0000000000000..9b1adc3ef2d67 --- /dev/null +++ b/br/pkg/lightning/glue/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "glue", + srcs = ["glue.go"], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/glue", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/checkpoints", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/log", + "//parser", + "//parser/ast", + "//parser/model", + "//parser/mysql", + "//types", + "//util/sqlexec", + ], +) diff --git a/br/pkg/lightning/log/BUILD.bazel b/br/pkg/lightning/log/BUILD.bazel new file mode 100644 index 0000000000000..53d93581f1627 --- /dev/null +++ b/br/pkg/lightning/log/BUILD.bazel @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "log", + srcs = [ + "filter.go", + "log.go", + "testlogger.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/log", + visibility = ["//visibility:public"], + deps = [ + "//util/logutil", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_log//:log", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + "@org_uber_go_zap//zaptest", + ], +) + +go_test( + name = "log_test", + srcs = [ + "filter_test.go", + "log_test.go", + ], + deps = [ + ":log", + "@com_github_stretchr_testify//require", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) diff --git a/br/pkg/lightning/manual/BUILD.bazel b/br/pkg/lightning/manual/BUILD.bazel new file mode 100644 index 0000000000000..6d1fc18dd2495 --- /dev/null +++ b/br/pkg/lightning/manual/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "manual", + srcs = [ + "allocator.go", + "manual.go", + "manual_nocgo.go", + ], + cgo = True, + importpath = "github.com/pingcap/tidb/br/pkg/lightning/manual", + visibility = ["//visibility:public"], +) diff --git a/br/pkg/lightning/metric/BUILD.bazel b/br/pkg/lightning/metric/BUILD.bazel new file mode 100644 index 0000000000000..728d480b1bf5f --- /dev/null +++ b/br/pkg/lightning/metric/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "metric", + srcs = ["metric.go"], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/metric", + visibility = ["//visibility:public"], + deps = [ + "@com_github_prometheus_client_golang//prometheus", + "@com_github_prometheus_client_model//go", + ], +) + +go_test( + name = "metric_test", + srcs = ["metric_test.go"], + deps = [ + ":metric", + "@com_github_prometheus_client_golang//prometheus", + "@com_github_stretchr_testify//require", + ], +) diff --git a/br/pkg/lightning/mydump/BUILD.bazel b/br/pkg/lightning/mydump/BUILD.bazel new file mode 100644 index 0000000000000..1736f87af679f --- /dev/null +++ b/br/pkg/lightning/mydump/BUILD.bazel @@ -0,0 +1,83 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "mydump", + srcs = [ + "bytes.go", + "charset_convertor.go", + "csv_parser.go", + "loader.go", + "parquet_parser.go", + "parser.go", + "parser_generated.go", + "reader.go", + "region.go", + "router.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/mydump", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/log", + "//br/pkg/lightning/metric", + "//br/pkg/lightning/worker", + "//br/pkg/storage", + "//parser/mysql", + "//types", + "//util/filter", + "//util/mathutil", + "//util/regexpr-router", + "//util/slice", + "//util/table-filter", + "@com_github_pingcap_errors//:errors", + "@com_github_xitongsys_parquet_go//parquet", + "@com_github_xitongsys_parquet_go//reader", + "@com_github_xitongsys_parquet_go//source", + "@org_golang_x_text//encoding", + "@org_golang_x_text//encoding/simplifiedchinese", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) + +go_test( + name = "mydump_test", + srcs = [ + "charset_convertor_test.go", + "csv_parser_test.go", + "loader_test.go", + "main_test.go", + "parquet_parser_test.go", + "parser_test.go", + "reader_test.go", + "region_test.go", + "router_test.go", + ], + data = glob([ + "csv/*", + "examples/*", + ]), + embed = [":mydump"], + deps = [ + "//br/pkg/lightning/config", + "//br/pkg/lightning/log", + "//br/pkg/lightning/worker", + "//br/pkg/mock/storage", + "//br/pkg/storage", + "//parser/mysql", + "//testkit/testsetup", + "//types", + "//util/filter", + "//util/table-filter", + "//util/table-router", + "@com_github_golang_mock//gomock", + "@com_github_pingcap_errors//:errors", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + "@com_github_xitongsys_parquet_go//writer", + "@com_github_xitongsys_parquet_go_source//local", + "@org_uber_go_goleak//:goleak", + "@org_uber_go_zap//:zap", + ], +) diff --git a/br/pkg/lightning/restore/BUILD.bazel b/br/pkg/lightning/restore/BUILD.bazel new file mode 100644 index 0000000000000..b646fbfa2ba20 --- /dev/null +++ b/br/pkg/lightning/restore/BUILD.bazel @@ -0,0 +1,137 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "restore", + srcs = [ + "check_info.go", + "check_template.go", + "checksum.go", + "meta_manager.go", + "restore.go", + "table_restore.go", + "tidb.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/restore", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/checksum", + "//br/pkg/errors", + "//br/pkg/lightning/backend", + "//br/pkg/lightning/backend/kv", + "//br/pkg/lightning/backend/local", + "//br/pkg/lightning/backend/tidb", + "//br/pkg/lightning/checkpoints", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/errormanager", + "//br/pkg/lightning/glue", + "//br/pkg/lightning/log", + "//br/pkg/lightning/metric", + "//br/pkg/lightning/mydump", + "//br/pkg/lightning/tikv", + "//br/pkg/lightning/verification", + "//br/pkg/lightning/web", + "//br/pkg/lightning/worker", + "//br/pkg/pdutil", + "//br/pkg/redact", + "//br/pkg/storage", + "//br/pkg/utils", + "//br/pkg/version", + "//br/pkg/version/build", + "//config", + "//kv", + "//meta/autoid", + "//parser", + "//parser/ast", + "//parser/format", + "//parser/model", + "//parser/mysql", + "//store/driver", + "//store/pdtypes", + "//table", + "//table/tables", + "//types", + "//util/collate", + "//util/mathutil", + "@com_github_coreos_go_semver//semver", + "@com_github_docker_go_units//:go-units", + "@com_github_google_uuid//:uuid", + "@com_github_jedib0t_go_pretty_v6//table", + "@com_github_jedib0t_go_pretty_v6//text", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_tipb//go-tipb", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_pd_client//:client", + "@org_golang_x_exp//maps", + "@org_golang_x_sync//errgroup", + "@org_uber_go_atomic//:atomic", + "@org_uber_go_multierr//:multierr", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "restore_test", + srcs = [ + "check_info_test.go", + "checksum_test.go", + "chunk_restore_test.go", + "meta_manager_test.go", + "restore_schema_test.go", + "restore_test.go", + "table_restore_test.go", + "tidb_test.go", + ], + embed = [":restore"], + deps = [ + "//br/pkg/lightning/backend", + "//br/pkg/lightning/backend/kv", + "//br/pkg/lightning/backend/noop", + "//br/pkg/lightning/backend/tidb", + "//br/pkg/lightning/checkpoints", + "//br/pkg/lightning/common", + "//br/pkg/lightning/config", + "//br/pkg/lightning/errormanager", + "//br/pkg/lightning/glue", + "//br/pkg/lightning/log", + "//br/pkg/lightning/metric", + "//br/pkg/lightning/mydump", + "//br/pkg/lightning/verification", + "//br/pkg/lightning/web", + "//br/pkg/lightning/worker", + "//br/pkg/mock", + "//br/pkg/storage", + "//br/pkg/version/build", + "//ddl", + "//errno", + "//kv", + "//parser", + "//parser/ast", + "//parser/model", + "//parser/mysql", + "//store/pdtypes", + "//table/tables", + "//types", + "//util", + "//util/mock", + "//util/table-filter", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_docker_go_units//:go-units", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_golang_mock//gomock", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_tipb//go-tipb", + "@com_github_stretchr_testify//require", + "@com_github_stretchr_testify//suite", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_pd_client//:client", + "@org_uber_go_atomic//:atomic", + "@org_uber_go_zap//:zap", + ], +) diff --git a/br/pkg/lightning/tikv/BUILD.bazel b/br/pkg/lightning/tikv/BUILD.bazel new file mode 100644 index 0000000000000..8de419abe3389 --- /dev/null +++ b/br/pkg/lightning/tikv/BUILD.bazel @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tikv", + srcs = ["tikv.go"], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/tikv", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/common", + "//br/pkg/lightning/log", + "//br/pkg/pdutil", + "//br/pkg/version", + "//parser/model", + "@com_github_coreos_go_semver//semver", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/debugpb", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_golang_x_sync//errgroup", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "tikv_test", + srcs = ["tikv_test.go"], + deps = [ + ":tikv", + "//br/pkg/lightning/common", + "@com_github_coreos_go_semver//semver", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@com_github_stretchr_testify//require", + ], +) diff --git a/br/pkg/lightning/verification/BUILD.bazel b/br/pkg/lightning/verification/BUILD.bazel new file mode 100644 index 0000000000000..daea16acd40dc --- /dev/null +++ b/br/pkg/lightning/verification/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "verification", + srcs = ["checksum.go"], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/verification", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/common", + "@org_uber_go_zap//zapcore", + ], +) + +go_test( + name = "verification_test", + srcs = ["checksum_test.go"], + deps = [ + ":verification", + "//br/pkg/lightning/common", + "@com_github_stretchr_testify//require", + ], +) diff --git a/br/pkg/lightning/web/BUILD.bazel b/br/pkg/lightning/web/BUILD.bazel new file mode 100644 index 0000000000000..842eb48fb3dd3 --- /dev/null +++ b/br/pkg/lightning/web/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "web", + srcs = [ + "progress.go", + "res.go", + "res_vfsdata.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/web", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/checkpoints", + "//br/pkg/lightning/common", + "//br/pkg/lightning/mydump", + "@com_github_pingcap_errors//:errors", + "@org_uber_go_atomic//:atomic", + ], +) diff --git a/br/pkg/lightning/worker/BUILD.bazel b/br/pkg/lightning/worker/BUILD.bazel new file mode 100644 index 0000000000000..77de52ee964cc --- /dev/null +++ b/br/pkg/lightning/worker/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "worker", + srcs = ["worker.go"], + importpath = "github.com/pingcap/tidb/br/pkg/lightning/worker", + visibility = ["//visibility:public"], + deps = ["//br/pkg/lightning/metric"], +) + +go_test( + name = "worker_test", + srcs = ["worker_test.go"], + deps = [ + ":worker", + "@com_github_stretchr_testify//require", + ], +) diff --git a/br/pkg/logutil/BUILD.bazel b/br/pkg/logutil/BUILD.bazel new file mode 100644 index 0000000000000..5a8df97911de6 --- /dev/null +++ b/br/pkg/logutil/BUILD.bazel @@ -0,0 +1,43 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "logutil", + srcs = [ + "context.go", + "logging.go", + "rate.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/logutil", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/metric", + "//br/pkg/redact", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_log//:log", + "@com_github_prometheus_client_golang//prometheus", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) + +go_test( + name = "logutil_test", + srcs = ["logging_test.go"], + deps = [ + ":logutil", + "//br/pkg/errors", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_prometheus_client_golang//prometheus", + "@com_github_stretchr_testify//require", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + "@org_uber_go_zap//zaptest/observer", + ], +) diff --git a/br/pkg/membuf/BUILD.bazel b/br/pkg/membuf/BUILD.bazel new file mode 100644 index 0000000000000..43bf5d6da93dc --- /dev/null +++ b/br/pkg/membuf/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "membuf", + srcs = ["buffer.go"], + importpath = "github.com/pingcap/tidb/br/pkg/membuf", + visibility = ["//visibility:public"], +) + +go_test( + name = "membuf_test", + srcs = ["buffer_test.go"], + embed = [":membuf"], + deps = ["@com_github_stretchr_testify//require"], +) diff --git a/br/pkg/metautil/BUILD.bazel b/br/pkg/metautil/BUILD.bazel new file mode 100644 index 0000000000000..4a325fbe49c13 --- /dev/null +++ b/br/pkg/metautil/BUILD.bazel @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "metautil", + srcs = ["metafile.go"], + importpath = "github.com/pingcap/tidb/br/pkg/metautil", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/errors", + "//br/pkg/logutil", + "//br/pkg/storage", + "//br/pkg/summary", + "//parser/model", + "//statistics/handle", + "//tablecodec", + "//util/encrypt", + "@com_github_docker_go_units//:go-units", + "@com_github_gogo_protobuf//proto", + "@com_github_opentracing_opentracing_go//:opentracing-go", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/encryptionpb", + "@com_github_pingcap_log//:log", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "metautil_test", + srcs = [ + "main_test.go", + "metafile_test.go", + ], + embed = [":metautil"], + deps = [ + "//br/pkg/mock/storage", + "//testkit/testsetup", + "@com_github_golang_mock//gomock", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/encryptionpb", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/br/pkg/mock/BUILD.bazel b/br/pkg/mock/BUILD.bazel new file mode 100644 index 0000000000000..04cbf93a6dd5b --- /dev/null +++ b/br/pkg/mock/BUILD.bazel @@ -0,0 +1,61 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "mock", + srcs = [ + "backend.go", + "glue.go", + "glue_checkpoint.go", + "importer.go", + "kv.go", + "mock_cluster.go", + "s3iface.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/mock", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/lightning/backend", + "//br/pkg/lightning/backend/kv", + "//br/pkg/lightning/checkpoints", + "//br/pkg/lightning/config", + "//br/pkg/lightning/glue", + "//br/pkg/lightning/log", + "//br/pkg/lightning/verification", + "//config", + "//domain", + "//kv", + "//parser", + "//parser/ast", + "//parser/model", + "//server", + "//session", + "//store/mockstore", + "//table", + "//types", + "//util/sqlexec", + "@com_github_aws_aws_sdk_go//aws/request", + "@com_github_aws_aws_sdk_go//service/s3", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_golang_mock//gomock", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/import_kvpb", + "@com_github_pingcap_log//:log", + "@com_github_tikv_client_go_v2//testutils", + "@com_github_tikv_client_go_v2//tikv", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//metadata", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "mock_test", + srcs = ["mock_cluster_test.go"], + deps = [ + ":mock", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/br/pkg/mock/mockid/BUILD.bazel b/br/pkg/mock/mockid/BUILD.bazel new file mode 100644 index 0000000000000..149fb0315f08f --- /dev/null +++ b/br/pkg/mock/mockid/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "mockid", + srcs = ["mockid.go"], + importpath = "github.com/pingcap/tidb/br/pkg/mock/mockid", + visibility = ["//visibility:public"], +) diff --git a/br/pkg/mock/storage/BUILD.bazel b/br/pkg/mock/storage/BUILD.bazel new file mode 100644 index 0000000000000..defc41fb3ef31 --- /dev/null +++ b/br/pkg/mock/storage/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "storage", + srcs = ["storage.go"], + importpath = "github.com/pingcap/tidb/br/pkg/mock/storage", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/storage", + "@com_github_golang_mock//gomock", + ], +) diff --git a/br/pkg/pdutil/BUILD.bazel b/br/pkg/pdutil/BUILD.bazel new file mode 100644 index 0000000000000..f2e997d3d833c --- /dev/null +++ b/br/pkg/pdutil/BUILD.bazel @@ -0,0 +1,47 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "pdutil", + srcs = [ + "pd.go", + "utils.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/pdutil", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/errors", + "//br/pkg/httputil", + "//br/pkg/lightning/common", + "//store/pdtypes", + "//tablecodec", + "//util/codec", + "@com_github_coreos_go_semver//semver", + "@com_github_docker_go_units//:go-units", + "@com_github_opentracing_opentracing_go//:opentracing-go", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_log//:log", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//:grpc", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "pdutil_test", + srcs = [ + "main_test.go", + "pd_serial_test.go", + ], + embed = [":pdutil"], + deps = [ + "//store/pdtypes", + "//testkit/testsetup", + "//util/codec", + "@com_github_coreos_go_semver//semver", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/br/pkg/redact/BUILD.bazel b/br/pkg/redact/BUILD.bazel new file mode 100644 index 0000000000000..90e747acbc261 --- /dev/null +++ b/br/pkg/redact/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "redact", + srcs = ["redact.go"], + importpath = "github.com/pingcap/tidb/br/pkg/redact", + visibility = ["//visibility:public"], + deps = ["@com_github_pingcap_errors//:errors"], +) + +go_test( + name = "redact_test", + srcs = ["redact_test.go"], + deps = [ + ":redact", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/br/pkg/restore/BUILD.bazel b/br/pkg/restore/BUILD.bazel new file mode 100644 index 0000000000000..94dd07ccb1384 --- /dev/null +++ b/br/pkg/restore/BUILD.bazel @@ -0,0 +1,145 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "restore", + srcs = [ + "batcher.go", + "client.go", + "db.go", + "import.go", + "import_retry.go", + "merge.go", + "pipeline_items.go", + "range.go", + "rawkv_client.go", + "split.go", + "split_client.go", + "stream_metas.go", + "systable_restore.go", + "util.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/restore", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/checksum", + "//br/pkg/conn", + "//br/pkg/errors", + "//br/pkg/glue", + "//br/pkg/httputil", + "//br/pkg/logutil", + "//br/pkg/metautil", + "//br/pkg/pdutil", + "//br/pkg/redact", + "//br/pkg/rtree", + "//br/pkg/storage", + "//br/pkg/stream", + "//br/pkg/summary", + "//br/pkg/utils", + "//ddl/util", + "//domain", + "//kv", + "//meta", + "//parser/model", + "//parser/mysql", + "//sessionctx/variable", + "//statistics/handle", + "//store/pdtypes", + "//tablecodec", + "//util/codec", + "//util/hack", + "//util/mathutil", + "//util/table-filter", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_google_uuid//:uuid", + "@com_github_opentracing_opentracing_go//:opentracing-go", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/errorpb", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@com_github_pingcap_kvproto//pkg/kvrpcpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_kvproto//pkg/pdpb", + "@com_github_pingcap_kvproto//pkg/tikvpb", + "@com_github_pingcap_log//:log", + "@com_github_tikv_client_go_v2//config", + "@com_github_tikv_client_go_v2//kv", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_client_go_v2//rawkv", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//backoff", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//credentials", + "@org_golang_google_grpc//keepalive", + "@org_golang_google_grpc//status", + "@org_golang_x_sync//errgroup", + "@org_uber_go_multierr//:multierr", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) + +go_test( + name = "restore_test", + srcs = [ + "batcher_test.go", + "client_test.go", + "db_test.go", + "import_retry_test.go", + "main_test.go", + "merge_fuzz_test.go", + "merge_test.go", + "range_test.go", + "rawkv_client_test.go", + "split_test.go", + "stream_metas_test.go", + "util_test.go", + ], + deps = [ + ":restore", + "//br/pkg/backup", + "//br/pkg/conn", + "//br/pkg/errors", + "//br/pkg/glue", + "//br/pkg/gluetidb", + "//br/pkg/logutil", + "//br/pkg/metautil", + "//br/pkg/mock", + "//br/pkg/rtree", + "//br/pkg/storage", + "//br/pkg/utils", + "//kv", + "//meta/autoid", + "//parser/model", + "//parser/mysql", + "//parser/types", + "//sessionctx/stmtctx", + "//store/pdtypes", + "//tablecodec", + "//testkit", + "//testkit/testsetup", + "//types", + "//util/codec", + "@com_github_golang_protobuf//proto", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/encryptionpb", + "@com_github_pingcap_kvproto//pkg/errorpb", + "@com_github_pingcap_kvproto//pkg/import_sstpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_kvproto//pkg/pdpb", + "@com_github_pingcap_log//:log", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_client_go_v2//rawkv", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//keepalive", + "@org_golang_google_grpc//status", + "@org_uber_go_goleak//:goleak", + "@org_uber_go_multierr//:multierr", + "@org_uber_go_zap//:zap", + ], +) diff --git a/br/pkg/rtree/BUILD.bazel b/br/pkg/rtree/BUILD.bazel new file mode 100644 index 0000000000000..5c5b0546ab03b --- /dev/null +++ b/br/pkg/rtree/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rtree", + srcs = [ + "logging.go", + "rtree.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/rtree", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/logutil", + "//br/pkg/redact", + "@com_github_google_btree//:btree", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_log//:log", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) + +go_test( + name = "rtree_test", + srcs = [ + "logging_test.go", + "main_test.go", + "rtree_test.go", + ], + deps = [ + ":rtree", + "//testkit/testsetup", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) diff --git a/br/pkg/storage/BUILD.bazel b/br/pkg/storage/BUILD.bazel new file mode 100644 index 0000000000000..775bf93f5e56d --- /dev/null +++ b/br/pkg/storage/BUILD.bazel @@ -0,0 +1,75 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "storage", + srcs = [ + "azblob.go", + "compress.go", + "flags.go", + "gcs.go", + "hdfs.go", + "local.go", + "local_unix.go", + "local_windows.go", + "noop.go", + "parse.go", + "s3.go", + "storage.go", + "writer.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/storage", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/errors", + "//br/pkg/logutil", + "@com_github_aliyun_alibaba_cloud_sdk_go//sdk/auth/credentials", + "@com_github_aliyun_alibaba_cloud_sdk_go//sdk/auth/credentials/providers", + "@com_github_aws_aws_sdk_go//aws", + "@com_github_aws_aws_sdk_go//aws/awserr", + "@com_github_aws_aws_sdk_go//aws/client", + "@com_github_aws_aws_sdk_go//aws/credentials", + "@com_github_aws_aws_sdk_go//aws/request", + "@com_github_aws_aws_sdk_go//aws/session", + "@com_github_aws_aws_sdk_go//service/s3", + "@com_github_aws_aws_sdk_go//service/s3/s3iface", + "@com_github_azure_azure_sdk_for_go_sdk_azidentity//:azidentity", + "@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//:azblob", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_log//:log", + "@com_github_spf13_pflag//:pflag", + "@com_google_cloud_go_storage//:storage", + "@org_golang_google_api//iterator", + "@org_golang_google_api//option", + "@org_golang_x_oauth2//google", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "storage_test", + srcs = [ + "azblob_test.go", + "compress_test.go", + "gcs_test.go", + "local_test.go", + "parse_test.go", + "s3_test.go", + "writer_test.go", + ], + embed = [":storage"], + deps = [ + "//br/pkg/mock", + "@com_github_aws_aws_sdk_go//aws", + "@com_github_aws_aws_sdk_go//aws/awserr", + "@com_github_aws_aws_sdk_go//aws/request", + "@com_github_aws_aws_sdk_go//service/s3", + "@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//:azblob", + "@com_github_fsouza_fake_gcs_server//fakestorage", + "@com_github_golang_mock//gomock", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_stretchr_testify//require", + ], +) diff --git a/br/pkg/stream/BUILD.bazel b/br/pkg/stream/BUILD.bazel new file mode 100644 index 0000000000000..7d2ac25a863c9 --- /dev/null +++ b/br/pkg/stream/BUILD.bazel @@ -0,0 +1,75 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "stream", + srcs = [ + "client.go", + "decode_kv.go", + "meta_kv.go", + "models.go", + "prefix_scanner.go", + "rewrite_meta_rawkv.go", + "stream_mgr.go", + "stream_status.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/stream", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/backup", + "//br/pkg/conn", + "//br/pkg/errors", + "//br/pkg/glue", + "//br/pkg/httputil", + "//br/pkg/logutil", + "//br/pkg/redact", + "//br/pkg/storage", + "//kv", + "//meta", + "//parser/model", + "//tablecodec", + "//util", + "//util/codec", + "//util/table-filter", + "@com_github_fatih_color//:color", + "@com_github_gogo_protobuf//proto", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_log//:log", + "@com_github_tikv_client_go_v2//kv", + "@com_github_tikv_client_go_v2//oracle", + "@io_etcd_go_etcd_client_v3//:client", + "@org_golang_x_sync//errgroup", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "stream_test", + srcs = [ + "decode_kv_test.go", + "integration_test.go", + "meta_kv_test.go", + "rewrite_meta_rawkv_test.go", + "stream_misc_test.go", + ], + embed = [":stream"], + deps = [ + "//br/pkg/errors", + "//br/pkg/logutil", + "//br/pkg/storage", + "//meta", + "//parser/model", + "//tablecodec", + "//util/codec", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_log//:log", + "@com_github_stretchr_testify//require", + "@com_github_tikv_client_go_v2//kv", + "@io_etcd_go_etcd_client_v3//:client", + "@io_etcd_go_etcd_server_v3//embed", + "@io_etcd_go_etcd_server_v3//mvcc", + "@org_uber_go_zap//:zap", + ], +) diff --git a/br/pkg/summary/BUILD.bazel b/br/pkg/summary/BUILD.bazel new file mode 100644 index 0000000000000..897dda0614a1f --- /dev/null +++ b/br/pkg/summary/BUILD.bazel @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "summary", + srcs = [ + "collector.go", + "summary.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/summary", + visibility = ["//visibility:public"], + deps = [ + "@com_github_docker_go_units//:go-units", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_log//:log", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "summary_test", + srcs = [ + "collector_test.go", + "main_test.go", + ], + embed = [":summary"], + deps = [ + "//testkit/testsetup", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + "@org_uber_go_zap//:zap", + ], +) diff --git a/br/pkg/task/BUILD.bazel b/br/pkg/task/BUILD.bazel new file mode 100644 index 0000000000000..12291d7fef005 --- /dev/null +++ b/br/pkg/task/BUILD.bazel @@ -0,0 +1,96 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "task", + srcs = [ + "backup.go", + "backup_raw.go", + "common.go", + "restore.go", + "restore_raw.go", + "stream.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/task", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/backup", + "//br/pkg/checksum", + "//br/pkg/conn", + "//br/pkg/errors", + "//br/pkg/glue", + "//br/pkg/httputil", + "//br/pkg/logutil", + "//br/pkg/metautil", + "//br/pkg/pdutil", + "//br/pkg/restore", + "//br/pkg/rtree", + "//br/pkg/storage", + "//br/pkg/stream", + "//br/pkg/summary", + "//br/pkg/utils", + "//br/pkg/version", + "//config", + "//kv", + "//parser/mysql", + "//sessionctx/stmtctx", + "//sessionctx/variable", + "//statistics/handle", + "//types", + "//util/mathutil", + "//util/table-filter", + "@com_github_docker_go_units//:go-units", + "@com_github_fatih_color//:color", + "@com_github_gogo_protobuf//proto", + "@com_github_opentracing_opentracing_go//:opentracing-go", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/encryptionpb", + "@com_github_pingcap_log//:log", + "@com_github_spf13_cobra//:cobra", + "@com_github_spf13_pflag//:pflag", + "@com_github_tikv_client_go_v2//config", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_pd_client//:client", + "@com_google_cloud_go_storage//:storage", + "@io_etcd_go_etcd_client_pkg_v3//transport", + "@io_etcd_go_etcd_client_v3//:client", + "@org_golang_google_grpc//:grpc", + "@org_golang_google_grpc//keepalive", + "@org_uber_go_multierr//:multierr", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) + +go_test( + name = "task_test", + srcs = [ + "backup_test.go", + "common_test.go", + "restore_test.go", + "stream_test.go", + ], + embed = [":task"], + deps = [ + "//br/pkg/conn", + "//br/pkg/metautil", + "//br/pkg/pdutil", + "//br/pkg/restore", + "//br/pkg/storage", + "//br/pkg/utils", + "//config", + "//parser/model", + "//statistics/handle", + "//tablecodec", + "@com_github_golang_protobuf//proto", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/encryptionpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_spf13_pflag//:pflag", + "@com_github_stretchr_testify//require", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_pd_client//:client", + ], +) diff --git a/br/pkg/trace/BUILD.bazel b/br/pkg/trace/BUILD.bazel new file mode 100644 index 0000000000000..f02690cdb63ab --- /dev/null +++ b/br/pkg/trace/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "trace", + srcs = ["tracing.go"], + importpath = "github.com/pingcap/tidb/br/pkg/trace", + visibility = ["//visibility:public"], + deps = [ + "@com_github_cheynewallace_tabby//:tabby", + "@com_github_opentracing_opentracing_go//:opentracing-go", + "@com_github_pingcap_log//:log", + "@com_sourcegraph_sourcegraph_appdash//:appdash", + "@com_sourcegraph_sourcegraph_appdash//opentracing", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "trace_test", + srcs = [ + "main_test.go", + "tracing_serial_test.go", + ], + embed = [":trace"], + deps = [ + "//testkit/testsetup", + "@com_github_opentracing_opentracing_go//:opentracing-go", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/br/pkg/utils/BUILD.bazel b/br/pkg/utils/BUILD.bazel new file mode 100644 index 0000000000000..a000479c29696 --- /dev/null +++ b/br/pkg/utils/BUILD.bazel @@ -0,0 +1,83 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "utils", + srcs = [ + "backoff.go", + "db.go", + "dyn_pprof_other.go", + "dyn_pprof_unix.go", + "env.go", + "json.go", + "key.go", + "math.go", + "permission.go", + "pprof.go", + "progress.go", + "retry.go", + "safe_point.go", + "schema.go", + "worker.go", + ], + importpath = "github.com/pingcap/tidb/br/pkg/utils", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/errors", + "//br/pkg/metautil", + "//errno", + "//parser/model", + "//parser/mysql", + "//parser/terror", + "//util", + "@com_github_cheggaaa_pb_v3//:pb", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_log//:log", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_golang_x_net//http/httpproxy", + "@org_golang_x_sync//errgroup", + "@org_uber_go_multierr//:multierr", + "@org_uber_go_zap//:zap", + "@org_uber_go_zap//zapcore", + ], +) + +go_test( + name = "utils_test", + srcs = [ + "backoff_test.go", + "env_test.go", + "json_test.go", + "key_test.go", + "main_test.go", + "math_test.go", + "progress_test.go", + "safe_point_test.go", + "schema_test.go", + ], + embed = [":utils"], + deps = [ + "//br/pkg/errors", + "//br/pkg/metautil", + "//br/pkg/storage", + "//parser/model", + "//statistics/handle", + "//tablecodec", + "//testkit/testsetup", + "@com_github_golang_protobuf//proto", + "@com_github_pingcap_kvproto//pkg/brpb", + "@com_github_pingcap_kvproto//pkg/encryptionpb", + "@com_github_stretchr_testify//require", + "@com_github_tikv_pd_client//:client", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", + "@org_uber_go_goleak//:goleak", + "@org_uber_go_multierr//:multierr", + ], +) diff --git a/br/pkg/version/BUILD.bazel b/br/pkg/version/BUILD.bazel new file mode 100644 index 0000000000000..26bbda74a0d32 --- /dev/null +++ b/br/pkg/version/BUILD.bazel @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "version", + srcs = ["version.go"], + importpath = "github.com/pingcap/tidb/br/pkg/version", + visibility = ["//visibility:public"], + deps = [ + "//br/pkg/errors", + "//br/pkg/logutil", + "//br/pkg/utils", + "//br/pkg/version/build", + "@com_github_coreos_go_semver//semver", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_log//:log", + "@com_github_tikv_pd_client//:client", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "version_test", + srcs = ["version_test.go"], + embed = [":version"], + deps = [ + "//br/pkg/version/build", + "@com_github_coreos_go_semver//semver", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_stretchr_testify//require", + "@com_github_tikv_pd_client//:client", + ], +) diff --git a/br/pkg/version/build/BUILD.bazel b/br/pkg/version/build/BUILD.bazel new file mode 100644 index 0000000000000..87fc4fa0efd9e --- /dev/null +++ b/br/pkg/version/build/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "build", + srcs = ["info.go"], + importpath = "github.com/pingcap/tidb/br/pkg/version/build", + visibility = ["//visibility:public"], + deps = [ + "//parser/mysql", + "//util/israce", + "//util/versioninfo", + "@com_github_pingcap_log//:log", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "build_test", + srcs = ["info_test.go"], + embed = [":build"], + deps = ["@com_github_stretchr_testify//require"], +) diff --git a/br/tests/br_gcs/BUILD.bazel b/br/tests/br_gcs/BUILD.bazel new file mode 100644 index 0000000000000..b6ebf428740e3 --- /dev/null +++ b/br/tests/br_gcs/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "br_gcs_lib", + srcs = ["oauth.go"], + importpath = "github.com/pingcap/tidb/br/tests/br_gcs", + visibility = ["//visibility:private"], +) + +go_binary( + name = "br_gcs", + embed = [":br_gcs_lib"], + visibility = ["//visibility:public"], +) diff --git a/br/tests/br_key_locked/BUILD.bazel b/br/tests/br_key_locked/BUILD.bazel new file mode 100644 index 0000000000000..a6e6a40edf2f2 --- /dev/null +++ b/br/tests/br_key_locked/BUILD.bazel @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "br_key_locked_lib", + srcs = [ + "codec.go", + "locker.go", + ], + importpath = "github.com/pingcap/tidb/br/tests/br_key_locked", + visibility = ["//visibility:private"], + deps = [ + "//br/pkg/httputil", + "//br/pkg/task", + "//config", + "//kv", + "//parser/model", + "//store/driver", + "//tablecodec", + "//util/codec", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_kvproto//pkg/kvrpcpb", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_pingcap_log//:log", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_client_go_v2//tikv", + "@com_github_tikv_client_go_v2//tikvrpc", + "@com_github_tikv_pd_client//:client", + "@org_uber_go_zap//:zap", + ], +) + +go_binary( + name = "br_key_locked", + embed = [":br_key_locked_lib"], + visibility = ["//visibility:public"], +) diff --git a/br/tests/br_rawkv/BUILD.bazel b/br/tests/br_rawkv/BUILD.bazel new file mode 100644 index 0000000000000..f4153a1651d98 --- /dev/null +++ b/br/tests/br_rawkv/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "br_rawkv_lib", + srcs = ["client.go"], + importpath = "github.com/pingcap/tidb/br/tests/br_rawkv", + visibility = ["//visibility:private"], + deps = [ + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_log//:log", + "@com_github_tikv_client_go_v2//config", + "@com_github_tikv_client_go_v2//rawkv", + "@org_uber_go_zap//:zap", + ], +) + +go_binary( + name = "br_rawkv", + embed = [":br_rawkv_lib"], + visibility = ["//visibility:public"], +) diff --git a/br/tests/br_z_gc_safepoint/BUILD.bazel b/br/tests/br_z_gc_safepoint/BUILD.bazel new file mode 100644 index 0000000000000..4afb866ddc690 --- /dev/null +++ b/br/tests/br_z_gc_safepoint/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "br_z_gc_safepoint_lib", + srcs = ["gc.go"], + importpath = "github.com/pingcap/tidb/br/tests/br_z_gc_safepoint", + visibility = ["//visibility:private"], + deps = [ + "@com_github_pingcap_log//:log", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_pd_client//:client", + "@org_uber_go_zap//:zap", + ], +) + +go_binary( + name = "br_z_gc_safepoint", + embed = [":br_z_gc_safepoint_lib"], + visibility = ["//visibility:public"], +) diff --git a/br/tests/lightning_checkpoint_parquet/BUILD.bazel b/br/tests/lightning_checkpoint_parquet/BUILD.bazel new file mode 100644 index 0000000000000..ee879d2d67c1b --- /dev/null +++ b/br/tests/lightning_checkpoint_parquet/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "lightning_checkpoint_parquet_lib", + srcs = ["parquet.go"], + importpath = "github.com/pingcap/tidb/br/tests/lightning_checkpoint_parquet", + visibility = ["//visibility:private"], + deps = [ + "@com_github_xitongsys_parquet_go//writer", + "@com_github_xitongsys_parquet_go_source//local", + ], +) + +go_binary( + name = "lightning_checkpoint_parquet", + embed = [":lightning_checkpoint_parquet_lib"], + visibility = ["//visibility:public"], +) diff --git a/build/BUILD.bazel b/build/BUILD.bazel new file mode 100644 index 0000000000000..3954f745589c1 --- /dev/null +++ b/build/BUILD.bazel @@ -0,0 +1,7 @@ +package(default_visibility = ["//visibility:public"]) + +filegroup( + name = "all_patches", + srcs = glob(["*.patch"]), + visibility = ["//visibility:public"], +) diff --git a/build/jenkins_unit_test.sh b/build/jenkins_unit_test.sh new file mode 100755 index 0000000000000..a3b17f3a3eaae --- /dev/null +++ b/build/jenkins_unit_test.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Copyright 2022 PingCAP, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This test is used to test compatible for BR restore. +# It will download backup data from internal file server. +# And make sure these backup data can restore through newly BR tools to newly cluster. + +set -o pipefail + +make bazel_coverage_test +EXIT_STATUS=$? +# collect the junit and coverage report +bazel_collect +mkdir -p test_coverage +mv bazel.xml test_coverage/bazel.xml +exit ${EXIT_STATUS} diff --git a/build/patches/BUILD.bazel b/build/patches/BUILD.bazel new file mode 100644 index 0000000000000..9cc646793da3d --- /dev/null +++ b/build/patches/BUILD.bazel @@ -0,0 +1,5 @@ +filegroup( + name = "all_patches", + srcs = glob(["*.patch"]), + visibility = ["//visibility:public"], +) diff --git a/build/patches/com_github_golang_protobuf.patch b/build/patches/com_github_golang_protobuf.patch new file mode 100644 index 0000000000000..41f0137881a67 --- /dev/null +++ b/build/patches/com_github_golang_protobuf.patch @@ -0,0 +1,12 @@ +diff -urN a/descriptor/BUILD.bazel b/descriptor/BUILD.bazel +--- a/descriptor/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500 ++++ b/descriptor/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -21,7 +21,7 @@ + visibility = ["//visibility:public"], + deps = [ + "//proto:go_default_library", +- "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", ++ "@com_github_golang_protobuf//protoc-gen-go/descriptor:go_default_library", + "@org_golang_google_protobuf//reflect/protodesc:go_default_library", + "@org_golang_google_protobuf//reflect/protoreflect:go_default_library", + "@org_golang_google_protobuf//runtime/protoimpl:go_default_library", diff --git a/build/patches/com_github_grpc_ecosystem_grpc_gateway.patch b/build/patches/com_github_grpc_ecosystem_grpc_gateway.patch new file mode 100644 index 0000000000000..62e17eebceaea --- /dev/null +++ b/build/patches/com_github_grpc_ecosystem_grpc_gateway.patch @@ -0,0 +1,73 @@ +diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel +index 5242751fb..b3b6fa842 100644 +--- a/internal/BUILD.bazel ++++ b/internal/BUILD.bazel +@@ -4,20 +4,12 @@ load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") + + package(default_visibility = ["//visibility:public"]) + +-proto_library( +- name = "internal_proto", +- srcs = ["errors.proto"], +- deps = ["@com_google_protobuf//:any_proto"], +-) +- +-go_proto_library( +- name = "internal_go_proto", +- importpath = "github.com/grpc-ecosystem/grpc-gateway/internal", +- proto = ":internal_proto", +-) +- + go_library( + name = "go_default_library", +- embed = [":internal_go_proto"], ++ srcs = ["errors.pb.go"], ++ deps = [ ++ "@com_github_golang_protobuf//proto:go_default_library", ++ "@com_github_golang_protobuf//ptypes/any:go_default_library", ++ ], + importpath = "github.com/grpc-ecosystem/grpc-gateway/internal", + ) +diff --git a/protoc-gen-grpc-gateway/descriptor/BUILD.bazel b/protoc-gen-grpc-gateway/descriptor/BUILD.bazel +index 02aa7d2a8..fd922a156 100644 +--- a/protoc-gen-grpc-gateway/descriptor/BUILD.bazel ++++ b/protoc-gen-grpc-gateway/descriptor/BUILD.bazel +@@ -19,8 +19,8 @@ go_library( + "@com_github_golang_glog//:go_default_library", + "@com_github_golang_protobuf//jsonpb:go_default_library_gen", + "@com_github_golang_protobuf//proto:go_default_library", +- "@go_googleapis//google/api:annotations_go_proto", ++ "@com_github_golang_protobuf//protoc-gen-go/descriptor:go_default_library", + "@io_bazel_rules_go//proto/wkt:compiler_plugin_go_proto", +- "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", ++ "@org_golang_google_genproto//googleapis/api/annotations:go_default_library", + ], + ) + +diff --git a/runtime/BUILD.bazel b/runtime/BUILD.bazel +index c4d18f624..41d5319fb 100644 +--- a/runtime/BUILD.bazel ++++ b/runtime/BUILD.bazel +@@ -30,13 +30,14 @@ go_library( +- "@com_github_golang_protobuf//descriptor:go_default_library_gen", ++ "@com_github_golang_protobuf//descriptor:descriptor", + "@com_github_golang_protobuf//jsonpb:go_default_library_gen", + "@com_github_golang_protobuf//proto:go_default_library", +- "@go_googleapis//google/api:httpbody_go_proto", +- "@io_bazel_rules_go//proto/wkt:any_go_proto", +- "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", +- "@io_bazel_rules_go//proto/wkt:duration_go_proto", +- "@io_bazel_rules_go//proto/wkt:field_mask_go_proto", +- "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", +- "@io_bazel_rules_go//proto/wkt:wrappers_go_proto", ++ "@com_github_golang_protobuf//protoc-gen-go/descriptor:go_default_library", ++ "@com_github_golang_protobuf//ptypes:go_default_library", ++ "@com_github_golang_protobuf//ptypes/any:go_default_library", ++ "@com_github_golang_protobuf//ptypes/duration:go_default_library", ++ "@com_github_golang_protobuf//ptypes/timestamp:go_default_library", ++ "@com_github_golang_protobuf//ptypes/wrappers:go_default_library", ++ "@org_golang_google_genproto//googleapis/api/httpbody:go_default_library", ++ "@org_golang_google_genproto//protobuf/field_mask:go_default_library", + "@org_golang_google_grpc//codes:go_default_library", + "@org_golang_google_grpc//grpclog:go_default_library", + "@org_golang_google_grpc//metadata:go_default_library", diff --git a/build/patches/io_etcd_go_etcd_api_v3.patch b/build/patches/io_etcd_go_etcd_api_v3.patch new file mode 100644 index 0000000000000..becde9e5eb6e1 --- /dev/null +++ b/build/patches/io_etcd_go_etcd_api_v3.patch @@ -0,0 +1,24 @@ +diff -uprN old/io_etcd_go_etcd_api_v3/etcdserverpb/BUILD.bazel new/io_etcd_go_etcd_api_v3/etcdserverpb/BUILD.bazel +--- old/io_etcd_go_etcd_api_v3/etcdserverpb/BUILD.bazel 2022-04-12 02:09:57.000000000 +0800 ++++ new/io_etcd_go_etcd_api_v3/etcdserverpb/BUILD.bazel 2022-04-12 02:12:31.000000000 +0800 +@@ -17,7 +17,7 @@ go_library( + "//mvccpb", + "@com_github_gogo_protobuf//gogoproto", + "@com_github_golang_protobuf//proto:go_default_library", +- "@go_googleapis//google/api:annotations_go_proto", ++ "@org_golang_google_genproto//googleapis/api/annotations:annotations", + "@org_golang_google_grpc//:go_default_library", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//status", +diff -uprN old/io_etcd_go_etcd_api_v3/etcdserverpb/gw/BUILD.bazel new/io_etcd_go_etcd_api_v3/etcdserverpb/gw/BUILD.bazel +--- old/io_etcd_go_etcd_api_v3/etcdserverpb/gw/BUILD.bazel 2022-04-12 02:12:01.000000000 +0800 ++++ new/io_etcd_go_etcd_api_v3/etcdserverpb/gw/BUILD.bazel 2022-04-12 02:09:59.000000000 +0800 +@@ -8,7 +8,7 @@ go_library( + visibility = ["//visibility:public"], + deps = [ + "//etcdserverpb", +- "@com_github_golang_protobuf//descriptor:go_default_library_gen", ++ "@com_github_golang_protobuf//descriptor:descriptor", + "@com_github_golang_protobuf//proto:go_default_library", + "@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library", + "@com_github_grpc_ecosystem_grpc_gateway//utilities:go_default_library", diff --git a/build/patches/io_etcd_go_etcd_raft_v3.patch b/build/patches/io_etcd_go_etcd_raft_v3.patch new file mode 100644 index 0000000000000..11c777b38f4de --- /dev/null +++ b/build/patches/io_etcd_go_etcd_raft_v3.patch @@ -0,0 +1,22 @@ +diff -urN a/raftpb/BUILD.bazel b/raftpb/BUILD.bazel +--- a/raftpb/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500 ++++ b/raftpb/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000 +@@ -1,4 +1,5 @@ + load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") ++load("@rules_proto//proto:defs.bzl", "proto_library") + + go_library( + name = "raftpb", +@@ -28,3 +29,12 @@ + srcs = ["confstate_test.go"], + embed = [":raftpb"], + ) ++ ++# keep ++proto_library( ++ name = "raftpb_proto", ++ srcs = ["raft.proto"], ++ deps = ["@com_github_gogo_protobuf//gogoproto:gogo_proto"], ++ import_prefix = "etcd/raft/v3/", ++ visibility = ["//visibility:public"], ++) diff --git a/build/patches/io_etcd_go_etcd_server_v3.patch b/build/patches/io_etcd_go_etcd_server_v3.patch new file mode 100644 index 0000000000000..84b9e31a78577 --- /dev/null +++ b/build/patches/io_etcd_go_etcd_server_v3.patch @@ -0,0 +1,12 @@ +diff -urN a/etcdserver/api/v3election/v3electionpb/gw/BUILD.bazel b/etcdserver/api/v3election/v3electionpb/gw/BUILD.bazel +--- old/etcdserver/api/v3election/v3electionpb/gw/BUILD.bazel 2022-04-12 01:52:44.000000000 +0800 ++++ new/etcdserver/api/v3election/v3electionpb/gw/BUILD.bazel 2022-04-12 01:53:38.000000000 +0800 +@@ -8,7 +8,7 @@ go_library( + visibility = ["//visibility:public"], + deps = [ + "//etcdserver/api/v3election/v3electionpb", +- "@com_github_golang_protobuf//descriptor:go_default_library_gen", ++ "@com_github_golang_protobuf//descriptor:descriptor", + "@com_github_golang_protobuf//proto:go_default_library", + "@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library", + "@com_github_grpc_ecosystem_grpc_gateway//utilities:go_default_library", diff --git a/build/print-workspace-status.sh b/build/print-workspace-status.sh new file mode 100755 index 0000000000000..dd2bd490812c7 --- /dev/null +++ b/build/print-workspace-status.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# +# Copyright 2022 PingCAP, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This test is used to test compatible for BR restore. +# It will download backup data from internal file server. +# And make sure these backup data can restore through newly BR tools to newly cluster. + +set -o errexit +set -o nounset +set -o pipefail + +TiDB_RELEASE_VERSION=$(git describe --tags --dirty --always) +TiDB_BUILD_UTCTIME=$(date -u '+%Y-%m-%d %H:%M:%S') +TIDB_GIT_HASH=$(git rev-parse HEAD) +TIDB_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) +TIDB_EDITION=${TIDB_EDITION:-Community} + +cat <"}) } -func TestShowHistogramsInFlight(t *testing.T) { - store, clean := testkit.CreateMockStore(t) - defer clean() - - tk := testkit.NewTestKit(t, store) - tk.MustExec("use test") - result := tk.MustQuery("show histograms_in_flight") - rows := result.Rows() - require.Len(t, rows, 1) - require.Equal(t, rows[0][0], "0") -} - func TestShowAnalyzeStatus(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() diff --git a/executor/showtest/BUILD.bazel b/executor/showtest/BUILD.bazel new file mode 100644 index 0000000000000..56597df5c87fa --- /dev/null +++ b/executor/showtest/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") + +go_test( + name = "showtest_test", + srcs = [ + "main_test.go", + "show_test.go", + ], + deps = [ + "//config", + "//executor", + "//infoschema", + "//meta/autoid", + "//parser/auth", + "//parser/model", + "//parser/mysql", + "//parser/types", + "//planner/core", + "//privilege/privileges", + "//session", + "//sessionctx/variable", + "//testkit", + "//types", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_stretchr_testify//require", + "@com_github_tikv_client_go_v2//tikv", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/executor/showtest/main_test.go b/executor/showtest/main_test.go new file mode 100644 index 0000000000000..a2adb05fae390 --- /dev/null +++ b/executor/showtest/main_test.go @@ -0,0 +1,44 @@ +// Copyright 2021 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package showtest + +import ( + "testing" + + "github.com/pingcap/tidb/config" + "github.com/pingcap/tidb/meta/autoid" + "github.com/tikv/client-go/v2/tikv" + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + autoid.SetStep(5000) + config.UpdateGlobal(func(conf *config.Config) { + conf.Log.SlowThreshold = 30000 // 30s + conf.TiKVClient.AsyncCommit.SafeWindow = 0 + conf.TiKVClient.AsyncCommit.AllowedClockDrift = 0 + conf.Experimental.AllowsExpressionIndex = true + }) + tikv.EnableFailpoints() + + opts := []goleak.Option{ + goleak.IgnoreTopFunction("github.com/golang/glog.(*loggingT).flushDaemon"), + goleak.IgnoreTopFunction("go.etcd.io/etcd/client/pkg/v3/logutil.(*MergeLogger).outputLoop"), + goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"), + goleak.IgnoreTopFunction("gopkg.in/natefinch/lumberjack%2ev2.(*Logger).millRun"), + goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/txnkv/transaction.keepAlive"), + } + goleak.VerifyTestMain(m, opts...) +} diff --git a/executor/show_test.go b/executor/showtest/show_test.go similarity index 99% rename from executor/show_test.go rename to executor/showtest/show_test.go index 2963022c21567..0993505d9ad8a 100644 --- a/executor/show_test.go +++ b/executor/showtest/show_test.go @@ -1,4 +1,4 @@ -// Copyright 2016 PingCAP, Inc. +// Copyright 2020 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package executor_test +package showtest import ( "context" @@ -36,1155 +36,1168 @@ import ( "github.com/stretchr/testify/require" ) -func TestShowVisibility(t *testing.T) { +func TestShowHistogramsInFlight(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() - tk := testkit.NewTestKit(t, store) - tk.MustExec("create database showdatabase") - tk.MustExec("use showdatabase") - tk.MustExec("create table t1 (id int)") - tk.MustExec("create table t2 (id int)") - tk.MustExec(`create user 'show'@'%'`) - - tk1 := testkit.NewTestKit(t, store) - require.True(t, tk1.Session().Auth(&auth.UserIdentity{Username: "show", Hostname: "%"}, nil, nil)) - - // No ShowDatabases privilege, this user would see nothing except INFORMATION_SCHEMA. - tk.MustQuery("show databases").Check(testkit.Rows("INFORMATION_SCHEMA")) - - // After grant, the user can see the database. - tk.MustExec(`grant select on showdatabase.t1 to 'show'@'%'`) - tk1.MustQuery("show databases").Check(testkit.Rows("INFORMATION_SCHEMA", "showdatabase")) - - // The user can see t1 but not t2. - tk1.MustExec("use showdatabase") - tk1.MustQuery("show tables").Check(testkit.Rows("t1")) - - // After revoke, show database result should be just except INFORMATION_SCHEMA. - tk.MustExec(`revoke select on showdatabase.t1 from 'show'@'%'`) - tk1.MustQuery("show databases").Check(testkit.Rows("INFORMATION_SCHEMA")) - - // Grant any global privilege would make show databases available. - tk.MustExec(`grant CREATE on *.* to 'show'@'%'`) - rows := tk1.MustQuery("show databases").Rows() - require.GreaterOrEqual(t, len(rows), 2) - tk.MustExec(`drop user 'show'@'%'`) - tk.MustExec("drop database showdatabase") + tk := testkit.NewTestKit(t, store) + tk.MustExec("use test") + result := tk.MustQuery("show histograms_in_flight") + rows := result.Rows() + require.Len(t, rows, 1) + require.Equal(t, rows[0][0], "0") } -func TestShowDatabasesInfoSchemaFirst(t *testing.T) { +func TestShowOpenTables(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) - tk.MustQuery("show databases").Check(testkit.Rows("INFORMATION_SCHEMA")) - tk.MustExec(`create user 'show'@'%'`) - - tk.MustExec(`create database AAAA`) - tk.MustExec(`create database BBBB`) - tk.MustExec(`grant select on AAAA.* to 'show'@'%'`) - tk.MustExec(`grant select on BBBB.* to 'show'@'%'`) - - tk1 := testkit.NewTestKit(t, store) - require.True(t, tk1.Session().Auth(&auth.UserIdentity{Username: "show", Hostname: "%"}, nil, nil)) - tk1.MustQuery("show databases").Check(testkit.Rows("INFORMATION_SCHEMA", "AAAA", "BBBB")) - - tk.MustExec(`drop user 'show'@'%'`) - tk.MustExec(`drop database AAAA`) - tk.MustExec(`drop database BBBB`) + tk.MustQuery("show open tables") + tk.MustQuery("show open tables in test") } -func TestShowWarnings(t *testing.T) { +func TestShowCreateViewDefiner(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) - tk.MustExec("use test") - testSQL := `create table if not exists show_warnings (a int)` - tk.MustExec(testSQL) - tk.MustExec("set @@sql_mode=''") - tk.MustExec("insert show_warnings values ('a')") - require.Equal(t, uint16(1), tk.Session().GetSessionVars().StmtCtx.WarningCount()) - tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1292|Truncated incorrect DOUBLE value: 'a'")) - require.Equal(t, uint16(0), tk.Session().GetSessionVars().StmtCtx.WarningCount()) - tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1292|Truncated incorrect DOUBLE value: 'a'")) - require.Equal(t, uint16(0), tk.Session().GetSessionVars().StmtCtx.WarningCount()) - - // Test Warning level 'Error' - testSQL = `create table show_warnings (a int)` - _, _ = tk.Exec(testSQL) - // FIXME: Table 'test.show_warnings' already exists - require.Equal(t, uint16(1), tk.Session().GetSessionVars().StmtCtx.WarningCount()) - tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Error|1050|Table 'test.show_warnings' already exists")) - tk.MustQuery("select @@error_count").Check(testkit.RowsWithSep("|", "1")) + require.True(t, tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "%", AuthUsername: "root", AuthHostname: "%"}, nil, nil)) - // Test Warning level 'Note' - testSQL = `create table show_warnings_2 (a int)` - tk.MustExec(testSQL) - testSQL = `create table if not exists show_warnings_2 like show_warnings` - _, err := tk.Exec(testSQL) - require.NoError(t, err) - require.Equal(t, uint16(1), tk.Session().GetSessionVars().StmtCtx.WarningCount()) - tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Note|1050|Table 'test.show_warnings_2' already exists")) - tk.MustQuery("select @@warning_count").Check(testkit.RowsWithSep("|", "1")) - tk.MustQuery("select @@warning_count").Check(testkit.RowsWithSep("|", "0")) + tk.MustExec("use test") + tk.MustExec("create or replace view v1 as select 1") + tk.MustQuery("show create view v1").Check(testkit.RowsWithSep("|", "v1|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v1` (`1`) AS SELECT 1 AS `1`|utf8mb4|utf8mb4_bin")) + tk.MustExec("drop view v1") } -func TestShowErrors(t *testing.T) { +func TestShowCreateTable(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) - tk.MustExec("use test") - testSQL := `create table if not exists show_errors (a int)` - tk.MustExec(testSQL) - testSQL = `create table show_errors (a int)` - // FIXME: 'test.show_errors' already exists - _, _ = tk.Exec(testSQL) - - tk.MustQuery("show errors").Check(testkit.RowsWithSep("|", "Error|1050|Table 'test.show_errors' already exists")) - - // eliminate previous errors - tk.MustExec("select 1") - _, _ = tk.Exec("create invalid") - tk.MustQuery("show errors").Check(testkit.RowsWithSep("|", "Error|1064|You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 14 near \"invalid\" ")) -} -func TestShowWarningsForExprPushdown(t *testing.T) { - store, dom, clean := testkit.CreateMockStoreAndDomain(t) - defer clean() - tk := testkit.NewTestKit(t, store) tk.MustExec("use test") - testSQL := `create table if not exists show_warnings_expr_pushdown (a int, value date)` - tk.MustExec(testSQL) + tk.MustExec("drop table if exists t1") + tk.MustExec("create table t1(a int,b int)") + tk.MustExec("drop view if exists v1") + tk.MustExec("create or replace definer=`root`@`127.0.0.1` view v1 as select * from t1") + tk.MustQuery("show create table v1").Check(testkit.RowsWithSep("|", "v1|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `v1` (`a`, `b`) AS SELECT `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` FROM `test`.`t1`|utf8mb4|utf8mb4_bin")) + tk.MustQuery("show create view v1").Check(testkit.RowsWithSep("|", "v1|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `v1` (`a`, `b`) AS SELECT `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` FROM `test`.`t1`|utf8mb4|utf8mb4_bin")) + tk.MustExec("drop view v1") + tk.MustExec("drop table t1") - // create tiflash replica - { - is := dom.InfoSchema() - db, exists := is.SchemaByName(model.NewCIStr("test")) - require.True(t, exists) - for _, tblInfo := range db.Tables { - if tblInfo.Name.L == "show_warnings_expr_pushdown" { - tblInfo.TiFlashReplica = &model.TiFlashReplicaInfo{ - Count: 1, - Available: true, - } - } - } - } - tk.MustExec("set tidb_allow_mpp=0") - tk.MustExec("explain select * from show_warnings_expr_pushdown t where md5(value) = '2020-01-01'") - require.Equal(t, uint16(1), tk.Session().GetSessionVars().StmtCtx.WarningCount()) - tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1105|Scalar function 'md5'(signature: MD5, return type: var_string(32)) is not supported to push down to tiflash now.")) - tk.MustExec("explain select max(md5(value)) from show_warnings_expr_pushdown group by a") - require.Equal(t, uint16(2), tk.Session().GetSessionVars().StmtCtx.WarningCount()) - tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1105|Scalar function 'md5'(signature: MD5, return type: var_string(32)) is not supported to push down to tiflash now.", "Warning|1105|Aggregation can not be pushed to tiflash because arguments of AggFunc `max` contains unsupported exprs")) - tk.MustExec("explain select max(a) from show_warnings_expr_pushdown group by md5(value)") - require.Equal(t, uint16(2), tk.Session().GetSessionVars().StmtCtx.WarningCount()) - tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1105|Scalar function 'md5'(signature: MD5, return type: var_string(32)) is not supported to push down to tiflash now.", "Warning|1105|Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs")) - tk.MustExec("set tidb_opt_distinct_agg_push_down=0") - tk.MustExec("explain select max(distinct a) from show_warnings_expr_pushdown group by value") - require.Equal(t, uint16(0), tk.Session().GetSessionVars().StmtCtx.WarningCount()) - // tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1105|Aggregation can not be pushed to storage layer in non-mpp mode because it contains agg function with distinct")) -} + tk.MustExec("drop view if exists v") + tk.MustExec("create or replace definer=`root`@`127.0.0.1` view v as select JSON_MERGE('{}', '{}') as col;") + tk.MustQuery("show create view v").Check(testkit.RowsWithSep("|", "v|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `v` (`col`) AS SELECT JSON_MERGE(_UTF8MB4'{}', _UTF8MB4'{}') AS `col`|utf8mb4|utf8mb4_bin")) + tk.MustExec("drop view if exists v") -func TestShowGrantsPrivilege(t *testing.T) { - store, clean := testkit.CreateMockStore(t) - defer clean() - tk := testkit.NewTestKit(t, store) - tk.MustExec("create user show_grants") - tk.MustExec("show grants for show_grants") - tk1 := testkit.NewTestKit(t, store) - require.True(t, tk1.Session().Auth(&auth.UserIdentity{Username: "show_grants", Hostname: "%"}, nil, nil)) - err := tk1.QueryToErr("show grants for root") - require.EqualError(t, executor.ErrDBaccessDenied.GenWithStackByArgs("show_grants", "%", mysql.SystemDB), err.Error()) - // Test show grants for user with auth host name `%`. - tk2 := testkit.NewTestKit(t, store) - require.True(t, tk2.Session().Auth(&auth.UserIdentity{Username: "show_grants", Hostname: "127.0.0.1", AuthUsername: "show_grants", AuthHostname: "%"}, nil, nil)) - tk2.MustQuery("show grants") -} + tk.MustExec("drop table if exists t1") + tk.MustExec("create table t1(a int,b int)") + tk.MustExec("create or replace definer=`root`@`127.0.0.1` view v1 as select avg(a),t1.* from t1 group by a") + tk.MustQuery("show create view v1").Check(testkit.RowsWithSep("|", "v1|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `v1` (`avg(a)`, `a`, `b`) AS SELECT AVG(`a`) AS `avg(a)`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` FROM `test`.`t1` GROUP BY `a`|utf8mb4|utf8mb4_bin")) + tk.MustExec("drop view v1") + tk.MustExec("create or replace definer=`root`@`127.0.0.1` view v1 as select a+b, t1.* , a as c from t1") + tk.MustQuery("show create view v1").Check(testkit.RowsWithSep("|", "v1|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `v1` (`a+b`, `a`, `b`, `c`) AS SELECT `a`+`b` AS `a+b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`a` AS `c` FROM `test`.`t1`|utf8mb4|utf8mb4_bin")) + tk.MustExec("drop table t1") + tk.MustExec("drop view v1") -func TestShowStatsPrivilege(t *testing.T) { - store, clean := testkit.CreateMockStore(t) - defer clean() - tk := testkit.NewTestKit(t, store) - tk.MustExec("create user show_stats") - tk1 := testkit.NewTestKit(t, store) + // For issue #9211 + tk.MustExec("create table t(c int, b int as (c + 1))ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;") + tk.MustQuery("show create table `t`").Check(testkit.RowsWithSep("|", + ""+ + "t CREATE TABLE `t` (\n"+ + " `c` int(11) DEFAULT NULL,\n"+ + " `b` int(11) GENERATED ALWAYS AS (`c` + 1) VIRTUAL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) - require.True(t, tk1.Session().Auth(&auth.UserIdentity{Username: "show_stats", Hostname: "%"}, nil, nil)) - eqErr := plannercore.ErrDBaccessDenied.GenWithStackByArgs("show_stats", "%", mysql.SystemDB) - _, err := tk1.Exec("show stats_meta") - require.EqualError(t, err, eqErr.Error()) - _, err = tk1.Exec("SHOW STATS_BUCKETS") - require.EqualError(t, err, eqErr.Error()) - _, err = tk1.Exec("SHOW STATS_HEALTHY") - require.EqualError(t, err, eqErr.Error()) - _, err = tk1.Exec("SHOW STATS_HISTOGRAMS") - require.EqualError(t, err, eqErr.Error()) - tk.MustExec("grant select on mysql.* to show_stats") - tk1.MustExec("show stats_meta") - tk1.MustExec("SHOW STATS_BUCKETS") - tk1.MustExec("SHOW STATS_HEALTHY") - tk1.MustExec("SHOW STATS_HISTOGRAMS") -} + tk.MustExec("drop table t") + tk.MustExec("create table t(c int, b int as (c + 1) not null)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;") + tk.MustQuery("show create table `t`").Check(testkit.RowsWithSep("|", + ""+ + "t CREATE TABLE `t` (\n"+ + " `c` int(11) DEFAULT NULL,\n"+ + " `b` int(11) GENERATED ALWAYS AS (`c` + 1) VIRTUAL NOT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) + tk.MustExec("drop table t") + tk.MustExec("create table t ( a char(10) charset utf8 collate utf8_bin, b char(10) as (rtrim(a)));") + tk.MustQuery("show create table `t`").Check(testkit.RowsWithSep("|", + ""+ + "t CREATE TABLE `t` (\n"+ + " `a` char(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,\n"+ + " `b` char(10) GENERATED ALWAYS AS (rtrim(`a`)) VIRTUAL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) + tk.MustExec("drop table t") -func TestIssue18878(t *testing.T) { - store, clean := testkit.CreateMockStore(t) - defer clean() - tk := testkit.NewTestKit(t, store) - require.True(t, tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "127.0.0.1", AuthHostname: "%"}, nil, nil)) - tk.MustQuery("select user()").Check(testkit.Rows("root@127.0.0.1")) - tk.MustQuery("show grants") - tk.MustQuery("select user()").Check(testkit.Rows("root@127.0.0.1")) - err := tk.QueryToErr("show grants for root@127.0.0.1") - require.Equal(t, privileges.ErrNonexistingGrant.FastGenByArgs("root", "127.0.0.1").Error(), err.Error()) - err = tk.QueryToErr("show grants for root@localhost") - require.Equal(t, privileges.ErrNonexistingGrant.FastGenByArgs("root", "localhost").Error(), err.Error()) - err = tk.QueryToErr("show grants for root@1.1.1.1") - require.Equal(t, privileges.ErrNonexistingGrant.FastGenByArgs("root", "1.1.1.1").Error(), err.Error()) - tk.MustExec("create user `show_grants`@`127.0.%`") - err = tk.QueryToErr("show grants for `show_grants`@`127.0.0.1`") - require.Equal(t, privileges.ErrNonexistingGrant.FastGenByArgs("show_grants", "127.0.0.1").Error(), err.Error()) - tk.MustQuery("show grants for `show_grants`@`127.0.%`") -} + tk.MustExec(`drop table if exists different_charset`) + tk.MustExec(`create table different_charset(ch1 varchar(10) charset utf8, ch2 varchar(10) charset binary);`) + tk.MustQuery(`show create table different_charset`).Check(testkit.RowsWithSep("|", + ""+ + "different_charset CREATE TABLE `different_charset` (\n"+ + " `ch1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,\n"+ + " `ch2` varbinary(10) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) -func TestIssue17794(t *testing.T) { - store, clean := testkit.CreateMockStore(t) - defer clean() - tk := testkit.NewTestKit(t, store) - tk.MustExec("CREATE USER 'root'@'8.8.%'") - require.True(t, tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "9.9.9.9", AuthHostname: "%"}, nil, nil)) + tk.MustExec("drop table if exists t") + tk.MustExec("create table `t` (\n" + + "`a` timestamp not null default current_timestamp,\n" + + "`b` timestamp(3) default current_timestamp(3),\n" + + "`c` datetime default current_timestamp,\n" + + "`d` datetime(4) default current_timestamp(4),\n" + + "`e` varchar(20) default 'cUrrent_tImestamp',\n" + + "`f` datetime(2) default current_timestamp(2) on update current_timestamp(2),\n" + + "`g` timestamp(2) default current_timestamp(2) on update current_timestamp(2))") + tk.MustQuery("show create table `t`").Check(testkit.RowsWithSep("|", + ""+ + "t CREATE TABLE `t` (\n"+ + " `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n"+ + " `b` timestamp(3) DEFAULT CURRENT_TIMESTAMP(3),\n"+ + " `c` datetime DEFAULT CURRENT_TIMESTAMP,\n"+ + " `d` datetime(4) DEFAULT CURRENT_TIMESTAMP(4),\n"+ + " `e` varchar(20) DEFAULT 'cUrrent_tImestamp',\n"+ + " `f` datetime(2) DEFAULT CURRENT_TIMESTAMP(2) ON UPDATE CURRENT_TIMESTAMP(2),\n"+ + " `g` timestamp(2) DEFAULT CURRENT_TIMESTAMP(2) ON UPDATE CURRENT_TIMESTAMP(2)\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) + tk.MustExec("drop table t") - tk1 := testkit.NewTestKit(t, store) - require.True(t, tk1.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "8.8.8.8", AuthHostname: "8.8.%"}, nil, nil)) - tk.MustQuery("show grants").Check(testkit.Rows("GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION")) - tk1.MustQuery("show grants").Check(testkit.Rows("GRANT USAGE ON *.* TO 'root'@'8.8.%'")) -} + tk.MustExec("create table t (a int, b int) shard_row_id_bits = 4 pre_split_regions=3;") + tk.MustQuery("show create table `t`").Check(testkit.RowsWithSep("|", + ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL,\n"+ + " `b` int(11) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T! SHARD_ROW_ID_BITS=4 PRE_SPLIT_REGIONS=3 */", + )) + tk.MustExec("drop table t") -func TestIssue3641(t *testing.T) { - store, clean := testkit.CreateMockStore(t) - defer clean() - tk := testkit.NewTestKit(t, store) - _, err := tk.Exec("show tables;") - require.Equal(t, plannercore.ErrNoDB.Error(), err.Error()) - _, err = tk.Exec("show table status;") - require.Equal(t, plannercore.ErrNoDB.Error(), err.Error()) -} + // for issue #20446 + tk.MustExec("drop table if exists t1;") + tk.MustExec("create table t1(c int unsigned default 0);") + tk.MustQuery("show create table `t1`").Check(testkit.RowsWithSep("|", + ""+ + "t1 CREATE TABLE `t1` (\n"+ + " `c` int(10) unsigned DEFAULT '0'\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) + tk.MustExec("drop table t1") -func TestIssue10549(t *testing.T) { - store, clean := testkit.CreateMockStore(t) - defer clean() - tk := testkit.NewTestKit(t, store) - tk.MustExec("CREATE DATABASE newdb;") - tk.MustExec("CREATE ROLE 'app_developer';") - tk.MustExec("GRANT ALL ON newdb.* TO 'app_developer';") - tk.MustExec("CREATE USER 'dev';") - tk.MustExec("GRANT 'app_developer' TO 'dev';") - tk.MustExec("SET DEFAULT ROLE app_developer TO 'dev';") + tk.MustExec("CREATE TABLE `log` (" + + "`LOG_ID` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT," + + "`ROUND_ID` bigint(20) UNSIGNED NOT NULL," + + "`USER_ID` int(10) UNSIGNED NOT NULL," + + "`USER_IP` int(10) UNSIGNED DEFAULT NULL," + + "`END_TIME` datetime NOT NULL," + + "`USER_TYPE` int(11) DEFAULT NULL," + + "`APP_ID` int(11) DEFAULT NULL," + + "PRIMARY KEY (`LOG_ID`,`END_TIME`)," + + "KEY `IDX_EndTime` (`END_TIME`)," + + "KEY `IDX_RoundId` (`ROUND_ID`)," + + "KEY `IDX_UserId_EndTime` (`USER_ID`,`END_TIME`)" + + ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=505488 " + + "PARTITION BY RANGE ( month(`end_time`) ) (" + + "PARTITION `p1` VALUES LESS THAN (2)," + + "PARTITION `p2` VALUES LESS THAN (3)," + + "PARTITION `p3` VALUES LESS THAN (4)," + + "PARTITION `p4` VALUES LESS THAN (5)," + + "PARTITION `p5` VALUES LESS THAN (6)," + + "PARTITION `p6` VALUES LESS THAN (7)," + + "PARTITION `p7` VALUES LESS THAN (8)," + + "PARTITION `p8` VALUES LESS THAN (9)," + + "PARTITION `p9` VALUES LESS THAN (10)," + + "PARTITION `p10` VALUES LESS THAN (11)," + + "PARTITION `p11` VALUES LESS THAN (12)," + + "PARTITION `p12` VALUES LESS THAN (MAXVALUE))") + tk.MustQuery("show create table log").Check(testkit.RowsWithSep("|", + "log CREATE TABLE `log` (\n"+ + " `LOG_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n"+ + " `ROUND_ID` bigint(20) unsigned NOT NULL,\n"+ + " `USER_ID` int(10) unsigned NOT NULL,\n"+ + " `USER_IP` int(10) unsigned DEFAULT NULL,\n"+ + " `END_TIME` datetime NOT NULL,\n"+ + " `USER_TYPE` int(11) DEFAULT NULL,\n"+ + " `APP_ID` int(11) DEFAULT NULL,\n"+ + " PRIMARY KEY (`LOG_ID`,`END_TIME`) /*T![clustered_index] NONCLUSTERED */,\n"+ + " KEY `IDX_EndTime` (`END_TIME`),\n"+ + " KEY `IDX_RoundId` (`ROUND_ID`),\n"+ + " KEY `IDX_UserId_EndTime` (`USER_ID`,`END_TIME`)\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=505488\n"+ + "PARTITION BY RANGE (MONTH(`end_time`))\n"+ + "(PARTITION `p1` VALUES LESS THAN (2),\n"+ + " PARTITION `p2` VALUES LESS THAN (3),\n"+ + " PARTITION `p3` VALUES LESS THAN (4),\n"+ + " PARTITION `p4` VALUES LESS THAN (5),\n"+ + " PARTITION `p5` VALUES LESS THAN (6),\n"+ + " PARTITION `p6` VALUES LESS THAN (7),\n"+ + " PARTITION `p7` VALUES LESS THAN (8),\n"+ + " PARTITION `p8` VALUES LESS THAN (9),\n"+ + " PARTITION `p9` VALUES LESS THAN (10),\n"+ + " PARTITION `p10` VALUES LESS THAN (11),\n"+ + " PARTITION `p11` VALUES LESS THAN (12),\n"+ + " PARTITION `p12` VALUES LESS THAN (MAXVALUE))")) - require.True(t, tk.Session().Auth(&auth.UserIdentity{Username: "dev", Hostname: "%", AuthUsername: "dev", AuthHostname: "%"}, nil, nil)) - tk.MustQuery("SHOW DATABASES;").Check(testkit.Rows("INFORMATION_SCHEMA", "newdb")) - tk.MustQuery("SHOW GRANTS;").Check(testkit.Rows("GRANT USAGE ON *.* TO 'dev'@'%'", "GRANT ALL PRIVILEGES ON newdb.* TO 'dev'@'%'", "GRANT 'app_developer'@'%' TO 'dev'@'%'")) - tk.MustQuery("SHOW GRANTS FOR CURRENT_USER").Check(testkit.Rows("GRANT USAGE ON *.* TO 'dev'@'%'", "GRANT ALL PRIVILEGES ON newdb.* TO 'dev'@'%'", "GRANT 'app_developer'@'%' TO 'dev'@'%'")) - tk.MustQuery("SHOW GRANTS FOR dev").Check(testkit.Rows("GRANT USAGE ON *.* TO 'dev'@'%'", "GRANT 'app_developer'@'%' TO 'dev'@'%'")) -} + // for issue #11831 + tk.MustExec("create table ttt4(a varchar(123) default null collate utf8mb4_unicode_ci)engine=innodb default charset=utf8mb4 collate=utf8mb4_unicode_ci;") + tk.MustQuery("show create table `ttt4`").Check(testkit.RowsWithSep("|", + ""+ + "ttt4 CREATE TABLE `ttt4` (\n"+ + " `a` varchar(123) COLLATE utf8mb4_unicode_ci DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", + )) + tk.MustExec("create table ttt5(a varchar(123) default null)engine=innodb default charset=utf8mb4 collate=utf8mb4_bin;") + tk.MustQuery("show create table `ttt5`").Check(testkit.RowsWithSep("|", + ""+ + "ttt5 CREATE TABLE `ttt5` (\n"+ + " `a` varchar(123) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) -func TestIssue11165(t *testing.T) { - store, clean := testkit.CreateMockStore(t) - defer clean() - tk := testkit.NewTestKit(t, store) - tk.MustExec("CREATE ROLE 'r_manager';") - tk.MustExec("CREATE USER 'manager'@'localhost';") - tk.MustExec("GRANT 'r_manager' TO 'manager'@'localhost';") + // for expression index + tk.MustExec("drop table if exists t;") + tk.MustExec("create table t(a int, b real);") + tk.MustExec("alter table t add index expr_idx((a*b+1));") + tk.MustQuery("show create table t;").Check(testkit.RowsWithSep("|", + ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL,\n"+ + " `b` double DEFAULT NULL,\n"+ + " KEY `expr_idx` ((`a` * `b` + 1))\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) - require.True(t, tk.Session().Auth(&auth.UserIdentity{Username: "manager", Hostname: "localhost", AuthUsername: "manager", AuthHostname: "localhost"}, nil, nil)) - tk.MustExec("SET DEFAULT ROLE ALL TO 'manager'@'localhost';") - tk.MustExec("SET DEFAULT ROLE NONE TO 'manager'@'localhost';") - tk.MustExec("SET DEFAULT ROLE 'r_manager' TO 'manager'@'localhost';") -} + // Fix issue #15175, show create table sequence_name. + tk.MustExec("drop sequence if exists seq") + tk.MustExec("create sequence seq") + tk.MustQuery("show create table seq;").Check(testkit.Rows("seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB")) -// TestShow2 is moved from session_test -func TestShow2(t *testing.T) { - store, dom, clean := testkit.CreateMockStoreAndDomain(t) - defer clean() - tk := testkit.NewTestKit(t, store) - tk.MustExec("use test") + // Test for issue #15633, 'binary' collation should be ignored in the result of 'show create table'. + tk.MustExec(`drop table if exists binary_collate`) + tk.MustExec(`create table binary_collate(a varchar(10)) default collate=binary;`) + tk.MustQuery(`show create table binary_collate`).Check(testkit.RowsWithSep("|", + ""+ + "binary_collate CREATE TABLE `binary_collate` (\n"+ + " `a` varbinary(10) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=binary", // binary collate is ignored + )) + tk.MustExec(`drop table if exists binary_collate`) + tk.MustExec(`create table binary_collate(a varchar(10)) default charset=binary collate=binary;`) + tk.MustQuery(`show create table binary_collate`).Check(testkit.RowsWithSep("|", + ""+ + "binary_collate CREATE TABLE `binary_collate` (\n"+ + " `a` varbinary(10) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=binary", // binary collate is ignored + )) + tk.MustExec(`drop table if exists binary_collate`) + tk.MustExec(`create table binary_collate(a varchar(10)) default charset=utf8mb4 collate=utf8mb4_bin;`) + tk.MustQuery(`show create table binary_collate`).Check(testkit.RowsWithSep("|", + ""+ + "binary_collate CREATE TABLE `binary_collate` (\n"+ + " `a` varchar(10) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", // non-binary collate is kept. + )) + // Test for issue #17 in bug competition, default num and sequence should be shown without quote. + tk.MustExec(`drop table if exists default_num`) + tk.MustExec("create table default_num(a int default 11)") + tk.MustQuery("show create table default_num").Check(testkit.RowsWithSep("|", + ""+ + "default_num CREATE TABLE `default_num` (\n"+ + " `a` int(11) DEFAULT '11'\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) + tk.MustExec(`drop table if exists default_varchar`) + tk.MustExec("create table default_varchar(a varchar(10) default \"haha\")") + tk.MustQuery("show create table default_varchar").Check(testkit.RowsWithSep("|", + ""+ + "default_varchar CREATE TABLE `default_varchar` (\n"+ + " `a` varchar(10) DEFAULT 'haha'\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) + tk.MustExec(`drop table if exists default_sequence`) + tk.MustExec("create table default_sequence(a int default nextval(seq))") + tk.MustQuery("show create table default_sequence").Check(testkit.RowsWithSep("|", + ""+ + "default_sequence CREATE TABLE `default_sequence` (\n"+ + " `a` int(11) DEFAULT nextval(`test`.`seq`)\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) - tk.MustExec("set global autocommit=0") - tk1 := testkit.NewTestKit(t, store) - tk1.MustQuery("show global variables where variable_name = 'autocommit'").Check(testkit.Rows("autocommit OFF")) - tk.MustExec("set global autocommit = 1") - tk2 := testkit.NewTestKit(t, store) - tk2.MustQuery("show global variables where variable_name = 'autocommit'").Check(testkit.Rows("autocommit ON")) + // TiDB defaults (and only supports) foreign_key_checks=0 + // This means that the child table can be created before the parent table. + // This behavior is required for mysqldump restores. + tk.MustExec(`DROP TABLE IF EXISTS parent, child`) + tk.MustExec(`CREATE TABLE child (id INT NOT NULL PRIMARY KEY auto_increment, parent_id INT NOT NULL, INDEX par_ind (parent_id), CONSTRAINT child_ibfk_1 FOREIGN KEY (parent_id) REFERENCES parent(id))`) + tk.MustExec(`CREATE TABLE parent ( id INT NOT NULL PRIMARY KEY auto_increment )`) + tk.MustQuery(`show create table child`).Check(testkit.RowsWithSep("|", + ""+ + "child CREATE TABLE `child` (\n"+ + " `id` int(11) NOT NULL AUTO_INCREMENT,\n"+ + " `parent_id` int(11) NOT NULL,\n"+ + " PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,\n"+ + " KEY `par_ind` (`parent_id`),\n"+ + " CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`)\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) - // TODO: Specifying the charset for national char/varchar should not be supported. - tk.MustExec("drop table if exists test_full_column") - tk.MustExec(`create table test_full_column( - c_int int, - c_float float, - c_bit bit, - c_bool bool, - c_char char(1) charset ascii collate ascii_bin, - c_nchar national char(1) charset ascii collate ascii_bin, - c_binary binary, - c_varchar varchar(1) charset ascii collate ascii_bin, - c_varchar_default varchar(20) charset ascii collate ascii_bin default 'cUrrent_tImestamp', - c_nvarchar national varchar(1) charset ascii collate ascii_bin, - c_varbinary varbinary(1), - c_year year, - c_date date, - c_time time, - c_datetime datetime, - c_datetime_default datetime default current_timestamp, - c_datetime_default_2 datetime(2) default current_timestamp(2), - c_timestamp timestamp, - c_timestamp_default timestamp default current_timestamp, - c_timestamp_default_3 timestamp(3) default current_timestamp(3), - c_timestamp_default_4 timestamp(3) default current_timestamp(3) on update current_timestamp(3), - c_blob blob, - c_tinyblob tinyblob, - c_mediumblob mediumblob, - c_longblob longblob, - c_text text charset ascii collate ascii_bin, - c_tinytext tinytext charset ascii collate ascii_bin, - c_mediumtext mediumtext charset ascii collate ascii_bin, - c_longtext longtext charset ascii collate ascii_bin, - c_json json, - c_enum enum('1') charset ascii collate ascii_bin, - c_set set('1') charset ascii collate ascii_bin - );`) - - tk.MustQuery(`show full columns from test_full_column`).Check(testkit.Rows( - "" + - "c_int int(11) YES select,insert,update,references ]\n" + - "[c_float float YES select,insert,update,references ]\n" + - "[c_bit bit(1) YES select,insert,update,references ]\n" + - "[c_bool tinyint(1) YES select,insert,update,references ]\n" + - "[c_char char(1) ascii_bin YES select,insert,update,references ]\n" + - "[c_nchar char(1) ascii_bin YES select,insert,update,references ]\n" + - "[c_binary binary(1) YES select,insert,update,references ]\n" + - "[c_varchar varchar(1) ascii_bin YES select,insert,update,references ]\n" + - "[c_varchar_default varchar(20) ascii_bin YES cUrrent_tImestamp select,insert,update,references ]\n" + - "[c_nvarchar varchar(1) ascii_bin YES select,insert,update,references ]\n" + - "[c_varbinary varbinary(1) YES select,insert,update,references ]\n" + - "[c_year year(4) YES select,insert,update,references ]\n" + - "[c_date date YES select,insert,update,references ]\n" + - "[c_time time YES select,insert,update,references ]\n" + - "[c_datetime datetime YES select,insert,update,references ]\n" + - "[c_datetime_default datetime YES CURRENT_TIMESTAMP select,insert,update,references ]\n" + - "[c_datetime_default_2 datetime(2) YES CURRENT_TIMESTAMP(2) select,insert,update,references ]\n" + - "[c_timestamp timestamp YES select,insert,update,references ]\n" + - "[c_timestamp_default timestamp YES CURRENT_TIMESTAMP select,insert,update,references ]\n" + - "[c_timestamp_default_3 timestamp(3) YES CURRENT_TIMESTAMP(3) select,insert,update,references ]\n" + - "[c_timestamp_default_4 timestamp(3) YES CURRENT_TIMESTAMP(3) DEFAULT_GENERATED on update CURRENT_TIMESTAMP(3) select,insert,update,references ]\n" + - "[c_blob blob YES select,insert,update,references ]\n" + - "[c_tinyblob tinyblob YES select,insert,update,references ]\n" + - "[c_mediumblob mediumblob YES select,insert,update,references ]\n" + - "[c_longblob longblob YES select,insert,update,references ]\n" + - "[c_text text ascii_bin YES select,insert,update,references ]\n" + - "[c_tinytext tinytext ascii_bin YES select,insert,update,references ]\n" + - "[c_mediumtext mediumtext ascii_bin YES select,insert,update,references ]\n" + - "[c_longtext longtext ascii_bin YES select,insert,update,references ]\n" + - "[c_json json YES select,insert,update,references ]\n" + - "[c_enum enum('1') ascii_bin YES select,insert,update,references ]\n" + - "[c_set set('1') ascii_bin YES select,insert,update,references ")) - - tk.MustExec("drop table if exists test_full_column") - - tk.MustExec("drop table if exists t") - tk.MustExec(`create table if not exists t (c int) comment '注释'`) - tk.MustExec("create or replace definer='root'@'localhost' view v as select * from t") - tk.MustQuery(`show columns from t`).Check(testkit.RowsWithSep(",", "c,int(11),YES,,,")) - tk.MustQuery(`describe t`).Check(testkit.RowsWithSep(",", "c,int(11),YES,,,")) - tk.MustQuery(`show columns from v`).Check(testkit.RowsWithSep(",", "c,int(11),YES,,,")) - tk.MustQuery(`describe v`).Check(testkit.RowsWithSep(",", "c,int(11),YES,,,")) - tk.MustQuery("show collation where Charset = 'utf8' and Collation = 'utf8_bin'").Check(testkit.RowsWithSep(",", "utf8_bin,utf8,83,Yes,Yes,1")) - tk.MustExec(`drop sequence if exists seq`) - tk.MustExec(`create sequence seq`) - tk.MustQuery("show tables").Check(testkit.Rows("seq", "t", "v")) - tk.MustQuery("show full tables").Check(testkit.Rows("seq SEQUENCE", "t BASE TABLE", "v VIEW")) - - // Bug 19427 - tk.MustQuery("SHOW FULL TABLES in INFORMATION_SCHEMA like 'VIEWS'").Check(testkit.Rows("VIEWS SYSTEM VIEW")) - tk.MustQuery("SHOW FULL TABLES in information_schema like 'VIEWS'").Check(testkit.Rows("VIEWS SYSTEM VIEW")) - tk.MustQuery("SHOW FULL TABLES in metrics_schema like 'uptime'").Check(testkit.Rows("uptime SYSTEM VIEW")) - - is := dom.InfoSchema() - tblInfo, err := is.TableByName(model.NewCIStr("test"), model.NewCIStr("t")) - require.NoError(t, err) - createTime := model.TSConvert2Time(tblInfo.Meta().UpdateTS).Format("2006-01-02 15:04:05") - - // The Hostname is the actual host - tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "192.168.0.1", AuthUsername: "root", AuthHostname: "%"}, nil, []byte("012345678901234567890")) - - r := tk.MustQuery("show table status from test like 't'") - r.Check(testkit.Rows(fmt.Sprintf("t InnoDB 10 Compact 0 0 0 0 0 0 %s utf8mb4_bin 注释", createTime))) + // Test Foreign keys + ON DELETE / ON UPDATE + tk.MustExec(`DROP TABLE child`) + tk.MustExec(`CREATE TABLE child (id INT NOT NULL PRIMARY KEY auto_increment, parent_id INT NOT NULL, INDEX par_ind (parent_id), CONSTRAINT child_ibfk_1 FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE SET NULL ON UPDATE CASCADE)`) + tk.MustQuery(`show create table child`).Check(testkit.RowsWithSep("|", + ""+ + "child CREATE TABLE `child` (\n"+ + " `id` int(11) NOT NULL AUTO_INCREMENT,\n"+ + " `parent_id` int(11) NOT NULL,\n"+ + " PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,\n"+ + " KEY `par_ind` (`parent_id`),\n"+ + " CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE SET NULL ON UPDATE CASCADE\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", + )) - tk.MustQuery("show databases like 'test'").Check(testkit.Rows("test")) + // Test issue #20327 + tk.MustExec("drop table if exists t;") + tk.MustExec("create table t(a int, b char(10) as ('a'));") + result := tk.MustQuery("show create table t;").Rows()[0][1] + require.Regexp(t, `(?s).*GENERATED ALWAYS AS \(_utf8mb4'a'\).*`, result) + tk.MustExec("drop table if exists t;") + tk.MustExec("create table t(a int, b char(10) as (_utf8'a'));") + result = tk.MustQuery("show create table t;").Rows()[0][1] + require.Regexp(t, `(?s).*GENERATED ALWAYS AS \(_utf8'a'\).*`, result) + // Test show list partition table + tk.MustExec("set @@session.tidb_enable_list_partition = ON") + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec(`create table t (id int, name varchar(10), unique index idx (id)) partition by list (id) ( + partition p0 values in (3,5,6,9,17), + partition p1 values in (1,2,10,11,19,20), + partition p2 values in (4,12,13,14,18), + partition p3 values in (7,8,15,16,null) + );`) + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", + "t CREATE TABLE `t` (\n"+ + " `id` int(11) DEFAULT NULL,\n"+ + " `name` varchar(10) DEFAULT NULL,\n"+ + " UNIQUE KEY `idx` (`id`)\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ + "PARTITION BY LIST (`id`)\n"+ + "(PARTITION `p0` VALUES IN (3,5,6,9,17),\n"+ + " PARTITION `p1` VALUES IN (1,2,10,11,19,20),\n"+ + " PARTITION `p2` VALUES IN (4,12,13,14,18),\n"+ + " PARTITION `p3` VALUES IN (7,8,15,16,NULL))")) + // Test show list column partition table + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec(`create table t (id int, name varchar(10), unique index idx (id)) partition by list columns (id) ( + partition p0 values in (3,5,6,9,17), + partition p1 values in (1,2,10,11,19,20), + partition p2 values in (4,12,13,14,18), + partition p3 values in (7,8,15,16,null) + );`) + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", + "t CREATE TABLE `t` (\n"+ + " `id` int(11) DEFAULT NULL,\n"+ + " `name` varchar(10) DEFAULT NULL,\n"+ + " UNIQUE KEY `idx` (`id`)\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ + "PARTITION BY LIST COLUMNS(`id`)\n"+ + "(PARTITION `p0` VALUES IN (3,5,6,9,17),\n"+ + " PARTITION `p1` VALUES IN (1,2,10,11,19,20),\n"+ + " PARTITION `p2` VALUES IN (4,12,13,14,18),\n"+ + " PARTITION `p3` VALUES IN (7,8,15,16,NULL))")) + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec(`create table t (id int, name varchar(10), unique index idx (id, name)) partition by list columns (id, name) ( + partition p0 values in ((3, '1'), (5, '5')), + partition p1 values in ((1, '1')));`) + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", + "t CREATE TABLE `t` (\n"+ + " `id` int(11) DEFAULT NULL,\n"+ + " `name` varchar(10) DEFAULT NULL,\n"+ + " UNIQUE KEY `idx` (`id`,`name`)\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ + "PARTITION BY LIST COLUMNS(`id`,`name`)\n"+ + "(PARTITION `p0` VALUES IN ((3,\"1\"),(5,\"5\")),\n"+ + " PARTITION `p1` VALUES IN ((1,\"1\")))")) + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec(`create table t (id int primary key, v varchar(255) not null, key idx_v (v) comment 'foo\'bar')`) + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", + "t CREATE TABLE `t` (\n"+ + " `id` int(11) NOT NULL,\n"+ + " `v` varchar(255) NOT NULL,\n"+ + " PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,\n"+ + " KEY `idx_v` (`v`) COMMENT 'foo''bar'\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin")) - tk.MustExec(`grant all on *.* to 'root'@'%'`) - tk.MustQuery("show grants").Check(testkit.Rows(`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION`)) + // For issue #29922 + tk.MustExec("CREATE TABLE `thash` (\n `id` bigint unsigned NOT NULL,\n `data` varchar(255) DEFAULT NULL,\n PRIMARY KEY (`id`)\n)\nPARTITION BY HASH (`id`)\n(PARTITION pEven COMMENT = \"Even ids\",\n PARTITION pOdd COMMENT = \"Odd ids\");") + tk.MustQuery("show create table `thash`").Check(testkit.RowsWithSep("|", ""+ + "thash CREATE TABLE `thash` (\n"+ + " `id` bigint(20) unsigned NOT NULL,\n"+ + " `data` varchar(255) DEFAULT NULL,\n"+ + " PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ + "PARTITION BY HASH (`id`)\n"+ + "(PARTITION `pEven` COMMENT 'Even ids',\n"+ + " PARTITION `pOdd` COMMENT 'Odd ids')", + )) + // empty edge case + tk.MustExec("drop table if exists `thash`") + tk.MustExec("CREATE TABLE `thash` (\n `id` bigint unsigned NOT NULL,\n `data` varchar(255) DEFAULT NULL,\n PRIMARY KEY (`id`)\n)\nPARTITION BY HASH (`id`);") + tk.MustQuery("show create table `thash`").Check(testkit.RowsWithSep("|", ""+ + "thash CREATE TABLE `thash` (\n"+ + " `id` bigint(20) unsigned NOT NULL,\n"+ + " `data` varchar(255) DEFAULT NULL,\n"+ + " PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ + "PARTITION BY HASH (`id`) PARTITIONS 1", + )) - tk.MustQuery("show grants for current_user()").Check(testkit.Rows(`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION`)) - tk.MustQuery("show grants for current_user").Check(testkit.Rows(`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION`)) + // default value escape character '\\' display case + tk.MustExec("drop table if exists t;") + tk.MustExec("create table t(a int primary key, b varchar(20) default '\\\\');") + tk.MustQuery("show create table t;").Check(testkit.RowsWithSep("|", + ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) NOT NULL,\n"+ + " `b` varchar(20) DEFAULT '\\\\',\n"+ + " PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin")) } -func TestShowCreateUser(t *testing.T) { +func TestShowCreateTablePlacement(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) - // Create a new user. - tk.MustExec(`CREATE USER 'test_show_create_user'@'%' IDENTIFIED BY 'root';`) - tk.MustQuery("show create user 'test_show_create_user'@'%'"). - Check(testkit.Rows(`CREATE USER 'test_show_create_user'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK`)) + tk.MustExec("use test") + defer tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec(`CREATE USER 'test_show_create_user'@'localhost' IDENTIFIED BY 'test';`) - tk.MustQuery("show create user 'test_show_create_user'@'localhost';"). - Check(testkit.Rows(`CREATE USER 'test_show_create_user'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK`)) + // case for policy + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec("create placement policy x " + + "FOLLOWERS=2 " + + "CONSTRAINTS=\"[+disk=ssd]\" ") + defer tk.MustExec(`DROP PLACEMENT POLICY IF EXISTS x`) + tk.MustExec("create table t(a int)" + + "PLACEMENT POLICY=\"x\"") + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin "+ + "/*T![placement] PLACEMENT POLICY=`x` */", + )) - // Case: the user exists but the host portion doesn't match - err := tk.QueryToErr("show create user 'test_show_create_user'@'asdf';") - require.Equal(t, executor.ErrCannotUser.GenWithStackByArgs("SHOW CREATE USER", "'test_show_create_user'@'asdf'").Error(), err.Error()) + // case for policy with quotes + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec("create table t(a int)" + + "/*T![placement] PLACEMENT POLICY=\"x\" */") + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin "+ + "/*T![placement] PLACEMENT POLICY=`x` */", + )) - // Case: a user that doesn't exist - err = tk.QueryToErr("show create user 'aaa'@'localhost';") - require.Equal(t, executor.ErrCannotUser.GenWithStackByArgs("SHOW CREATE USER", "'aaa'@'localhost'").Error(), err.Error()) - - tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "127.0.0.1", AuthUsername: "root", AuthHostname: "%"}, nil, nil) - tk.MustQuery("show create user current_user"). - Check(testkit.Rows("CREATE USER 'root'@'127.0.0.1' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK")) - - tk.MustQuery("show create user current_user()"). - Check(testkit.Rows("CREATE USER 'root'@'127.0.0.1' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK")) + // Partitioned tables + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec("set @old_list_part = @@tidb_enable_list_partition") + defer tk.MustExec("set @@tidb_enable_list_partition = @old_list_part") + tk.MustExec("set tidb_enable_list_partition = 1") + tk.MustExec("create table t(a int, b varchar(255))" + + "/*T![placement] PLACEMENT POLICY=\"x\" */" + + "PARTITION BY LIST (a)\n" + + "(PARTITION pLow VALUES in (1,2,3,5,8) COMMENT 'a comment' placement policy 'x'," + + " PARTITION pMid VALUES in (9) COMMENT 'another comment'," + + "partition pMax values IN (10,11,12))") + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL,\n"+ + " `b` varchar(255) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![placement] PLACEMENT POLICY=`x` */\n"+ + "PARTITION BY LIST (`a`)\n"+ + "(PARTITION `pLow` VALUES IN (1,2,3,5,8) COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ + " PARTITION `pMid` VALUES IN (9) COMMENT 'another comment',\n"+ + " PARTITION `pMax` VALUES IN (10,11,12))", + )) - tk.MustExec("create user 'check_priv'") + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec("create table t(a int, b varchar(255))" + + "PARTITION BY LIST COLUMNS (b)\n" + + "(PARTITION pLow VALUES in ('1','2','3','5','8') COMMENT 'a comment' placement policy 'x'," + + "partition pMax values IN ('10','11','12'))") + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL,\n"+ + " `b` varchar(255) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ + "PARTITION BY LIST COLUMNS(`b`)\n"+ + "(PARTITION `pLow` VALUES IN (\"1\",\"2\",\"3\",\"5\",\"8\") COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ + " PARTITION `pMax` VALUES IN (\"10\",\"11\",\"12\"))", + )) - // "show create user" for other user requires the SELECT privilege on mysql database. - tk1 := testkit.NewTestKit(t, store) - tk1.MustExec("use mysql") - succ := tk1.Session().Auth(&auth.UserIdentity{Username: "check_priv", Hostname: "127.0.0.1", AuthUsername: "test_show", AuthHostname: "asdf"}, nil, nil) - require.True(t, succ) - err = tk1.QueryToErr("show create user 'root'@'%'") - require.Error(t, err) + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec("create table t(a int, b varchar(255))" + + "PARTITION BY LIST COLUMNS (a,b)\n" + + "(PARTITION pLow VALUES in ((1,'1'),(2,'2'),(3,'3'),(5,'5'),(8,'8')) COMMENT 'a comment' placement policy 'x'," + + "partition pMax values IN ((10,'10'),(11,'11'),(12,'12')))") + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL,\n"+ + " `b` varchar(255) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ + "PARTITION BY LIST COLUMNS(`a`,`b`)\n"+ + "(PARTITION `pLow` VALUES IN ((1,\"1\"),(2,\"2\"),(3,\"3\"),(5,\"5\"),(8,\"8\")) COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ + " PARTITION `pMax` VALUES IN ((10,\"10\"),(11,\"11\"),(12,\"12\")))", + )) - // "show create user" for current user doesn't check privileges. - tk1.MustQuery("show create user current_user"). - Check(testkit.Rows("CREATE USER 'check_priv'@'127.0.0.1' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK")) + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec("create table t(a int, b varchar(255))" + + "PARTITION BY RANGE (a)\n" + + "(PARTITION pLow VALUES less than (1000000) COMMENT 'a comment' placement policy 'x'," + + "partition pMax values LESS THAN (MAXVALUE))") + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL,\n"+ + " `b` varchar(255) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ + "PARTITION BY RANGE (`a`)\n"+ + "(PARTITION `pLow` VALUES LESS THAN (1000000) COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ + " PARTITION `pMax` VALUES LESS THAN (MAXVALUE))", + )) - // Creating users with `IDENTIFIED WITH 'caching_sha2_password'` - tk.MustExec("CREATE USER 'sha_test'@'%' IDENTIFIED WITH 'caching_sha2_password' BY 'temp_passwd'") + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec("create table t(a int, b varchar(255))" + + "PARTITION BY RANGE COLUMNS (b)\n" + + "(PARTITION pLow VALUES less than ('1000000') COMMENT 'a comment' placement policy 'x'," + + "partition pMax values LESS THAN (MAXVALUE))") + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL,\n"+ + " `b` varchar(255) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ + "PARTITION BY RANGE COLUMNS(`b`)\n"+ + "(PARTITION `pLow` VALUES LESS THAN (\"1000000\") COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ + " PARTITION `pMax` VALUES LESS THAN (MAXVALUE))", + )) - // Compare only the start of the output as the salt changes every time. - rows := tk.MustQuery("SHOW CREATE USER 'sha_test'@'%'") - require.Equal(t, "CREATE USER 'sha_test'@'%' IDENTIFIED WITH 'caching_sha2_password' AS '$A$005$", rows.Rows()[0][0].(string)[:78]) - // Creating users with `IDENTIFIED WITH 'auth-socket'` - tk.MustExec("CREATE USER 'sock'@'%' IDENTIFIED WITH 'auth_socket'") + tk.MustExec(`DROP TABLE IF EXISTS t`) + // RANGE COLUMNS with multiple columns is not supported! + tk.MustExec("create table t(a int, b varchar(255))" + + "/*T![placement] PLACEMENT POLICY=\"x\" */" + + "PARTITION BY RANGE COLUMNS (a,b)\n" + + "(PARTITION pLow VALUES less than (1000000,'1000000') COMMENT 'a comment' placement policy 'x'," + + " PARTITION pMidLow VALUES less than (1000000,MAXVALUE) COMMENT 'another comment' placement policy 'x'," + + " PARTITION pMadMax VALUES less than (MAXVALUE,'1000000') COMMENT ='Not a comment' placement policy 'x'," + + "partition pMax values LESS THAN (MAXVALUE, MAXVALUE))") + tk.MustQuery("show warnings").Check(testkit.Rows("Warning 8200 Unsupported partition type RANGE, treat as normal table")) + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL,\n"+ + " `b` varchar(255) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![placement] PLACEMENT POLICY=`x` */", + )) - // Compare only the start of the output as the salt changes every time. - rows = tk.MustQuery("SHOW CREATE USER 'sock'@'%'") - require.Equal(t, "CREATE USER 'sock'@'%' IDENTIFIED WITH 'auth_socket' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK", rows.Rows()[0][0].(string)) - tk.MustExec("CREATE USER 'sock2'@'%' IDENTIFIED WITH 'auth_socket' AS 'sock3'") + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec("create table t(a int, b varchar(255))" + + "/*T![placement] PLACEMENT POLICY=\"x\" */" + + "PARTITION BY HASH (a) PARTITIONS 2") + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL,\n"+ + " `b` varchar(255) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![placement] PLACEMENT POLICY=`x` */\n"+ + "PARTITION BY HASH (`a`) PARTITIONS 2", + )) - // Compare only the start of the output as the salt changes every time. - rows = tk.MustQuery("SHOW CREATE USER 'sock2'@'%'") - require.Equal(t, "CREATE USER 'sock2'@'%' IDENTIFIED WITH 'auth_socket' AS 'sock3' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK", rows.Rows()[0][0].(string)) + tk.MustExec(`DROP TABLE IF EXISTS t`) + tk.MustExec("create table t(a int, b varchar(255))" + + "PARTITION BY HASH (a)\n" + + "(PARTITION pLow COMMENT 'a comment' placement policy 'x'," + + "partition pMax)") + tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ + "t CREATE TABLE `t` (\n"+ + " `a` int(11) DEFAULT NULL,\n"+ + " `b` varchar(255) DEFAULT NULL\n"+ + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ + "PARTITION BY HASH (`a`)\n"+ + "(PARTITION `pLow` COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ + " PARTITION `pMax`)", + )) + tk.MustExec(`DROP TABLE t`) } -func TestUnprivilegedShow(t *testing.T) { - store, dom, clean := testkit.CreateMockStoreAndDomain(t) +func TestShowVisibility(t *testing.T) { + store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) - tk.MustExec("CREATE DATABASE testshow") - tk.MustExec("USE testshow") - tk.MustExec("CREATE TABLE t1 (a int)") - tk.MustExec("CREATE TABLE t2 (a int)") + tk.MustExec("create database showdatabase") + tk.MustExec("use showdatabase") + tk.MustExec("create table t1 (id int)") + tk.MustExec("create table t2 (id int)") + tk.MustExec(`create user 'show'@'%'`) - tk.MustExec(`CREATE USER 'lowprivuser'`) // no grants + tk1 := testkit.NewTestKit(t, store) + require.True(t, tk1.Session().Auth(&auth.UserIdentity{Username: "show", Hostname: "%"}, nil, nil)) - tk.Session().Auth(&auth.UserIdentity{Username: "lowprivuser", Hostname: "192.168.0.1", AuthUsername: "lowprivuser", AuthHostname: "%"}, nil, []byte("012345678901234567890")) - rs, err := tk.Exec("SHOW TABLE STATUS FROM testshow") - require.NoError(t, err) - require.NotNil(t, rs) + // No ShowDatabases privilege, this user would see nothing except INFORMATION_SCHEMA. + tk.MustQuery("show databases").Check(testkit.Rows("INFORMATION_SCHEMA")) - tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "192.168.0.1", AuthUsername: "root", AuthHostname: "%"}, nil, []byte("012345678901234567890")) - tk.MustExec("GRANT ALL ON testshow.t1 TO 'lowprivuser'") - tk.Session().Auth(&auth.UserIdentity{Username: "lowprivuser", Hostname: "192.168.0.1", AuthUsername: "lowprivuser", AuthHostname: "%"}, nil, []byte("012345678901234567890")) + // After grant, the user can see the database. + tk.MustExec(`grant select on showdatabase.t1 to 'show'@'%'`) + tk1.MustQuery("show databases").Check(testkit.Rows("INFORMATION_SCHEMA", "showdatabase")) - is := dom.InfoSchema() - tblInfo, err := is.TableByName(model.NewCIStr("testshow"), model.NewCIStr("t1")) - require.NoError(t, err) - createTime := model.TSConvert2Time(tblInfo.Meta().UpdateTS).Format("2006-01-02 15:04:05") + // The user can see t1 but not t2. + tk1.MustExec("use showdatabase") + tk1.MustQuery("show tables").Check(testkit.Rows("t1")) - tk.MustQuery("show table status from testshow").Check(testkit.Rows(fmt.Sprintf("t1 InnoDB 10 Compact 0 0 0 0 0 0 %s utf8mb4_bin ", createTime))) + // After revoke, show database result should be just except INFORMATION_SCHEMA. + tk.MustExec(`revoke select on showdatabase.t1 from 'show'@'%'`) + tk1.MustQuery("show databases").Check(testkit.Rows("INFORMATION_SCHEMA")) + + // Grant any global privilege would make show databases available. + tk.MustExec(`grant CREATE on *.* to 'show'@'%'`) + rows := tk1.MustQuery("show databases").Rows() + require.GreaterOrEqual(t, len(rows), 2) + tk.MustExec(`drop user 'show'@'%'`) + tk.MustExec("drop database showdatabase") } -func TestCollation(t *testing.T) { +func TestShowDatabasesInfoSchemaFirst(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) - tk.MustExec("use test") + tk.MustQuery("show databases").Check(testkit.Rows("INFORMATION_SCHEMA")) + tk.MustExec(`create user 'show'@'%'`) - rs, err := tk.Exec("show collation;") - require.NoError(t, err) - fields := rs.Fields() - require.Equal(t, mysql.TypeVarchar, fields[0].Column.GetType()) - require.Equal(t, mysql.TypeVarchar, fields[1].Column.GetType()) - require.Equal(t, mysql.TypeLonglong, fields[2].Column.GetType()) - require.Equal(t, mysql.TypeVarchar, fields[3].Column.GetType()) - require.Equal(t, mysql.TypeVarchar, fields[4].Column.GetType()) - require.Equal(t, mysql.TypeLonglong, fields[5].Column.GetType()) + tk.MustExec(`create database AAAA`) + tk.MustExec(`create database BBBB`) + tk.MustExec(`grant select on AAAA.* to 'show'@'%'`) + tk.MustExec(`grant select on BBBB.* to 'show'@'%'`) + + tk1 := testkit.NewTestKit(t, store) + require.True(t, tk1.Session().Auth(&auth.UserIdentity{Username: "show", Hostname: "%"}, nil, nil)) + tk1.MustQuery("show databases").Check(testkit.Rows("INFORMATION_SCHEMA", "AAAA", "BBBB")) + + tk.MustExec(`drop user 'show'@'%'`) + tk.MustExec(`drop database AAAA`) + tk.MustExec(`drop database BBBB`) } -func TestShowTableStatus(t *testing.T) { +func TestShowWarnings(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) - tk.MustExec("use test") - tk.MustExec(`drop table if exists t;`) - tk.MustExec(`create table t(a bigint);`) + testSQL := `create table if not exists show_warnings (a int)` + tk.MustExec(testSQL) + tk.MustExec("set @@sql_mode=''") + tk.MustExec("insert show_warnings values ('a')") + require.Equal(t, uint16(1), tk.Session().GetSessionVars().StmtCtx.WarningCount()) + tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1292|Truncated incorrect DOUBLE value: 'a'")) + require.Equal(t, uint16(0), tk.Session().GetSessionVars().StmtCtx.WarningCount()) + tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1292|Truncated incorrect DOUBLE value: 'a'")) + require.Equal(t, uint16(0), tk.Session().GetSessionVars().StmtCtx.WarningCount()) - tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "192.168.0.1", AuthUsername: "root", AuthHostname: "%"}, nil, []byte("012345678901234567890")) + // Test Warning level 'Error' + testSQL = `create table show_warnings (a int)` + _, _ = tk.Exec(testSQL) + // FIXME: Table 'test.show_warnings' already exists + require.Equal(t, uint16(1), tk.Session().GetSessionVars().StmtCtx.WarningCount()) + tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Error|1050|Table 'test.show_warnings' already exists")) + tk.MustQuery("select @@error_count").Check(testkit.RowsWithSep("|", "1")) - // It's not easy to test the result contents because every time the test runs, "Create_time" changed. - tk.MustExec("show table status;") - rs, err := tk.Exec("show table status;") + // Test Warning level 'Note' + testSQL = `create table show_warnings_2 (a int)` + tk.MustExec(testSQL) + testSQL = `create table if not exists show_warnings_2 like show_warnings` + _, err := tk.Exec(testSQL) require.NoError(t, err) - require.NotNil(t, rs) - rows, err := session.GetRows4Test(context.Background(), tk.Session(), rs) - require.NoError(t, err) - err = rs.Close() - require.NoError(t, err) - require.Equal(t, 1, len(rows)) + require.Equal(t, uint16(1), tk.Session().GetSessionVars().StmtCtx.WarningCount()) + tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Note|1050|Table 'test.show_warnings_2' already exists")) + tk.MustQuery("select @@warning_count").Check(testkit.RowsWithSep("|", "1")) + tk.MustQuery("select @@warning_count").Check(testkit.RowsWithSep("|", "0")) +} - for i := range rows { - row := rows[i] - require.Equal(t, "t", row.GetString(0)) - require.Equal(t, "InnoDB", row.GetString(1)) - require.Equal(t, int64(10), row.GetInt64(2)) - require.Equal(t, "Compact", row.GetString(3)) - } - tk.MustExec(`drop table if exists tp;`) - tk.MustExec(`create table tp (a int) - partition by range(a) - ( partition p0 values less than (10), - partition p1 values less than (20), - partition p2 values less than (maxvalue) - );`) - rs, err = tk.Exec("show table status from test like 'tp';") - require.NoError(t, err) - rows, err = session.GetRows4Test(context.Background(), tk.Session(), rs) - require.NoError(t, err) - require.Equal(t, "partitioned", rows[0].GetString(16)) +func TestShowErrors(t *testing.T) { + store, clean := testkit.CreateMockStore(t) + defer clean() + tk := testkit.NewTestKit(t, store) + tk.MustExec("use test") + testSQL := `create table if not exists show_errors (a int)` + tk.MustExec(testSQL) + testSQL = `create table show_errors (a int)` + // FIXME: 'test.show_errors' already exists + _, _ = tk.Exec(testSQL) - tk.MustExec("create database UPPER_CASE") - tk.MustExec("use UPPER_CASE") - tk.MustExec("create table t (i int)") - rs, err = tk.Exec("show table status") - require.NoError(t, err) - require.NotNil(t, rs) - rows, err = session.GetRows4Test(context.Background(), tk.Session(), rs) - require.NoError(t, err) - err = rs.Close() - require.NoError(t, err) - require.Equal(t, 1, len(rows)) + tk.MustQuery("show errors").Check(testkit.RowsWithSep("|", "Error|1050|Table 'test.show_errors' already exists")) - tk.MustExec("use upper_case") - rs, err = tk.Exec("show table status") - require.NoError(t, err) - require.NotNil(t, rs) - rows, err = session.GetRows4Test(context.Background(), tk.Session(), rs) - require.NoError(t, err) - err = rs.Close() - require.NoError(t, err) - require.Equal(t, 1, len(rows)) + // eliminate previous errors + tk.MustExec("select 1") + _, _ = tk.Exec("create invalid") + tk.MustQuery("show errors").Check(testkit.RowsWithSep("|", "Error|1064|You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 14 near \"invalid\" ")) +} - tk.MustExec("drop database UPPER_CASE") +func TestShowWarningsForExprPushdown(t *testing.T) { + store, dom, clean := testkit.CreateMockStoreAndDomain(t) + defer clean() + tk := testkit.NewTestKit(t, store) + tk.MustExec("use test") + testSQL := `create table if not exists show_warnings_expr_pushdown (a int, value date)` + tk.MustExec(testSQL) + + // create tiflash replica + { + is := dom.InfoSchema() + db, exists := is.SchemaByName(model.NewCIStr("test")) + require.True(t, exists) + for _, tblInfo := range db.Tables { + if tblInfo.Name.L == "show_warnings_expr_pushdown" { + tblInfo.TiFlashReplica = &model.TiFlashReplicaInfo{ + Count: 1, + Available: true, + } + } + } + } + tk.MustExec("set tidb_allow_mpp=0") + tk.MustExec("explain select * from show_warnings_expr_pushdown t where md5(value) = '2020-01-01'") + require.Equal(t, uint16(1), tk.Session().GetSessionVars().StmtCtx.WarningCount()) + tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1105|Scalar function 'md5'(signature: MD5, return type: var_string(32)) is not supported to push down to tiflash now.")) + tk.MustExec("explain select max(md5(value)) from show_warnings_expr_pushdown group by a") + require.Equal(t, uint16(2), tk.Session().GetSessionVars().StmtCtx.WarningCount()) + tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1105|Scalar function 'md5'(signature: MD5, return type: var_string(32)) is not supported to push down to tiflash now.", "Warning|1105|Aggregation can not be pushed to tiflash because arguments of AggFunc `max` contains unsupported exprs")) + tk.MustExec("explain select max(a) from show_warnings_expr_pushdown group by md5(value)") + require.Equal(t, uint16(2), tk.Session().GetSessionVars().StmtCtx.WarningCount()) + tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1105|Scalar function 'md5'(signature: MD5, return type: var_string(32)) is not supported to push down to tiflash now.", "Warning|1105|Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs")) + tk.MustExec("set tidb_opt_distinct_agg_push_down=0") + tk.MustExec("explain select max(distinct a) from show_warnings_expr_pushdown group by value") + require.Equal(t, uint16(0), tk.Session().GetSessionVars().StmtCtx.WarningCount()) + // tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1105|Aggregation can not be pushed to storage layer in non-mpp mode because it contains agg function with distinct")) } -func TestShowSlow(t *testing.T) { +func TestShowGrantsPrivilege(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) - // The test result is volatile, because - // 1. Slow queries is stored in domain, which may be affected by other tests. - // 2. Collecting slow queries is a asynchronous process, check immediately may not get the expected result. - // 3. Make slow query like "select sleep(1)" would slow the CI. - // So, we just cover the code but do not check the result. - tk.MustQuery(`admin show slow recent 3`) - tk.MustQuery(`admin show slow top 3`) - tk.MustQuery(`admin show slow top internal 3`) - tk.MustQuery(`admin show slow top all 3`) + tk.MustExec("create user show_grants") + tk.MustExec("show grants for show_grants") + tk1 := testkit.NewTestKit(t, store) + require.True(t, tk1.Session().Auth(&auth.UserIdentity{Username: "show_grants", Hostname: "%"}, nil, nil)) + err := tk1.QueryToErr("show grants for root") + require.EqualError(t, executor.ErrDBaccessDenied.GenWithStackByArgs("show_grants", "%", mysql.SystemDB), err.Error()) + // Test show grants for user with auth host name `%`. + tk2 := testkit.NewTestKit(t, store) + require.True(t, tk2.Session().Auth(&auth.UserIdentity{Username: "show_grants", Hostname: "127.0.0.1", AuthUsername: "show_grants", AuthHostname: "%"}, nil, nil)) + tk2.MustQuery("show grants") } -func TestShowOpenTables(t *testing.T) { +func TestShowStatsPrivilege(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) - tk.MustQuery("show open tables") - tk.MustQuery("show open tables in test") + tk.MustExec("create user show_stats") + tk1 := testkit.NewTestKit(t, store) + + require.True(t, tk1.Session().Auth(&auth.UserIdentity{Username: "show_stats", Hostname: "%"}, nil, nil)) + eqErr := plannercore.ErrDBaccessDenied.GenWithStackByArgs("show_stats", "%", mysql.SystemDB) + _, err := tk1.Exec("show stats_meta") + require.EqualError(t, err, eqErr.Error()) + _, err = tk1.Exec("SHOW STATS_BUCKETS") + require.EqualError(t, err, eqErr.Error()) + _, err = tk1.Exec("SHOW STATS_HEALTHY") + require.EqualError(t, err, eqErr.Error()) + _, err = tk1.Exec("SHOW STATS_HISTOGRAMS") + require.EqualError(t, err, eqErr.Error()) + tk.MustExec("grant select on mysql.* to show_stats") + tk1.MustExec("show stats_meta") + tk1.MustExec("SHOW STATS_BUCKETS") + tk1.MustExec("SHOW STATS_HEALTHY") + tk1.MustExec("SHOW STATS_HISTOGRAMS") } -func TestShowCreateViewDefiner(t *testing.T) { + +func TestIssue18878(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) - require.True(t, tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "%", AuthUsername: "root", AuthHostname: "%"}, nil, nil)) + require.True(t, tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "127.0.0.1", AuthHostname: "%"}, nil, nil)) + tk.MustQuery("select user()").Check(testkit.Rows("root@127.0.0.1")) + tk.MustQuery("show grants") + tk.MustQuery("select user()").Check(testkit.Rows("root@127.0.0.1")) + err := tk.QueryToErr("show grants for root@127.0.0.1") + require.Equal(t, privileges.ErrNonexistingGrant.FastGenByArgs("root", "127.0.0.1").Error(), err.Error()) + err = tk.QueryToErr("show grants for root@localhost") + require.Equal(t, privileges.ErrNonexistingGrant.FastGenByArgs("root", "localhost").Error(), err.Error()) + err = tk.QueryToErr("show grants for root@1.1.1.1") + require.Equal(t, privileges.ErrNonexistingGrant.FastGenByArgs("root", "1.1.1.1").Error(), err.Error()) + tk.MustExec("create user `show_grants`@`127.0.%`") + err = tk.QueryToErr("show grants for `show_grants`@`127.0.0.1`") + require.Equal(t, privileges.ErrNonexistingGrant.FastGenByArgs("show_grants", "127.0.0.1").Error(), err.Error()) + tk.MustQuery("show grants for `show_grants`@`127.0.%`") +} - tk.MustExec("use test") - tk.MustExec("create or replace view v1 as select 1") - tk.MustQuery("show create view v1").Check(testkit.RowsWithSep("|", "v1|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v1` (`1`) AS SELECT 1 AS `1`|utf8mb4|utf8mb4_bin")) - tk.MustExec("drop view v1") +func TestIssue17794(t *testing.T) { + store, clean := testkit.CreateMockStore(t) + defer clean() + tk := testkit.NewTestKit(t, store) + tk.MustExec("CREATE USER 'root'@'8.8.%'") + require.True(t, tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "9.9.9.9", AuthHostname: "%"}, nil, nil)) + + tk1 := testkit.NewTestKit(t, store) + require.True(t, tk1.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "8.8.8.8", AuthHostname: "8.8.%"}, nil, nil)) + tk.MustQuery("show grants").Check(testkit.Rows("GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION")) + tk1.MustQuery("show grants").Check(testkit.Rows("GRANT USAGE ON *.* TO 'root'@'8.8.%'")) } -func TestShowCreateTable(t *testing.T) { +func TestIssue3641(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) + _, err := tk.Exec("show tables;") + require.Equal(t, plannercore.ErrNoDB.Error(), err.Error()) + _, err = tk.Exec("show table status;") + require.Equal(t, plannercore.ErrNoDB.Error(), err.Error()) +} - tk.MustExec("use test") - tk.MustExec("drop table if exists t1") - tk.MustExec("create table t1(a int,b int)") - tk.MustExec("drop view if exists v1") - tk.MustExec("create or replace definer=`root`@`127.0.0.1` view v1 as select * from t1") - tk.MustQuery("show create table v1").Check(testkit.RowsWithSep("|", "v1|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `v1` (`a`, `b`) AS SELECT `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` FROM `test`.`t1`|utf8mb4|utf8mb4_bin")) - tk.MustQuery("show create view v1").Check(testkit.RowsWithSep("|", "v1|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `v1` (`a`, `b`) AS SELECT `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` FROM `test`.`t1`|utf8mb4|utf8mb4_bin")) - tk.MustExec("drop view v1") - tk.MustExec("drop table t1") +func TestIssue10549(t *testing.T) { + store, clean := testkit.CreateMockStore(t) + defer clean() + tk := testkit.NewTestKit(t, store) + tk.MustExec("CREATE DATABASE newdb;") + tk.MustExec("CREATE ROLE 'app_developer';") + tk.MustExec("GRANT ALL ON newdb.* TO 'app_developer';") + tk.MustExec("CREATE USER 'dev';") + tk.MustExec("GRANT 'app_developer' TO 'dev';") + tk.MustExec("SET DEFAULT ROLE app_developer TO 'dev';") - tk.MustExec("drop view if exists v") - tk.MustExec("create or replace definer=`root`@`127.0.0.1` view v as select JSON_MERGE('{}', '{}') as col;") - tk.MustQuery("show create view v").Check(testkit.RowsWithSep("|", "v|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `v` (`col`) AS SELECT JSON_MERGE(_UTF8MB4'{}', _UTF8MB4'{}') AS `col`|utf8mb4|utf8mb4_bin")) - tk.MustExec("drop view if exists v") + require.True(t, tk.Session().Auth(&auth.UserIdentity{Username: "dev", Hostname: "%", AuthUsername: "dev", AuthHostname: "%"}, nil, nil)) + tk.MustQuery("SHOW DATABASES;").Check(testkit.Rows("INFORMATION_SCHEMA", "newdb")) + tk.MustQuery("SHOW GRANTS;").Check(testkit.Rows("GRANT USAGE ON *.* TO 'dev'@'%'", "GRANT ALL PRIVILEGES ON newdb.* TO 'dev'@'%'", "GRANT 'app_developer'@'%' TO 'dev'@'%'")) + tk.MustQuery("SHOW GRANTS FOR CURRENT_USER").Check(testkit.Rows("GRANT USAGE ON *.* TO 'dev'@'%'", "GRANT ALL PRIVILEGES ON newdb.* TO 'dev'@'%'", "GRANT 'app_developer'@'%' TO 'dev'@'%'")) + tk.MustQuery("SHOW GRANTS FOR dev").Check(testkit.Rows("GRANT USAGE ON *.* TO 'dev'@'%'", "GRANT 'app_developer'@'%' TO 'dev'@'%'")) +} - tk.MustExec("drop table if exists t1") - tk.MustExec("create table t1(a int,b int)") - tk.MustExec("create or replace definer=`root`@`127.0.0.1` view v1 as select avg(a),t1.* from t1 group by a") - tk.MustQuery("show create view v1").Check(testkit.RowsWithSep("|", "v1|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `v1` (`avg(a)`, `a`, `b`) AS SELECT AVG(`a`) AS `avg(a)`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` FROM `test`.`t1` GROUP BY `a`|utf8mb4|utf8mb4_bin")) - tk.MustExec("drop view v1") - tk.MustExec("create or replace definer=`root`@`127.0.0.1` view v1 as select a+b, t1.* , a as c from t1") - tk.MustQuery("show create view v1").Check(testkit.RowsWithSep("|", "v1|CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `v1` (`a+b`, `a`, `b`, `c`) AS SELECT `a`+`b` AS `a+b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`a` AS `c` FROM `test`.`t1`|utf8mb4|utf8mb4_bin")) - tk.MustExec("drop table t1") - tk.MustExec("drop view v1") +func TestIssue11165(t *testing.T) { + store, clean := testkit.CreateMockStore(t) + defer clean() + tk := testkit.NewTestKit(t, store) + tk.MustExec("CREATE ROLE 'r_manager';") + tk.MustExec("CREATE USER 'manager'@'localhost';") + tk.MustExec("GRANT 'r_manager' TO 'manager'@'localhost';") - // For issue #9211 - tk.MustExec("create table t(c int, b int as (c + 1))ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;") - tk.MustQuery("show create table `t`").Check(testkit.RowsWithSep("|", - ""+ - "t CREATE TABLE `t` (\n"+ - " `c` int(11) DEFAULT NULL,\n"+ - " `b` int(11) GENERATED ALWAYS AS (`c` + 1) VIRTUAL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) + require.True(t, tk.Session().Auth(&auth.UserIdentity{Username: "manager", Hostname: "localhost", AuthUsername: "manager", AuthHostname: "localhost"}, nil, nil)) + tk.MustExec("SET DEFAULT ROLE ALL TO 'manager'@'localhost';") + tk.MustExec("SET DEFAULT ROLE NONE TO 'manager'@'localhost';") + tk.MustExec("SET DEFAULT ROLE 'r_manager' TO 'manager'@'localhost';") +} - tk.MustExec("drop table t") - tk.MustExec("create table t(c int, b int as (c + 1) not null)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;") - tk.MustQuery("show create table `t`").Check(testkit.RowsWithSep("|", - ""+ - "t CREATE TABLE `t` (\n"+ - " `c` int(11) DEFAULT NULL,\n"+ - " `b` int(11) GENERATED ALWAYS AS (`c` + 1) VIRTUAL NOT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) - tk.MustExec("drop table t") - tk.MustExec("create table t ( a char(10) charset utf8 collate utf8_bin, b char(10) as (rtrim(a)));") - tk.MustQuery("show create table `t`").Check(testkit.RowsWithSep("|", - ""+ - "t CREATE TABLE `t` (\n"+ - " `a` char(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,\n"+ - " `b` char(10) GENERATED ALWAYS AS (rtrim(`a`)) VIRTUAL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) - tk.MustExec("drop table t") +// TestShow2 is moved from session_test +func TestShow2(t *testing.T) { + store, dom, clean := testkit.CreateMockStoreAndDomain(t) + defer clean() + tk := testkit.NewTestKit(t, store) + tk.MustExec("use test") - tk.MustExec(`drop table if exists different_charset`) - tk.MustExec(`create table different_charset(ch1 varchar(10) charset utf8, ch2 varchar(10) charset binary);`) - tk.MustQuery(`show create table different_charset`).Check(testkit.RowsWithSep("|", - ""+ - "different_charset CREATE TABLE `different_charset` (\n"+ - " `ch1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,\n"+ - " `ch2` varbinary(10) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) + tk.MustExec("set global autocommit=0") + tk1 := testkit.NewTestKit(t, store) + tk1.MustQuery("show global variables where variable_name = 'autocommit'").Check(testkit.Rows("autocommit OFF")) + tk.MustExec("set global autocommit = 1") + tk2 := testkit.NewTestKit(t, store) + tk2.MustQuery("show global variables where variable_name = 'autocommit'").Check(testkit.Rows("autocommit ON")) + + // TODO: Specifying the charset for national char/varchar should not be supported. + tk.MustExec("drop table if exists test_full_column") + tk.MustExec(`create table test_full_column( + c_int int, + c_float float, + c_bit bit, + c_bool bool, + c_char char(1) charset ascii collate ascii_bin, + c_nchar national char(1) charset ascii collate ascii_bin, + c_binary binary, + c_varchar varchar(1) charset ascii collate ascii_bin, + c_varchar_default varchar(20) charset ascii collate ascii_bin default 'cUrrent_tImestamp', + c_nvarchar national varchar(1) charset ascii collate ascii_bin, + c_varbinary varbinary(1), + c_year year, + c_date date, + c_time time, + c_datetime datetime, + c_datetime_default datetime default current_timestamp, + c_datetime_default_2 datetime(2) default current_timestamp(2), + c_timestamp timestamp, + c_timestamp_default timestamp default current_timestamp, + c_timestamp_default_3 timestamp(3) default current_timestamp(3), + c_timestamp_default_4 timestamp(3) default current_timestamp(3) on update current_timestamp(3), + c_blob blob, + c_tinyblob tinyblob, + c_mediumblob mediumblob, + c_longblob longblob, + c_text text charset ascii collate ascii_bin, + c_tinytext tinytext charset ascii collate ascii_bin, + c_mediumtext mediumtext charset ascii collate ascii_bin, + c_longtext longtext charset ascii collate ascii_bin, + c_json json, + c_enum enum('1') charset ascii collate ascii_bin, + c_set set('1') charset ascii collate ascii_bin + );`) + + tk.MustQuery(`show full columns from test_full_column`).Check(testkit.Rows( + "" + + "c_int int(11) YES select,insert,update,references ]\n" + + "[c_float float YES select,insert,update,references ]\n" + + "[c_bit bit(1) YES select,insert,update,references ]\n" + + "[c_bool tinyint(1) YES select,insert,update,references ]\n" + + "[c_char char(1) ascii_bin YES select,insert,update,references ]\n" + + "[c_nchar char(1) ascii_bin YES select,insert,update,references ]\n" + + "[c_binary binary(1) YES select,insert,update,references ]\n" + + "[c_varchar varchar(1) ascii_bin YES select,insert,update,references ]\n" + + "[c_varchar_default varchar(20) ascii_bin YES cUrrent_tImestamp select,insert,update,references ]\n" + + "[c_nvarchar varchar(1) ascii_bin YES select,insert,update,references ]\n" + + "[c_varbinary varbinary(1) YES select,insert,update,references ]\n" + + "[c_year year(4) YES select,insert,update,references ]\n" + + "[c_date date YES select,insert,update,references ]\n" + + "[c_time time YES select,insert,update,references ]\n" + + "[c_datetime datetime YES select,insert,update,references ]\n" + + "[c_datetime_default datetime YES CURRENT_TIMESTAMP select,insert,update,references ]\n" + + "[c_datetime_default_2 datetime(2) YES CURRENT_TIMESTAMP(2) select,insert,update,references ]\n" + + "[c_timestamp timestamp YES select,insert,update,references ]\n" + + "[c_timestamp_default timestamp YES CURRENT_TIMESTAMP select,insert,update,references ]\n" + + "[c_timestamp_default_3 timestamp(3) YES CURRENT_TIMESTAMP(3) select,insert,update,references ]\n" + + "[c_timestamp_default_4 timestamp(3) YES CURRENT_TIMESTAMP(3) DEFAULT_GENERATED on update CURRENT_TIMESTAMP(3) select,insert,update,references ]\n" + + "[c_blob blob YES select,insert,update,references ]\n" + + "[c_tinyblob tinyblob YES select,insert,update,references ]\n" + + "[c_mediumblob mediumblob YES select,insert,update,references ]\n" + + "[c_longblob longblob YES select,insert,update,references ]\n" + + "[c_text text ascii_bin YES select,insert,update,references ]\n" + + "[c_tinytext tinytext ascii_bin YES select,insert,update,references ]\n" + + "[c_mediumtext mediumtext ascii_bin YES select,insert,update,references ]\n" + + "[c_longtext longtext ascii_bin YES select,insert,update,references ]\n" + + "[c_json json YES select,insert,update,references ]\n" + + "[c_enum enum('1') ascii_bin YES select,insert,update,references ]\n" + + "[c_set set('1') ascii_bin YES select,insert,update,references ")) + + tk.MustExec("drop table if exists test_full_column") tk.MustExec("drop table if exists t") - tk.MustExec("create table `t` (\n" + - "`a` timestamp not null default current_timestamp,\n" + - "`b` timestamp(3) default current_timestamp(3),\n" + - "`c` datetime default current_timestamp,\n" + - "`d` datetime(4) default current_timestamp(4),\n" + - "`e` varchar(20) default 'cUrrent_tImestamp',\n" + - "`f` datetime(2) default current_timestamp(2) on update current_timestamp(2),\n" + - "`g` timestamp(2) default current_timestamp(2) on update current_timestamp(2))") - tk.MustQuery("show create table `t`").Check(testkit.RowsWithSep("|", - ""+ - "t CREATE TABLE `t` (\n"+ - " `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n"+ - " `b` timestamp(3) DEFAULT CURRENT_TIMESTAMP(3),\n"+ - " `c` datetime DEFAULT CURRENT_TIMESTAMP,\n"+ - " `d` datetime(4) DEFAULT CURRENT_TIMESTAMP(4),\n"+ - " `e` varchar(20) DEFAULT 'cUrrent_tImestamp',\n"+ - " `f` datetime(2) DEFAULT CURRENT_TIMESTAMP(2) ON UPDATE CURRENT_TIMESTAMP(2),\n"+ - " `g` timestamp(2) DEFAULT CURRENT_TIMESTAMP(2) ON UPDATE CURRENT_TIMESTAMP(2)\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) - tk.MustExec("drop table t") + tk.MustExec(`create table if not exists t (c int) comment '注释'`) + tk.MustExec("create or replace definer='root'@'localhost' view v as select * from t") + tk.MustQuery(`show columns from t`).Check(testkit.RowsWithSep(",", "c,int(11),YES,,,")) + tk.MustQuery(`describe t`).Check(testkit.RowsWithSep(",", "c,int(11),YES,,,")) + tk.MustQuery(`show columns from v`).Check(testkit.RowsWithSep(",", "c,int(11),YES,,,")) + tk.MustQuery(`describe v`).Check(testkit.RowsWithSep(",", "c,int(11),YES,,,")) + tk.MustQuery("show collation where Charset = 'utf8' and Collation = 'utf8_bin'").Check(testkit.RowsWithSep(",", "utf8_bin,utf8,83,Yes,Yes,1")) + tk.MustExec(`drop sequence if exists seq`) + tk.MustExec(`create sequence seq`) + tk.MustQuery("show tables").Check(testkit.Rows("seq", "t", "v")) + tk.MustQuery("show full tables").Check(testkit.Rows("seq SEQUENCE", "t BASE TABLE", "v VIEW")) - tk.MustExec("create table t (a int, b int) shard_row_id_bits = 4 pre_split_regions=3;") - tk.MustQuery("show create table `t`").Check(testkit.RowsWithSep("|", - ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL,\n"+ - " `b` int(11) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T! SHARD_ROW_ID_BITS=4 PRE_SPLIT_REGIONS=3 */", - )) - tk.MustExec("drop table t") + // Bug 19427 + tk.MustQuery("SHOW FULL TABLES in INFORMATION_SCHEMA like 'VIEWS'").Check(testkit.Rows("VIEWS SYSTEM VIEW")) + tk.MustQuery("SHOW FULL TABLES in information_schema like 'VIEWS'").Check(testkit.Rows("VIEWS SYSTEM VIEW")) + tk.MustQuery("SHOW FULL TABLES in metrics_schema like 'uptime'").Check(testkit.Rows("uptime SYSTEM VIEW")) - // for issue #20446 - tk.MustExec("drop table if exists t1;") - tk.MustExec("create table t1(c int unsigned default 0);") - tk.MustQuery("show create table `t1`").Check(testkit.RowsWithSep("|", - ""+ - "t1 CREATE TABLE `t1` (\n"+ - " `c` int(10) unsigned DEFAULT '0'\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) - tk.MustExec("drop table t1") + is := dom.InfoSchema() + tblInfo, err := is.TableByName(model.NewCIStr("test"), model.NewCIStr("t")) + require.NoError(t, err) + createTime := model.TSConvert2Time(tblInfo.Meta().UpdateTS).Format("2006-01-02 15:04:05") - tk.MustExec("CREATE TABLE `log` (" + - "`LOG_ID` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT," + - "`ROUND_ID` bigint(20) UNSIGNED NOT NULL," + - "`USER_ID` int(10) UNSIGNED NOT NULL," + - "`USER_IP` int(10) UNSIGNED DEFAULT NULL," + - "`END_TIME` datetime NOT NULL," + - "`USER_TYPE` int(11) DEFAULT NULL," + - "`APP_ID` int(11) DEFAULT NULL," + - "PRIMARY KEY (`LOG_ID`,`END_TIME`)," + - "KEY `IDX_EndTime` (`END_TIME`)," + - "KEY `IDX_RoundId` (`ROUND_ID`)," + - "KEY `IDX_UserId_EndTime` (`USER_ID`,`END_TIME`)" + - ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=505488 " + - "PARTITION BY RANGE ( month(`end_time`) ) (" + - "PARTITION `p1` VALUES LESS THAN (2)," + - "PARTITION `p2` VALUES LESS THAN (3)," + - "PARTITION `p3` VALUES LESS THAN (4)," + - "PARTITION `p4` VALUES LESS THAN (5)," + - "PARTITION `p5` VALUES LESS THAN (6)," + - "PARTITION `p6` VALUES LESS THAN (7)," + - "PARTITION `p7` VALUES LESS THAN (8)," + - "PARTITION `p8` VALUES LESS THAN (9)," + - "PARTITION `p9` VALUES LESS THAN (10)," + - "PARTITION `p10` VALUES LESS THAN (11)," + - "PARTITION `p11` VALUES LESS THAN (12)," + - "PARTITION `p12` VALUES LESS THAN (MAXVALUE))") - tk.MustQuery("show create table log").Check(testkit.RowsWithSep("|", - "log CREATE TABLE `log` (\n"+ - " `LOG_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n"+ - " `ROUND_ID` bigint(20) unsigned NOT NULL,\n"+ - " `USER_ID` int(10) unsigned NOT NULL,\n"+ - " `USER_IP` int(10) unsigned DEFAULT NULL,\n"+ - " `END_TIME` datetime NOT NULL,\n"+ - " `USER_TYPE` int(11) DEFAULT NULL,\n"+ - " `APP_ID` int(11) DEFAULT NULL,\n"+ - " PRIMARY KEY (`LOG_ID`,`END_TIME`) /*T![clustered_index] NONCLUSTERED */,\n"+ - " KEY `IDX_EndTime` (`END_TIME`),\n"+ - " KEY `IDX_RoundId` (`ROUND_ID`),\n"+ - " KEY `IDX_UserId_EndTime` (`USER_ID`,`END_TIME`)\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=505488\n"+ - "PARTITION BY RANGE (MONTH(`end_time`))\n"+ - "(PARTITION `p1` VALUES LESS THAN (2),\n"+ - " PARTITION `p2` VALUES LESS THAN (3),\n"+ - " PARTITION `p3` VALUES LESS THAN (4),\n"+ - " PARTITION `p4` VALUES LESS THAN (5),\n"+ - " PARTITION `p5` VALUES LESS THAN (6),\n"+ - " PARTITION `p6` VALUES LESS THAN (7),\n"+ - " PARTITION `p7` VALUES LESS THAN (8),\n"+ - " PARTITION `p8` VALUES LESS THAN (9),\n"+ - " PARTITION `p9` VALUES LESS THAN (10),\n"+ - " PARTITION `p10` VALUES LESS THAN (11),\n"+ - " PARTITION `p11` VALUES LESS THAN (12),\n"+ - " PARTITION `p12` VALUES LESS THAN (MAXVALUE))")) + // The Hostname is the actual host + tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "192.168.0.1", AuthUsername: "root", AuthHostname: "%"}, nil, []byte("012345678901234567890")) - // for issue #11831 - tk.MustExec("create table ttt4(a varchar(123) default null collate utf8mb4_unicode_ci)engine=innodb default charset=utf8mb4 collate=utf8mb4_unicode_ci;") - tk.MustQuery("show create table `ttt4`").Check(testkit.RowsWithSep("|", - ""+ - "ttt4 CREATE TABLE `ttt4` (\n"+ - " `a` varchar(123) COLLATE utf8mb4_unicode_ci DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", - )) - tk.MustExec("create table ttt5(a varchar(123) default null)engine=innodb default charset=utf8mb4 collate=utf8mb4_bin;") - tk.MustQuery("show create table `ttt5`").Check(testkit.RowsWithSep("|", - ""+ - "ttt5 CREATE TABLE `ttt5` (\n"+ - " `a` varchar(123) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) + r := tk.MustQuery("show table status from test like 't'") + r.Check(testkit.Rows(fmt.Sprintf("t InnoDB 10 Compact 0 0 0 0 0 0 %s utf8mb4_bin 注释", createTime))) - // for expression index - tk.MustExec("drop table if exists t;") - tk.MustExec("create table t(a int, b real);") - tk.MustExec("alter table t add index expr_idx((a*b+1));") - tk.MustQuery("show create table t;").Check(testkit.RowsWithSep("|", - ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL,\n"+ - " `b` double DEFAULT NULL,\n"+ - " KEY `expr_idx` ((`a` * `b` + 1))\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) + tk.MustQuery("show databases like 'test'").Check(testkit.Rows("test")) - // Fix issue #15175, show create table sequence_name. - tk.MustExec("drop sequence if exists seq") - tk.MustExec("create sequence seq") - tk.MustQuery("show create table seq;").Check(testkit.Rows("seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB")) + tk.MustExec(`grant all on *.* to 'root'@'%'`) + tk.MustQuery("show grants").Check(testkit.Rows(`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION`)) - // Test for issue #15633, 'binary' collation should be ignored in the result of 'show create table'. - tk.MustExec(`drop table if exists binary_collate`) - tk.MustExec(`create table binary_collate(a varchar(10)) default collate=binary;`) - tk.MustQuery(`show create table binary_collate`).Check(testkit.RowsWithSep("|", - ""+ - "binary_collate CREATE TABLE `binary_collate` (\n"+ - " `a` varbinary(10) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=binary", // binary collate is ignored - )) - tk.MustExec(`drop table if exists binary_collate`) - tk.MustExec(`create table binary_collate(a varchar(10)) default charset=binary collate=binary;`) - tk.MustQuery(`show create table binary_collate`).Check(testkit.RowsWithSep("|", - ""+ - "binary_collate CREATE TABLE `binary_collate` (\n"+ - " `a` varbinary(10) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=binary", // binary collate is ignored - )) - tk.MustExec(`drop table if exists binary_collate`) - tk.MustExec(`create table binary_collate(a varchar(10)) default charset=utf8mb4 collate=utf8mb4_bin;`) - tk.MustQuery(`show create table binary_collate`).Check(testkit.RowsWithSep("|", - ""+ - "binary_collate CREATE TABLE `binary_collate` (\n"+ - " `a` varchar(10) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", // non-binary collate is kept. - )) - // Test for issue #17 in bug competition, default num and sequence should be shown without quote. - tk.MustExec(`drop table if exists default_num`) - tk.MustExec("create table default_num(a int default 11)") - tk.MustQuery("show create table default_num").Check(testkit.RowsWithSep("|", - ""+ - "default_num CREATE TABLE `default_num` (\n"+ - " `a` int(11) DEFAULT '11'\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) - tk.MustExec(`drop table if exists default_varchar`) - tk.MustExec("create table default_varchar(a varchar(10) default \"haha\")") - tk.MustQuery("show create table default_varchar").Check(testkit.RowsWithSep("|", - ""+ - "default_varchar CREATE TABLE `default_varchar` (\n"+ - " `a` varchar(10) DEFAULT 'haha'\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) - tk.MustExec(`drop table if exists default_sequence`) - tk.MustExec("create table default_sequence(a int default nextval(seq))") - tk.MustQuery("show create table default_sequence").Check(testkit.RowsWithSep("|", - ""+ - "default_sequence CREATE TABLE `default_sequence` (\n"+ - " `a` int(11) DEFAULT nextval(`test`.`seq`)\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) + tk.MustQuery("show grants for current_user()").Check(testkit.Rows(`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION`)) + tk.MustQuery("show grants for current_user").Check(testkit.Rows(`GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION`)) +} - // TiDB defaults (and only supports) foreign_key_checks=0 - // This means that the child table can be created before the parent table. - // This behavior is required for mysqldump restores. - tk.MustExec(`DROP TABLE IF EXISTS parent, child`) - tk.MustExec(`CREATE TABLE child (id INT NOT NULL PRIMARY KEY auto_increment, parent_id INT NOT NULL, INDEX par_ind (parent_id), CONSTRAINT child_ibfk_1 FOREIGN KEY (parent_id) REFERENCES parent(id))`) - tk.MustExec(`CREATE TABLE parent ( id INT NOT NULL PRIMARY KEY auto_increment )`) - tk.MustQuery(`show create table child`).Check(testkit.RowsWithSep("|", - ""+ - "child CREATE TABLE `child` (\n"+ - " `id` int(11) NOT NULL AUTO_INCREMENT,\n"+ - " `parent_id` int(11) NOT NULL,\n"+ - " PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,\n"+ - " KEY `par_ind` (`parent_id`),\n"+ - " CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`)\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) +func TestShowCreateUser(t *testing.T) { + store, clean := testkit.CreateMockStore(t) + defer clean() + tk := testkit.NewTestKit(t, store) + // Create a new user. + tk.MustExec(`CREATE USER 'test_show_create_user'@'%' IDENTIFIED BY 'root';`) + tk.MustQuery("show create user 'test_show_create_user'@'%'"). + Check(testkit.Rows(`CREATE USER 'test_show_create_user'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK`)) - // Test Foreign keys + ON DELETE / ON UPDATE - tk.MustExec(`DROP TABLE child`) - tk.MustExec(`CREATE TABLE child (id INT NOT NULL PRIMARY KEY auto_increment, parent_id INT NOT NULL, INDEX par_ind (parent_id), CONSTRAINT child_ibfk_1 FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE SET NULL ON UPDATE CASCADE)`) - tk.MustQuery(`show create table child`).Check(testkit.RowsWithSep("|", - ""+ - "child CREATE TABLE `child` (\n"+ - " `id` int(11) NOT NULL AUTO_INCREMENT,\n"+ - " `parent_id` int(11) NOT NULL,\n"+ - " PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,\n"+ - " KEY `par_ind` (`parent_id`),\n"+ - " CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE SET NULL ON UPDATE CASCADE\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", - )) + tk.MustExec(`CREATE USER 'test_show_create_user'@'localhost' IDENTIFIED BY 'test';`) + tk.MustQuery("show create user 'test_show_create_user'@'localhost';"). + Check(testkit.Rows(`CREATE USER 'test_show_create_user'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK`)) - // Test issue #20327 - tk.MustExec("drop table if exists t;") - tk.MustExec("create table t(a int, b char(10) as ('a'));") - result := tk.MustQuery("show create table t;").Rows()[0][1] - require.Regexp(t, `(?s).*GENERATED ALWAYS AS \(_utf8mb4'a'\).*`, result) - tk.MustExec("drop table if exists t;") - tk.MustExec("create table t(a int, b char(10) as (_utf8'a'));") - result = tk.MustQuery("show create table t;").Rows()[0][1] - require.Regexp(t, `(?s).*GENERATED ALWAYS AS \(_utf8'a'\).*`, result) - // Test show list partition table - tk.MustExec("set @@session.tidb_enable_list_partition = ON") - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec(`create table t (id int, name varchar(10), unique index idx (id)) partition by list (id) ( - partition p0 values in (3,5,6,9,17), - partition p1 values in (1,2,10,11,19,20), - partition p2 values in (4,12,13,14,18), - partition p3 values in (7,8,15,16,null) - );`) - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", - "t CREATE TABLE `t` (\n"+ - " `id` int(11) DEFAULT NULL,\n"+ - " `name` varchar(10) DEFAULT NULL,\n"+ - " UNIQUE KEY `idx` (`id`)\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ - "PARTITION BY LIST (`id`)\n"+ - "(PARTITION `p0` VALUES IN (3,5,6,9,17),\n"+ - " PARTITION `p1` VALUES IN (1,2,10,11,19,20),\n"+ - " PARTITION `p2` VALUES IN (4,12,13,14,18),\n"+ - " PARTITION `p3` VALUES IN (7,8,15,16,NULL))")) - // Test show list column partition table - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec(`create table t (id int, name varchar(10), unique index idx (id)) partition by list columns (id) ( - partition p0 values in (3,5,6,9,17), - partition p1 values in (1,2,10,11,19,20), - partition p2 values in (4,12,13,14,18), - partition p3 values in (7,8,15,16,null) - );`) - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", - "t CREATE TABLE `t` (\n"+ - " `id` int(11) DEFAULT NULL,\n"+ - " `name` varchar(10) DEFAULT NULL,\n"+ - " UNIQUE KEY `idx` (`id`)\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ - "PARTITION BY LIST COLUMNS(`id`)\n"+ - "(PARTITION `p0` VALUES IN (3,5,6,9,17),\n"+ - " PARTITION `p1` VALUES IN (1,2,10,11,19,20),\n"+ - " PARTITION `p2` VALUES IN (4,12,13,14,18),\n"+ - " PARTITION `p3` VALUES IN (7,8,15,16,NULL))")) - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec(`create table t (id int, name varchar(10), unique index idx (id, name)) partition by list columns (id, name) ( - partition p0 values in ((3, '1'), (5, '5')), - partition p1 values in ((1, '1')));`) - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", - "t CREATE TABLE `t` (\n"+ - " `id` int(11) DEFAULT NULL,\n"+ - " `name` varchar(10) DEFAULT NULL,\n"+ - " UNIQUE KEY `idx` (`id`,`name`)\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ - "PARTITION BY LIST COLUMNS(`id`,`name`)\n"+ - "(PARTITION `p0` VALUES IN ((3,\"1\"),(5,\"5\")),\n"+ - " PARTITION `p1` VALUES IN ((1,\"1\")))")) - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec(`create table t (id int primary key, v varchar(255) not null, key idx_v (v) comment 'foo\'bar')`) - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", - "t CREATE TABLE `t` (\n"+ - " `id` int(11) NOT NULL,\n"+ - " `v` varchar(255) NOT NULL,\n"+ - " PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,\n"+ - " KEY `idx_v` (`v`) COMMENT 'foo''bar'\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin")) + // Case: the user exists but the host portion doesn't match + err := tk.QueryToErr("show create user 'test_show_create_user'@'asdf';") + require.Equal(t, executor.ErrCannotUser.GenWithStackByArgs("SHOW CREATE USER", "'test_show_create_user'@'asdf'").Error(), err.Error()) - // For issue #29922 - tk.MustExec("CREATE TABLE `thash` (\n `id` bigint unsigned NOT NULL,\n `data` varchar(255) DEFAULT NULL,\n PRIMARY KEY (`id`)\n)\nPARTITION BY HASH (`id`)\n(PARTITION pEven COMMENT = \"Even ids\",\n PARTITION pOdd COMMENT = \"Odd ids\");") - tk.MustQuery("show create table `thash`").Check(testkit.RowsWithSep("|", ""+ - "thash CREATE TABLE `thash` (\n"+ - " `id` bigint(20) unsigned NOT NULL,\n"+ - " `data` varchar(255) DEFAULT NULL,\n"+ - " PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ - "PARTITION BY HASH (`id`)\n"+ - "(PARTITION `pEven` COMMENT 'Even ids',\n"+ - " PARTITION `pOdd` COMMENT 'Odd ids')", - )) - // empty edge case - tk.MustExec("drop table if exists `thash`") - tk.MustExec("CREATE TABLE `thash` (\n `id` bigint unsigned NOT NULL,\n `data` varchar(255) DEFAULT NULL,\n PRIMARY KEY (`id`)\n)\nPARTITION BY HASH (`id`);") - tk.MustQuery("show create table `thash`").Check(testkit.RowsWithSep("|", ""+ - "thash CREATE TABLE `thash` (\n"+ - " `id` bigint(20) unsigned NOT NULL,\n"+ - " `data` varchar(255) DEFAULT NULL,\n"+ - " PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ - "PARTITION BY HASH (`id`) PARTITIONS 1", - )) + // Case: a user that doesn't exist + err = tk.QueryToErr("show create user 'aaa'@'localhost';") + require.Equal(t, executor.ErrCannotUser.GenWithStackByArgs("SHOW CREATE USER", "'aaa'@'localhost'").Error(), err.Error()) + + tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "127.0.0.1", AuthUsername: "root", AuthHostname: "%"}, nil, nil) + tk.MustQuery("show create user current_user"). + Check(testkit.Rows("CREATE USER 'root'@'127.0.0.1' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK")) + + tk.MustQuery("show create user current_user()"). + Check(testkit.Rows("CREATE USER 'root'@'127.0.0.1' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK")) + + tk.MustExec("create user 'check_priv'") + + // "show create user" for other user requires the SELECT privilege on mysql database. + tk1 := testkit.NewTestKit(t, store) + tk1.MustExec("use mysql") + succ := tk1.Session().Auth(&auth.UserIdentity{Username: "check_priv", Hostname: "127.0.0.1", AuthUsername: "test_show", AuthHostname: "asdf"}, nil, nil) + require.True(t, succ) + err = tk1.QueryToErr("show create user 'root'@'%'") + require.Error(t, err) + + // "show create user" for current user doesn't check privileges. + tk1.MustQuery("show create user current_user"). + Check(testkit.Rows("CREATE USER 'check_priv'@'127.0.0.1' IDENTIFIED WITH 'mysql_native_password' AS '' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK")) + + // Creating users with `IDENTIFIED WITH 'caching_sha2_password'` + tk.MustExec("CREATE USER 'sha_test'@'%' IDENTIFIED WITH 'caching_sha2_password' BY 'temp_passwd'") + + // Compare only the start of the output as the salt changes every time. + rows := tk.MustQuery("SHOW CREATE USER 'sha_test'@'%'") + require.Equal(t, "CREATE USER 'sha_test'@'%' IDENTIFIED WITH 'caching_sha2_password' AS '$A$005$", rows.Rows()[0][0].(string)[:78]) + // Creating users with `IDENTIFIED WITH 'auth-socket'` + tk.MustExec("CREATE USER 'sock'@'%' IDENTIFIED WITH 'auth_socket'") + + // Compare only the start of the output as the salt changes every time. + rows = tk.MustQuery("SHOW CREATE USER 'sock'@'%'") + require.Equal(t, "CREATE USER 'sock'@'%' IDENTIFIED WITH 'auth_socket' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK", rows.Rows()[0][0].(string)) + tk.MustExec("CREATE USER 'sock2'@'%' IDENTIFIED WITH 'auth_socket' AS 'sock3'") + + // Compare only the start of the output as the salt changes every time. + rows = tk.MustQuery("SHOW CREATE USER 'sock2'@'%'") + require.Equal(t, "CREATE USER 'sock2'@'%' IDENTIFIED WITH 'auth_socket' AS 'sock3' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK", rows.Rows()[0][0].(string)) +} + +func TestUnprivilegedShow(t *testing.T) { + store, dom, clean := testkit.CreateMockStoreAndDomain(t) + defer clean() + tk := testkit.NewTestKit(t, store) + tk.MustExec("CREATE DATABASE testshow") + tk.MustExec("USE testshow") + tk.MustExec("CREATE TABLE t1 (a int)") + tk.MustExec("CREATE TABLE t2 (a int)") + + tk.MustExec(`CREATE USER 'lowprivuser'`) // no grants + + tk.Session().Auth(&auth.UserIdentity{Username: "lowprivuser", Hostname: "192.168.0.1", AuthUsername: "lowprivuser", AuthHostname: "%"}, nil, []byte("012345678901234567890")) + rs, err := tk.Exec("SHOW TABLE STATUS FROM testshow") + require.NoError(t, err) + require.NotNil(t, rs) + + tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "192.168.0.1", AuthUsername: "root", AuthHostname: "%"}, nil, []byte("012345678901234567890")) + tk.MustExec("GRANT ALL ON testshow.t1 TO 'lowprivuser'") + tk.Session().Auth(&auth.UserIdentity{Username: "lowprivuser", Hostname: "192.168.0.1", AuthUsername: "lowprivuser", AuthHostname: "%"}, nil, []byte("012345678901234567890")) + + is := dom.InfoSchema() + tblInfo, err := is.TableByName(model.NewCIStr("testshow"), model.NewCIStr("t1")) + require.NoError(t, err) + createTime := model.TSConvert2Time(tblInfo.Meta().UpdateTS).Format("2006-01-02 15:04:05") + + tk.MustQuery("show table status from testshow").Check(testkit.Rows(fmt.Sprintf("t1 InnoDB 10 Compact 0 0 0 0 0 0 %s utf8mb4_bin ", createTime))) - // default value escape character '\\' display case - tk.MustExec("drop table if exists t;") - tk.MustExec("create table t(a int primary key, b varchar(20) default '\\\\');") - tk.MustQuery("show create table t;").Check(testkit.RowsWithSep("|", - ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) NOT NULL,\n"+ - " `b` varchar(20) DEFAULT '\\\\',\n"+ - " PRIMARY KEY (`a`) /*T![clustered_index] CLUSTERED */\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin")) } -func TestShowCreateTablePlacement(t *testing.T) { +func TestCollation(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) tk.MustExec("use test") - defer tk.MustExec(`DROP TABLE IF EXISTS t`) - // case for policy - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec("create placement policy x " + - "FOLLOWERS=2 " + - "CONSTRAINTS=\"[+disk=ssd]\" ") - defer tk.MustExec(`DROP PLACEMENT POLICY IF EXISTS x`) - tk.MustExec("create table t(a int)" + - "PLACEMENT POLICY=\"x\"") - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin "+ - "/*T![placement] PLACEMENT POLICY=`x` */", - )) + rs, err := tk.Exec("show collation;") + require.NoError(t, err) + fields := rs.Fields() + require.Equal(t, mysql.TypeVarchar, fields[0].Column.GetType()) + require.Equal(t, mysql.TypeVarchar, fields[1].Column.GetType()) + require.Equal(t, mysql.TypeLonglong, fields[2].Column.GetType()) + require.Equal(t, mysql.TypeVarchar, fields[3].Column.GetType()) + require.Equal(t, mysql.TypeVarchar, fields[4].Column.GetType()) + require.Equal(t, mysql.TypeLonglong, fields[5].Column.GetType()) +} - // case for policy with quotes - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec("create table t(a int)" + - "/*T![placement] PLACEMENT POLICY=\"x\" */") - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin "+ - "/*T![placement] PLACEMENT POLICY=`x` */", - )) +func TestShowTableStatus(t *testing.T) { + store, clean := testkit.CreateMockStore(t) + defer clean() + tk := testkit.NewTestKit(t, store) - // Partitioned tables - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec("set @old_list_part = @@tidb_enable_list_partition") - defer tk.MustExec("set @@tidb_enable_list_partition = @old_list_part") - tk.MustExec("set tidb_enable_list_partition = 1") - tk.MustExec("create table t(a int, b varchar(255))" + - "/*T![placement] PLACEMENT POLICY=\"x\" */" + - "PARTITION BY LIST (a)\n" + - "(PARTITION pLow VALUES in (1,2,3,5,8) COMMENT 'a comment' placement policy 'x'," + - " PARTITION pMid VALUES in (9) COMMENT 'another comment'," + - "partition pMax values IN (10,11,12))") - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL,\n"+ - " `b` varchar(255) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![placement] PLACEMENT POLICY=`x` */\n"+ - "PARTITION BY LIST (`a`)\n"+ - "(PARTITION `pLow` VALUES IN (1,2,3,5,8) COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ - " PARTITION `pMid` VALUES IN (9) COMMENT 'another comment',\n"+ - " PARTITION `pMax` VALUES IN (10,11,12))", - )) + tk.MustExec("use test") + tk.MustExec(`drop table if exists t;`) + tk.MustExec(`create table t(a bigint);`) - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec("create table t(a int, b varchar(255))" + - "PARTITION BY LIST COLUMNS (b)\n" + - "(PARTITION pLow VALUES in ('1','2','3','5','8') COMMENT 'a comment' placement policy 'x'," + - "partition pMax values IN ('10','11','12'))") - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL,\n"+ - " `b` varchar(255) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ - "PARTITION BY LIST COLUMNS(`b`)\n"+ - "(PARTITION `pLow` VALUES IN (\"1\",\"2\",\"3\",\"5\",\"8\") COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ - " PARTITION `pMax` VALUES IN (\"10\",\"11\",\"12\"))", - )) + tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "192.168.0.1", AuthUsername: "root", AuthHostname: "%"}, nil, []byte("012345678901234567890")) - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec("create table t(a int, b varchar(255))" + - "PARTITION BY LIST COLUMNS (a,b)\n" + - "(PARTITION pLow VALUES in ((1,'1'),(2,'2'),(3,'3'),(5,'5'),(8,'8')) COMMENT 'a comment' placement policy 'x'," + - "partition pMax values IN ((10,'10'),(11,'11'),(12,'12')))") - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL,\n"+ - " `b` varchar(255) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ - "PARTITION BY LIST COLUMNS(`a`,`b`)\n"+ - "(PARTITION `pLow` VALUES IN ((1,\"1\"),(2,\"2\"),(3,\"3\"),(5,\"5\"),(8,\"8\")) COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ - " PARTITION `pMax` VALUES IN ((10,\"10\"),(11,\"11\"),(12,\"12\")))", - )) + // It's not easy to test the result contents because every time the test runs, "Create_time" changed. + tk.MustExec("show table status;") + rs, err := tk.Exec("show table status;") + require.NoError(t, err) + require.NotNil(t, rs) + rows, err := session.GetRows4Test(context.Background(), tk.Session(), rs) + require.NoError(t, err) + err = rs.Close() + require.NoError(t, err) + require.Equal(t, 1, len(rows)) - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec("create table t(a int, b varchar(255))" + - "PARTITION BY RANGE (a)\n" + - "(PARTITION pLow VALUES less than (1000000) COMMENT 'a comment' placement policy 'x'," + - "partition pMax values LESS THAN (MAXVALUE))") - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL,\n"+ - " `b` varchar(255) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ - "PARTITION BY RANGE (`a`)\n"+ - "(PARTITION `pLow` VALUES LESS THAN (1000000) COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ - " PARTITION `pMax` VALUES LESS THAN (MAXVALUE))", - )) + for i := range rows { + row := rows[i] + require.Equal(t, "t", row.GetString(0)) + require.Equal(t, "InnoDB", row.GetString(1)) + require.Equal(t, int64(10), row.GetInt64(2)) + require.Equal(t, "Compact", row.GetString(3)) + } + tk.MustExec(`drop table if exists tp;`) + tk.MustExec(`create table tp (a int) + partition by range(a) + ( partition p0 values less than (10), + partition p1 values less than (20), + partition p2 values less than (maxvalue) + );`) + rs, err = tk.Exec("show table status from test like 'tp';") + require.NoError(t, err) + rows, err = session.GetRows4Test(context.Background(), tk.Session(), rs) + require.NoError(t, err) + require.Equal(t, "partitioned", rows[0].GetString(16)) - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec("create table t(a int, b varchar(255))" + - "PARTITION BY RANGE COLUMNS (b)\n" + - "(PARTITION pLow VALUES less than ('1000000') COMMENT 'a comment' placement policy 'x'," + - "partition pMax values LESS THAN (MAXVALUE))") - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL,\n"+ - " `b` varchar(255) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ - "PARTITION BY RANGE COLUMNS(`b`)\n"+ - "(PARTITION `pLow` VALUES LESS THAN (\"1000000\") COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ - " PARTITION `pMax` VALUES LESS THAN (MAXVALUE))", - )) + tk.MustExec("create database UPPER_CASE") + tk.MustExec("use UPPER_CASE") + tk.MustExec("create table t (i int)") + rs, err = tk.Exec("show table status") + require.NoError(t, err) + require.NotNil(t, rs) + rows, err = session.GetRows4Test(context.Background(), tk.Session(), rs) + require.NoError(t, err) + err = rs.Close() + require.NoError(t, err) + require.Equal(t, 1, len(rows)) - tk.MustExec(`DROP TABLE IF EXISTS t`) - // RANGE COLUMNS with multiple columns is not supported! - tk.MustExec("create table t(a int, b varchar(255))" + - "/*T![placement] PLACEMENT POLICY=\"x\" */" + - "PARTITION BY RANGE COLUMNS (a,b)\n" + - "(PARTITION pLow VALUES less than (1000000,'1000000') COMMENT 'a comment' placement policy 'x'," + - " PARTITION pMidLow VALUES less than (1000000,MAXVALUE) COMMENT 'another comment' placement policy 'x'," + - " PARTITION pMadMax VALUES less than (MAXVALUE,'1000000') COMMENT ='Not a comment' placement policy 'x'," + - "partition pMax values LESS THAN (MAXVALUE, MAXVALUE))") - tk.MustQuery("show warnings").Check(testkit.Rows("Warning 8200 Unsupported partition type RANGE, treat as normal table")) - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL,\n"+ - " `b` varchar(255) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![placement] PLACEMENT POLICY=`x` */", - )) + tk.MustExec("use upper_case") + rs, err = tk.Exec("show table status") + require.NoError(t, err) + require.NotNil(t, rs) + rows, err = session.GetRows4Test(context.Background(), tk.Session(), rs) + require.NoError(t, err) + err = rs.Close() + require.NoError(t, err) + require.Equal(t, 1, len(rows)) - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec("create table t(a int, b varchar(255))" + - "/*T![placement] PLACEMENT POLICY=\"x\" */" + - "PARTITION BY HASH (a) PARTITIONS 2") - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL,\n"+ - " `b` varchar(255) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![placement] PLACEMENT POLICY=`x` */\n"+ - "PARTITION BY HASH (`a`) PARTITIONS 2", - )) + tk.MustExec("drop database UPPER_CASE") +} - tk.MustExec(`DROP TABLE IF EXISTS t`) - tk.MustExec("create table t(a int, b varchar(255))" + - "PARTITION BY HASH (a)\n" + - "(PARTITION pLow COMMENT 'a comment' placement policy 'x'," + - "partition pMax)") - tk.MustQuery(`show create table t`).Check(testkit.RowsWithSep("|", ""+ - "t CREATE TABLE `t` (\n"+ - " `a` int(11) DEFAULT NULL,\n"+ - " `b` varchar(255) DEFAULT NULL\n"+ - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin\n"+ - "PARTITION BY HASH (`a`)\n"+ - "(PARTITION `pLow` COMMENT 'a comment' /*T![placement] PLACEMENT POLICY=`x` */,\n"+ - " PARTITION `pMax`)", - )) - tk.MustExec(`DROP TABLE t`) +func TestShowSlow(t *testing.T) { + store, clean := testkit.CreateMockStore(t) + defer clean() + tk := testkit.NewTestKit(t, store) + // The test result is volatile, because + // 1. Slow queries is stored in domain, which may be affected by other tests. + // 2. Collecting slow queries is a asynchronous process, check immediately may not get the expected result. + // 3. Make slow query like "select sleep(1)" would slow the CI. + // So, we just cover the code but do not check the result. + tk.MustQuery(`admin show slow recent 3`) + tk.MustQuery(`admin show slow top 3`) + tk.MustQuery(`admin show slow top internal 3`) + tk.MustQuery(`admin show slow top all 3`) } func TestShowCreateTableAutoRandom(t *testing.T) { diff --git a/executor/simple_test.go b/executor/simple_test.go index 2a7038abde75a..0d4a83c3950d4 100644 --- a/executor/simple_test.go +++ b/executor/simple_test.go @@ -773,37 +773,6 @@ func TestDropStats(t *testing.T) { h.SetLease(0) } -func TestDropStatsFromKV(t *testing.T) { - store, clean := testkit.CreateMockStore(t) - defer clean() - tk := testkit.NewTestKit(t, store) - tk.MustExec("use test") - tk.MustExec("create table t (c1 varchar(20), c2 varchar(20))") - tk.MustExec(`insert into t values("1","1"),("2","2"),("3","3"),("4","4")`) - tk.MustExec("insert into t select * from t") - tk.MustExec("insert into t select * from t") - tk.MustExec("analyze table t with 2 topn") - tblID := tk.MustQuery(`select tidb_table_id from information_schema.tables where table_name = "t" and table_schema = "test"`).Rows()[0][0].(string) - tk.MustQuery("select modify_count, count from mysql.stats_meta where table_id = " + tblID).Check( - testkit.Rows("0 16")) - tk.MustQuery("select hist_id from mysql.stats_histograms where table_id = " + tblID).Check( - testkit.Rows("1", "2")) - ret := tk.MustQuery("select hist_id, bucket_id from mysql.stats_buckets where table_id = " + tblID) - require.True(t, len(ret.Rows()) > 0) - ret = tk.MustQuery("select hist_id from mysql.stats_top_n where table_id = " + tblID) - require.True(t, len(ret.Rows()) > 0) - - tk.MustExec("drop stats t") - tk.MustQuery("select modify_count, count from mysql.stats_meta where table_id = " + tblID).Check( - testkit.Rows("0 16")) - tk.MustQuery("select hist_id from mysql.stats_histograms where table_id = " + tblID).Check( - testkit.Rows()) - tk.MustQuery("select hist_id, bucket_id from mysql.stats_buckets where table_id = " + tblID).Check( - testkit.Rows()) - tk.MustQuery("select hist_id from mysql.stats_top_n where table_id = " + tblID).Check( - testkit.Rows()) -} - func TestFlushTables(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() diff --git a/executor/tiflashtest/BUILD.bazel b/executor/tiflashtest/BUILD.bazel new file mode 100644 index 0000000000000..6a919ca76598a --- /dev/null +++ b/executor/tiflashtest/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") + +go_test( + name = "tiflashtest_test", + srcs = [ + "main_test.go", + "tiflash_test.go", + ], + deps = [ + "//config", + "//domain", + "//executor", + "//meta/autoid", + "//parser/terror", + "//planner/core", + "//session", + "//store/mockstore", + "//store/mockstore/unistore", + "//testkit", + "//testkit/external", + "//util/israce", + "//util/kvcache", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_stretchr_testify//require", + "@com_github_tikv_client_go_v2//testutils", + "@com_github_tikv_client_go_v2//tikv", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/executor/tiflashtest/main_test.go b/executor/tiflashtest/main_test.go new file mode 100644 index 0000000000000..19104e1188b31 --- /dev/null +++ b/executor/tiflashtest/main_test.go @@ -0,0 +1,44 @@ +// Copyright 2021 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tiflashtest + +import ( + "testing" + + "github.com/pingcap/tidb/config" + "github.com/pingcap/tidb/meta/autoid" + "github.com/tikv/client-go/v2/tikv" + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + autoid.SetStep(5000) + config.UpdateGlobal(func(conf *config.Config) { + conf.Log.SlowThreshold = 30000 // 30s + conf.TiKVClient.AsyncCommit.SafeWindow = 0 + conf.TiKVClient.AsyncCommit.AllowedClockDrift = 0 + conf.Experimental.AllowsExpressionIndex = true + }) + tikv.EnableFailpoints() + + opts := []goleak.Option{ + goleak.IgnoreTopFunction("github.com/golang/glog.(*loggingT).flushDaemon"), + goleak.IgnoreTopFunction("go.etcd.io/etcd/client/pkg/v3/logutil.(*MergeLogger).outputLoop"), + goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"), + goleak.IgnoreTopFunction("gopkg.in/natefinch/lumberjack%2ev2.(*Logger).millRun"), + goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/txnkv/transaction.keepAlive"), + } + goleak.VerifyTestMain(m, opts...) +} diff --git a/executor/tiflash_test.go b/executor/tiflashtest/tiflash_test.go similarity index 99% rename from executor/tiflash_test.go rename to executor/tiflashtest/tiflash_test.go index e35ee76350714..d3c69b3988762 100644 --- a/executor/tiflash_test.go +++ b/executor/tiflashtest/tiflash_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package executor_test +package tiflashtest import ( "bytes" diff --git a/expression/BUILD.bazel b/expression/BUILD.bazel new file mode 100644 index 0000000000000..920e1c43bd81d --- /dev/null +++ b/expression/BUILD.bazel @@ -0,0 +1,229 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "expression", + srcs = [ + "builtin.go", + "builtin_arithmetic.go", + "builtin_arithmetic_vec.go", + "builtin_cast.go", + "builtin_cast_vec.go", + "builtin_compare.go", + "builtin_compare_vec.go", + "builtin_compare_vec_generated.go", + "builtin_control.go", + "builtin_control_vec_generated.go", + "builtin_convert_charset.go", + "builtin_encryption.go", + "builtin_encryption_vec.go", + "builtin_info.go", + "builtin_info_vec.go", + "builtin_json.go", + "builtin_json_vec.go", + "builtin_like.go", + "builtin_like_vec.go", + "builtin_math.go", + "builtin_math_vec.go", + "builtin_miscellaneous.go", + "builtin_miscellaneous_vec.go", + "builtin_op.go", + "builtin_op_vec.go", + "builtin_other.go", + "builtin_other_vec.go", + "builtin_other_vec_generated.go", + "builtin_string.go", + "builtin_string_vec.go", + "builtin_string_vec_generated.go", + "builtin_time.go", + "builtin_time_vec.go", + "builtin_time_vec_generated.go", + "builtin_vectorized.go", + "chunk_executor.go", + "collation.go", + "column.go", + "constant.go", + "constant_fold.go", + "constant_propagation.go", + "distsql_builtin.go", + "errors.go", + "evaluator.go", + "explain.go", + "expr_to_pb.go", + "expression.go", + "function_traits.go", + "helper.go", + "partition_pruner.go", + "scalar_function.go", + "schema.go", + "simple_rewriter.go", + "util.go", + "vectorized.go", + ], + importpath = "github.com/pingcap/tidb/expression", + visibility = ["//visibility:public"], + deps = [ + "//config", + "//errno", + "//kv", + "//parser", + "//parser/ast", + "//parser/auth", + "//parser/charset", + "//parser/model", + "//parser/mysql", + "//parser/opcode", + "//parser/terror", + "//parser/types", + "//privilege", + "//sessionctx", + "//sessionctx/stmtctx", + "//sessionctx/variable", + "//types", + "//types/json", + "//types/parser_driver", + "//util", + "//util/chunk", + "//util/codec", + "//util/collate", + "//util/dbterror", + "//util/disjointset", + "//util/encrypt", + "//util/generatedexpr", + "//util/hack", + "//util/logutil", + "//util/mathutil", + "//util/mock", + "//util/parser", + "//util/plancodec", + "//util/printer", + "//util/set", + "//util/sqlexec", + "//util/stringutil", + "//util/vitess", + "@com_github_gogo_protobuf//proto", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_tipb//go-tipb", + "@com_github_tikv_client_go_v2//oracle", + "@org_golang_x_tools//container/intsets", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "expression_test", + srcs = [ + "bench_test.go", + "builtin_arithmetic_test.go", + "builtin_arithmetic_vec_test.go", + "builtin_cast_bench_test.go", + "builtin_cast_test.go", + "builtin_cast_vec_test.go", + "builtin_compare_test.go", + "builtin_compare_vec_generated_test.go", + "builtin_compare_vec_test.go", + "builtin_control_test.go", + "builtin_control_vec_generated_test.go", + "builtin_encryption_test.go", + "builtin_encryption_vec_test.go", + "builtin_info_test.go", + "builtin_info_vec_test.go", + "builtin_json_test.go", + "builtin_json_vec_test.go", + "builtin_like_test.go", + "builtin_like_vec_test.go", + "builtin_math_test.go", + "builtin_math_vec_test.go", + "builtin_miscellaneous_test.go", + "builtin_miscellaneous_vec_test.go", + "builtin_op_test.go", + "builtin_op_vec_test.go", + "builtin_other_test.go", + "builtin_other_vec_generated_test.go", + "builtin_other_vec_test.go", + "builtin_regexp_vec_const_test.go", + "builtin_string_test.go", + "builtin_string_vec_generated_test.go", + "builtin_string_vec_test.go", + "builtin_test.go", + "builtin_time_test.go", + "builtin_time_vec_generated_test.go", + "builtin_time_vec_test.go", + "builtin_vectorized_test.go", + "collation_test.go", + "column_test.go", + "constant_fold_test.go", + "constant_propagation_test.go", + "constant_test.go", + "distsql_builtin_test.go", + "evaluator_test.go", + "expr_to_pb_test.go", + "expression_test.go", + "flag_simplify_test.go", + "function_traits_test.go", + "helper_test.go", + "integration_serial_test.go", + "integration_test.go", + "main_test.go", + "scalar_function_test.go", + "schema_test.go", + "typeinfer_test.go", + "util_test.go", + ], + data = glob(["testdata/**"]), + embed = [":expression"], + deps = [ + "//config", + "//domain", + "//errno", + "//kv", + "//parser", + "//parser/ast", + "//parser/auth", + "//parser/charset", + "//parser/model", + "//parser/mysql", + "//parser/terror", + "//planner/core", + "//session", + "//sessionctx", + "//sessionctx/stmtctx", + "//sessionctx/variable", + "//sessiontxn", + "//table", + "//tablecodec", + "//testkit", + "//testkit/testdata", + "//testkit/testmain", + "//testkit/testsetup", + "//testkit/testutil", + "//types", + "//types/json", + "//types/parser_driver", + "//util", + "//util/benchdaily", + "//util/chunk", + "//util/codec", + "//util/collate", + "//util/hack", + "//util/kvcache", + "//util/mathutil", + "//util/mock", + "//util/printer", + "//util/sem", + "//util/sqlexec", + "//util/timeutil", + "//util/versioninfo", + "@com_github_gogo_protobuf//proto", + "@com_github_google_uuid//:uuid", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_tipb//go-tipb", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + "@com_github_tikv_client_go_v2//oracle", + "@com_github_tikv_client_go_v2//tikv", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/expression/aggregation/BUILD.bazel b/expression/aggregation/BUILD.bazel new file mode 100644 index 0000000000000..ddfbb6b8eb92d --- /dev/null +++ b/expression/aggregation/BUILD.bazel @@ -0,0 +1,72 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "aggregation", + srcs = [ + "agg_to_pb.go", + "aggregation.go", + "avg.go", + "base_func.go", + "bit_and.go", + "bit_or.go", + "bit_xor.go", + "concat.go", + "count.go", + "descriptor.go", + "explain.go", + "first_row.go", + "max_min.go", + "sum.go", + "util.go", + "window_func.go", + ], + importpath = "github.com/pingcap/tidb/expression/aggregation", + visibility = ["//visibility:public"], + deps = [ + "//expression", + "//kv", + "//parser/ast", + "//parser/charset", + "//parser/mysql", + "//parser/terror", + "//planner/util", + "//sessionctx", + "//sessionctx/stmtctx", + "//sessionctx/variable", + "//types", + "//util/chunk", + "//util/codec", + "//util/collate", + "//util/mathutil", + "//util/mvmap", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_tipb//go-tipb", + ], +) + +go_test( + name = "aggregation_test", + srcs = [ + "agg_to_pb_test.go", + "aggregation_test.go", + "base_func_test.go", + "bench_test.go", + "main_test.go", + "util_test.go", + ], + embed = [":aggregation"], + deps = [ + "//expression", + "//parser/ast", + "//parser/mysql", + "//sessionctx", + "//sessionctx/stmtctx", + "//sessionctx/variable", + "//testkit/testsetup", + "//types", + "//util/chunk", + "//util/mock", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/expression/generator/helper/BUILD.bazel b/expression/generator/helper/BUILD.bazel new file mode 100644 index 0000000000000..92febc259de18 --- /dev/null +++ b/expression/generator/helper/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "helper", + srcs = ["helper.go"], + importpath = "github.com/pingcap/tidb/expression/generator/helper", + visibility = ["//visibility:public"], +) diff --git a/infoschema/BUILD.bazel b/infoschema/BUILD.bazel new file mode 100644 index 0000000000000..1f78edce74f2a --- /dev/null +++ b/infoschema/BUILD.bazel @@ -0,0 +1,111 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "infoschema", + srcs = [ + "builder.go", + "cache.go", + "cluster.go", + "error.go", + "infoschema.go", + "metric_table_def.go", + "metrics_schema.go", + "tables.go", + ], + importpath = "github.com/pingcap/tidb/infoschema", + visibility = ["//visibility:public"], + deps = [ + "//config", + "//ddl/placement", + "//domain/infosync", + "//errno", + "//kv", + "//meta", + "//meta/autoid", + "//metrics", + "//parser/charset", + "//parser/model", + "//parser/mysql", + "//parser/terror", + "//privilege", + "//session/txninfo", + "//sessionctx", + "//sessionctx/variable", + "//table", + "//table/tables", + "//types", + "//util", + "//util/dbterror", + "//util/deadlockhistory", + "//util/domainutil", + "//util/execdetails", + "//util/logutil", + "//util/pdapi", + "//util/sem", + "//util/set", + "//util/sqlexec", + "//util/stmtsummary", + "@com_github_ngaut_pools//:pools", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_kvproto//pkg/metapb", + "@com_github_tikv_client_go_v2//tikv", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "infoschema_test", + srcs = [ + "cache_test.go", + "cluster_tables_test.go", + "infoschema_test.go", + "main_test.go", + "metrics_schema_test.go", + "tables_test.go", + ], + embed = [":infoschema"], + flaky = True, + shard_count = 50, + deps = [ + "//config", + "//ddl/placement", + "//domain", + "//errno", + "//executor", + "//kv", + "//meta", + "//meta/autoid", + "//parser", + "//parser/auth", + "//parser/model", + "//parser/mysql", + "//parser/terror", + "//server", + "//session", + "//session/txninfo", + "//sessionctx/variable", + "//store/helper", + "//store/mockstore", + "//store/mockstore/mockstorage", + "//table", + "//testkit", + "//testkit/testsetup", + "//testkit/testutil", + "//types", + "//util", + "//util/kvcache", + "//util/pdapi", + "//util/resourcegrouptag", + "//util/set", + "@com_github_gorilla_mux//:mux", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_pingcap_fn//:fn", + "@com_github_pingcap_kvproto//pkg/deadlock", + "@com_github_pingcap_tipb//go-tipb", + "@com_github_stretchr_testify//require", + "@org_golang_google_grpc//:grpc", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/infoschema/perfschema/BUILD.bazel b/infoschema/perfschema/BUILD.bazel new file mode 100644 index 0000000000000..92930a65eaa80 --- /dev/null +++ b/infoschema/perfschema/BUILD.bazel @@ -0,0 +1,53 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "perfschema", + srcs = [ + "const.go", + "init.go", + "tables.go", + ], + importpath = "github.com/pingcap/tidb/infoschema/perfschema", + visibility = ["//visibility:public"], + deps = [ + "//ddl", + "//expression", + "//infoschema", + "//kv", + "//meta/autoid", + "//parser", + "//parser/ast", + "//parser/model", + "//parser/mysql", + "//parser/terror", + "//sessionctx", + "//table", + "//table/tables", + "//types", + "//util", + "//util/profile", + "@com_github_pingcap_errors//:errors", + "@com_github_pingcap_failpoint//:failpoint", + ], +) + +go_test( + name = "perfschema_test", + srcs = [ + "main_test.go", + "tables_test.go", + ], + data = glob(["testdata/**"]), + embed = [":perfschema"], + deps = [ + "//kv", + "//parser/terror", + "//session", + "//store/mockstore", + "//testkit", + "//testkit/testsetup", + "@com_github_pingcap_failpoint//:failpoint", + "@com_github_stretchr_testify//require", + "@org_uber_go_goleak//:goleak", + ], +) diff --git a/infoschema/perfschema/tables_test.go b/infoschema/perfschema/tables_test.go index 057ba404efec7..24952625aa22d 100644 --- a/infoschema/perfschema/tables_test.go +++ b/infoschema/perfschema/tables_test.go @@ -20,8 +20,6 @@ import ( "net/http" "net/http/httptest" "os" - "path/filepath" - "runtime" "runtime/pprof" "strings" "testing" @@ -65,7 +63,7 @@ func TestTiKVProfileCPU(t *testing.T) { // mock tikv profile copyHandler := func(filename string) http.HandlerFunc { return func(w http.ResponseWriter, _ *http.Request) { - file, err := os.Open(filepath.Join(currentSourceDir(), filename)) + file, err := os.Open(filename) if err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return @@ -146,7 +144,7 @@ func TestTiKVProfileCPU(t *testing.T) { } // mock PD profile - router.HandleFunc("/pd/api/v1/debug/pprof/profile", copyHandler("../../util/profile/testdata/test.pprof")) + router.HandleFunc("/pd/api/v1/debug/pprof/profile", copyHandler("testdata/test.pprof")) router.HandleFunc("/pd/api/v1/debug/pprof/heap", handlerFactory("heap")) router.HandleFunc("/pd/api/v1/debug/pprof/mutex", handlerFactory("mutex")) router.HandleFunc("/pd/api/v1/debug/pprof/allocs", handlerFactory("allocs")) @@ -197,8 +195,3 @@ func newMockStore(t *testing.T) (store kv.Storage, clean func()) { return } - -func currentSourceDir() string { - _, file, _, _ := runtime.Caller(0) - return filepath.Dir(file) -} diff --git a/infoschema/perfschema/testdata/test.pprof b/infoschema/perfschema/testdata/test.pprof new file mode 100644 index 0000000000000000000000000000000000000000..118d3f3faecf2eee890d4cd0e0719c68e1973731 GIT binary patch literal 1206 zcmV;n1WEfJiwFP!00004|7?>8;VNS_Y znWXUcUjn7z8G%wzz=A+&ymI&x?n=X$KxrsqQ7KWGWbnr$5t;#s$|Q@Yj*37ARH4m4 z8OutE0wH+&_u~ngCRzAi5-bZc$_i8~AOW8%PozXLmCj^I72;4EMX6Gml zLL>oF!I%GjjrW*?Z!)6C9MrI;)TvCW_|msW`Gw`7B~Tt3*ignOkQ!dT{tCAh;D?l8 z1sKP11u2j^9>4G^XGJ()5UdCjI3ZXAuUvVHvl3hkkE8@mY$}r!$QWLD=Okxk_$Op# zn8GP#ngSWeYhS+3nGCmx$SK1N&L}W)eU)mh-WVIFGC{l^&%H~`9qmOHhjUNh`fZUA z;1-C40JAu&00q*-i)Y^8#VYViO|S|ms0cQRXFn9I3YY4FRiT9~!KU!-PX(*NuOX`e zMJm`dp1*X0=d8n<;Q)1*!#U+n3S0xk&D!iynFzzRs!YJ4KOS)~;|6)F>oS4W<8 zwH%AmG+Mbi{O+t+N(l-u`f}#Nb8V)G^nj$@p=EvDa!uxIX~XH;ftEDfzE-ex+wqy< z*d1SM8s5MSoVLzATGg%2{r9Q9Muj1C zFD&WIf4Ju!VBU&vEvk>&0&3J)-X@D7gsZx5sa;2#6jCROstZd-;4P{i+ut)yZDvb? z(A+ixkDFWDnxEVA)Z=XMbl@@F(u$VevsJ?}O+9!~%kN!oi$K@Wa^esF(TZN*4tf>~ zza}=SM)9`mIR^L0Q9!krWjSk1Yi-p=Xn0Z(d;Fkd=%%?#o84-1{MAD}yW<@4d6~-4 zGVq_Z`#$SvBR3L3UTD-b5yjPoCChhpdr|cbeT~^&rZu+~v<@)c<+Wx{(-;sk_?U8$(7*`af}7H+#C@v%9>;{Pr4kx6NMAjbP6j U^Gx0SF8~1l|KH)aVpRwL08q0{