Skip to content

Commit

Permalink
Merge branch 'master' into cast_flen_check
Browse files Browse the repository at this point in the history
  • Loading branch information
eurekaka authored Dec 21, 2018
2 parents d714bc5 + 94df8d1 commit 65b4514
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 68 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ check-setup:
@which retool >/dev/null 2>&1 || go get github.com/twitchtv/retool
@GO111MODULE=off retool sync

check: check-setup fmt lint vet tidy
check: fmt lint tidy

# These need to be fixed before they can be ran regularly
check-fail: goword check-static check-slow
Expand Down Expand Up @@ -92,7 +92,8 @@ check-slow:

lint:
@echo "linting"
@CGO_ENABLED=0 retool do revive -formatter friendly -config revive.toml $(PACKAGES)
@$(GO) install github.com/mgechev/revive
@CGO_ENABLED=0 revive -formatter friendly -config revive.toml $(FILES)

vet:
@echo "vet"
Expand Down
2 changes: 1 addition & 1 deletion cmd/explaintest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package main
import (
"bytes"
"database/sql"
"flag"
"fmt"
"io"
"io/ioutil"
Expand All @@ -24,7 +25,6 @@ import (
"os/exec"
"strings"

"flag"
"github.com/go-sql-driver/mysql"
"github.com/pingcap/errors"
"github.com/pingcap/parser/ast"
Expand Down
6 changes: 3 additions & 3 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ func (s *testSuite) TestAdmin(c *C) {
c.Assert(err, IsNil)
err = txn.Commit(context.Background())
c.Assert(err, IsNil)
r, err_admin := tk.Exec("admin check table admin_test")
c.Assert(err_admin, NotNil)
r, errAdmin := tk.Exec("admin check table admin_test")
c.Assert(errAdmin, NotNil)

if config.CheckTableBeforeDrop {
r, err = tk.Exec("drop table admin_test")
c.Assert(err.Error(), Equals, err_admin.Error())
c.Assert(err.Error(), Equals, errAdmin.Error())

// Drop inconsistency index.
tk.MustExec("alter table admin_test drop index c1")
Expand Down
8 changes: 4 additions & 4 deletions executor/merge_join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ const plan3 = `[[TableScan_12 {
} ]]`

func checkMergeAndRun(tk *testkit.TestKit, c *C, sql string) *testkit.Result {
explainedSql := "explain " + sql
result := tk.MustQuery(explainedSql)
explainedSQL := "explain " + sql
result := tk.MustQuery(explainedSQL)
resultStr := fmt.Sprintf("%v", result.Rows())
if !strings.ContainsAny(resultStr, "MergeJoin") {
c.Error("Expected MergeJoin in plannercore.")
Expand All @@ -225,8 +225,8 @@ func checkMergeAndRun(tk *testkit.TestKit, c *C, sql string) *testkit.Result {
}

func checkPlanAndRun(tk *testkit.TestKit, c *C, plan string, sql string) *testkit.Result {
explainedSql := "explain " + sql
result := tk.MustQuery(explainedSql)
explainedSQL := "explain " + sql
result := tk.MustQuery(explainedSQL)
resultStr := fmt.Sprintf("%v", result.Rows())
if plan != resultStr {
// TODO: Reopen it after refactoring explain.
Expand Down
6 changes: 5 additions & 1 deletion executor/prepared.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ func (e *PrepareExec) Next(ctx context.Context, chk *chunk.Chunk) error {
} else {
p := parser.New()
p.EnableWindowFunc(vars.EnableWindowFunction)
stmts, err = p.Parse(e.sqlText, charset, collation)
var warns []error
stmts, warns, err = p.Parse(e.sqlText, charset, collation)
for _, warn := range warns {
e.ctx.GetSessionVars().StmtCtx.AppendWarning(warn)
}
}
if err != nil {
return errors.Trace(err)
Expand Down
36 changes: 18 additions & 18 deletions executor/prepared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,58 +82,58 @@ func (s *testSuite) TestPrepared(c *C) {
result := tk.MustQuery("select distinct c1, c2 from prepare_test where c1 = ?", 1)
result.Check(testkit.Rows("1 <nil>"))

// Call Session PrepareStmt directly to get stmtId.
// Call Session PrepareStmt directly to get stmtID.
query := "select c1, c2 from prepare_test where c1 = ?"
stmtId, _, _, err := tk.Se.PrepareStmt(query)
stmtID, _, _, err := tk.Se.PrepareStmt(query)
c.Assert(err, IsNil)
rs, err := tk.Se.ExecutePreparedStmt(ctx, stmtId, 1)
rs, err := tk.Se.ExecutePreparedStmt(ctx, stmtID, 1)
c.Assert(err, IsNil)
tk.ResultSetToResult(rs, Commentf("%v", rs)).Check(testkit.Rows("1 <nil>"))

tk.MustExec("delete from prepare_test")
query = "select c1 from prepare_test where c1 = (select c1 from prepare_test where c1 = ?)"
stmtId, _, _, err = tk.Se.PrepareStmt(query)
stmtID, _, _, err = tk.Se.PrepareStmt(query)
c.Assert(err, IsNil)
tk1 := testkit.NewTestKitWithInit(c, s.store)
tk1.MustExec("insert prepare_test (c1) values (3)")
rs, err = tk.Se.ExecutePreparedStmt(ctx, stmtId, 3)
rs, err = tk.Se.ExecutePreparedStmt(ctx, stmtID, 3)
c.Assert(err, IsNil)
tk.ResultSetToResult(rs, Commentf("%v", rs)).Check(testkit.Rows("3"))

tk.MustExec("delete from prepare_test")
query = "select c1 from prepare_test where c1 = (select c1 from prepare_test where c1 = ?)"
stmtId, _, _, err = tk.Se.PrepareStmt(query)
stmtID, _, _, err = tk.Se.PrepareStmt(query)
c.Assert(err, IsNil)
_, err = tk.Se.ExecutePreparedStmt(ctx, stmtId, 3)
_, err = tk.Se.ExecutePreparedStmt(ctx, stmtID, 3)
c.Assert(err, IsNil)
tk1.MustExec("insert prepare_test (c1) values (3)")
rs, err = tk.Se.ExecutePreparedStmt(ctx, stmtId, 3)
rs, err = tk.Se.ExecutePreparedStmt(ctx, stmtID, 3)
c.Assert(err, IsNil)
tk.ResultSetToResult(rs, Commentf("%v", rs)).Check(testkit.Rows("3"))

tk.MustExec("delete from prepare_test")
query = "select c1 from prepare_test where c1 in (select c1 from prepare_test where c1 = ?)"
stmtId, _, _, err = tk.Se.PrepareStmt(query)
stmtID, _, _, err = tk.Se.PrepareStmt(query)
c.Assert(err, IsNil)
_, err = tk.Se.ExecutePreparedStmt(ctx, stmtId, 3)
_, err = tk.Se.ExecutePreparedStmt(ctx, stmtID, 3)
c.Assert(err, IsNil)
tk1.MustExec("insert prepare_test (c1) values (3)")
rs, err = tk.Se.ExecutePreparedStmt(ctx, stmtId, 3)
rs, err = tk.Se.ExecutePreparedStmt(ctx, stmtID, 3)
c.Assert(err, IsNil)
tk.ResultSetToResult(rs, Commentf("%v", rs)).Check(testkit.Rows("3"))

tk.MustExec("begin")
tk.MustExec("insert prepare_test (c1) values (4)")
query = "select c1, c2 from prepare_test where c1 = ?"
stmtId, _, _, err = tk.Se.PrepareStmt(query)
stmtID, _, _, err = tk.Se.PrepareStmt(query)
c.Assert(err, IsNil)
tk.MustExec("rollback")
rs, err = tk.Se.ExecutePreparedStmt(ctx, stmtId, 4)
rs, err = tk.Se.ExecutePreparedStmt(ctx, stmtID, 4)
c.Assert(err, IsNil)
tk.ResultSetToResult(rs, Commentf("%v", rs)).Check(testkit.Rows())

// Check that ast.Statement created by executor.CompileExecutePreparedStmt has query text.
stmt, err := executor.CompileExecutePreparedStmt(tk.Se, stmtId, 1)
stmt, err := executor.CompileExecutePreparedStmt(tk.Se, stmtID, 1)
c.Assert(err, IsNil)
c.Assert(stmt.OriginText(), Equals, query)

Expand All @@ -153,20 +153,20 @@ func (s *testSuite) TestPrepared(c *C) {
tk.Exec("create table prepare2 (a int)")

// Should success as the changed schema do not affect the prepared statement.
_, err = tk.Se.ExecutePreparedStmt(ctx, stmtId, 1)
_, err = tk.Se.ExecutePreparedStmt(ctx, stmtID, 1)
c.Assert(err, IsNil)

// Drop a column so the prepared statement become invalid.
query = "select c1, c2 from prepare_test where c1 = ?"
stmtId, _, _, err = tk.Se.PrepareStmt(query)
stmtID, _, _, err = tk.Se.PrepareStmt(query)
c.Assert(err, IsNil)
tk.MustExec("alter table prepare_test drop column c2")

_, err = tk.Se.ExecutePreparedStmt(ctx, stmtId, 1)
_, err = tk.Se.ExecutePreparedStmt(ctx, stmtID, 1)
c.Assert(plannercore.ErrUnknownColumn.Equal(err), IsTrue)

tk.MustExec("drop table prepare_test")
_, err = tk.Se.ExecutePreparedStmt(ctx, stmtId, 1)
_, err = tk.Se.ExecutePreparedStmt(ctx, stmtID, 1)
c.Assert(plannercore.ErrSchemaChanged.Equal(err), IsTrue)

// issue 3381
Expand Down
20 changes: 10 additions & 10 deletions executor/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,24 @@ func (s *testSuite) TestSetVar(c *C) {
_, err := tk.Exec(testSQL)
c.Assert(err, NotNil)

errTestSql := "SET @@date_format = 1;"
_, err = tk.Exec(errTestSql)
errTestSQL := "SET @@date_format = 1;"
_, err = tk.Exec(errTestSQL)
c.Assert(err, NotNil)

errTestSql = "SET @@rewriter_enabled = 1;"
_, err = tk.Exec(errTestSql)
errTestSQL = "SET @@rewriter_enabled = 1;"
_, err = tk.Exec(errTestSQL)
c.Assert(err, NotNil)

errTestSql = "SET xxx = abcd;"
_, err = tk.Exec(errTestSql)
errTestSQL = "SET xxx = abcd;"
_, err = tk.Exec(errTestSQL)
c.Assert(err, NotNil)

errTestSql = "SET @@global.a = 1;"
_, err = tk.Exec(errTestSql)
errTestSQL = "SET @@global.a = 1;"
_, err = tk.Exec(errTestSQL)
c.Assert(err, NotNil)

errTestSql = "SET @@global.timestamp = 1;"
_, err = tk.Exec(errTestSql)
errTestSQL = "SET @@global.timestamp = 1;"
_, err = tk.Exec(errTestSQL)
c.Assert(err, NotNil)

// For issue 998
Expand Down
8 changes: 4 additions & 4 deletions executor/show_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,13 @@ func (s *testSuite) TestShow2(c *C) {
is := domain.GetDomain(ctx).InfoSchema()
tblInfo, err := is.TableByName(model.NewCIStr("test"), model.NewCIStr("t"))
c.Assert(err, IsNil)
create_time := model.TSConvert2Time(tblInfo.Meta().UpdateTS).Format("2006-01-02 15:04:05")
createTime := model.TSConvert2Time(tblInfo.Meta().UpdateTS).Format("2006-01-02 15:04:05")

// The Hostname is the actual host
tk.Se.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 0 %s <nil> <nil> utf8mb4_bin 注释", create_time)))
r.Check(testkit.Rows(fmt.Sprintf("t InnoDB 10 Compact 0 0 0 0 0 0 0 %s <nil> <nil> utf8mb4_bin 注释", createTime)))

tk.MustQuery("show databases like 'test'").Check(testkit.Rows("test"))

Expand Down Expand Up @@ -663,9 +663,9 @@ func (s *testSuite) TestUnprivilegedShow(c *C) {
is := domain.GetDomain(ctx).InfoSchema()
tblInfo, err := is.TableByName(model.NewCIStr("testshow"), model.NewCIStr("t1"))
c.Assert(err, IsNil)
create_time := model.TSConvert2Time(tblInfo.Meta().UpdateTS).Format("2006-01-02 15:04:05")
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 0 %s <nil> <nil> utf8mb4_bin ", create_time)))
tk.MustQuery("show table status from testshow").Check(testkit.Rows(fmt.Sprintf("t1 InnoDB 10 Compact 0 0 0 0 0 0 0 %s <nil> <nil> utf8mb4_bin ", createTime)))

}

Expand Down
10 changes: 10 additions & 0 deletions expression/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3697,6 +3697,16 @@ func (s *testIntegrationSuite) TestDecimalMul(c *C) {
res.Check(testkit.Rows("0.55125221922461136"))
}

func (s *testIntegrationSuite) TestUnknowHintIgnore(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("USE test")
tk.MustExec("create table t(a int)")
tk.MustQuery("select /*+ unkown_hint(c1)*/ 1").Check(testkit.Rows("1"))
tk.MustQuery("show warnings").Check(testkit.Rows("Warning 1105 line 1 column 28 near \" 1\" (total length 30)"))
_, err := tk.Exec("select 1 from /*+ test1() */ t")
c.Assert(err, NotNil)
}

func (s *testIntegrationSuite) TestValuesInNonInsertStmt(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec(`use test;`)
Expand Down
10 changes: 8 additions & 2 deletions expression/simple_rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ type simpleRewriter struct {
// The expression string must only reference the column in table Info.
func ParseSimpleExprWithTableInfo(ctx sessionctx.Context, exprStr string, tableInfo *model.TableInfo) (Expression, error) {
exprStr = "select " + exprStr
stmts, err := parser.New().Parse(exprStr, "", "")
stmts, warns, err := parser.New().Parse(exprStr, "", "")
for _, warn := range warns {
ctx.GetSessionVars().StmtCtx.AppendWarning(warn)
}
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -72,7 +75,10 @@ func RewriteSimpleExprWithTableInfo(ctx sessionctx.Context, tbl *model.TableInfo
// The expression string must only reference the column in the given schema.
func ParseSimpleExprsWithSchema(ctx sessionctx.Context, exprStr string, schema *Schema) ([]Expression, error) {
exprStr = "select " + exprStr
stmts, err := parser.New().Parse(exprStr, "", "")
stmts, warns, err := parser.New().Parse(exprStr, "", "")
for _, warn := range warns {
ctx.GetSessionVars().StmtCtx.AppendWarning(warn)
}
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ require (
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mgechev/revive v0.0.0-20181210140514-b4cc152955fb
github.com/montanaflynn/stats v0.0.0-20180911141734-db72e6cae808 // indirect
github.com/myesui/uuid v1.0.0 // indirect
github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7
Expand All @@ -48,11 +49,10 @@ require (
github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3
github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e
github.com/pingcap/kvproto v0.0.0-20181105061835-1b5d69cd1d26
github.com/pingcap/parser v0.0.0-20181218071912-deacf026787e
github.com/pingcap/parser v0.0.0-20181221050948-947d4ab3052f
github.com/pingcap/pd v2.1.0-rc.4+incompatible
github.com/pingcap/tidb-tools v2.1.1-0.20181218072513-b2235d442b06+incompatible
github.com/pingcap/tipb v0.0.0-20181012112600-11e33c750323
github.com/pkg/errors v0.8.0 // indirect
github.com/prometheus/client_golang v0.9.0
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910
github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39 // indirect
Expand Down
23 changes: 21 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f h1:5ZfJxyXo8KyX8DgGXC5B7ILL8y51fci/qYz2B4j8iLY=
Expand Down Expand Up @@ -36,6 +37,10 @@ github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaI
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM=
github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a h1:QNEenQIsGDEEfFNSnN+h6hE1OwnHqTg7Dl9gEk1Cko4=
github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a/go.mod h1:49H/RkXP8pKaZy4h0d+NW16rSLhyVBt4o6VLJbmOqDE=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/structtag v1.0.0 h1:pTHj65+u3RKWYPSGaU290FpI/dXxTaHdVwVwbcPKmEc=
github.com/fatih/structtag v1.0.0/go.mod h1:IKitwq45uXL/yqi5mYghiD3w9H6eTOvI9vnk8tXMphA=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
Expand Down Expand Up @@ -79,8 +84,18 @@ github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDK
github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4=
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mgechev/dots v0.0.0-20180605013149-8e09d8ea2757 h1:KTwJ7Lo3KDKMknRYN5JEFRGIM4IkG59QjFFM2mxsMEU=
github.com/mgechev/dots v0.0.0-20180605013149-8e09d8ea2757/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg=
github.com/mgechev/revive v0.0.0-20181210140514-b4cc152955fb h1:bLiKpCHe+ngBsF1o7DjZTmoffHEy2gdQ/+9NunuJ4ZY=
github.com/mgechev/revive v0.0.0-20181210140514-b4cc152955fb/go.mod h1:pVHj2KvxEhotJ6Lmr7zb3YgNMX1QKt8cyp6fdPHOrzU=
github.com/montanaflynn/stats v0.0.0-20180911141734-db72e6cae808 h1:pmpDGKLw4n82EtrNiLqB+xSz/JQwFOaZuMALYUHwX5s=
github.com/montanaflynn/stats v0.0.0-20180911141734-db72e6cae808/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/myesui/uuid v1.0.0 h1:xCBmH4l5KuvLYc5L7AS7SZg9/jKdIFubM7OVoLqaQUI=
Expand All @@ -89,6 +104,8 @@ github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7 h1:7KAv7KMGTTqSmYZtNdc
github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7/go.mod h1:iWMfgwqYW+e8n5lC/jjNEhwcjbRDpl5NT7n2h+4UNcI=
github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef h1:K0Fn+DoFqNqktdZtdV3bPQ/0cuYh2H4rkg0tytX/07k=
github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef/go.mod h1:7WjlapSfwQyo6LNmIvEWzsW1hbBQfpUO4JWnuQRmva8=
github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc h1:rQ1O4ZLYR2xXHXgBCCfIIGnuZ0lidMQw2S5n1oOv+Wg=
github.com/olekukonko/tablewriter v0.0.0-20180912035003-be2c049b30cc/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
Expand All @@ -108,8 +125,8 @@ github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e h1:P73/4dPCL96rG
github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw=
github.com/pingcap/kvproto v0.0.0-20181105061835-1b5d69cd1d26 h1:JK4VLNYbSn36QSbCnqALi2ySXdH0DfcMssT/zmLf4Ls=
github.com/pingcap/kvproto v0.0.0-20181105061835-1b5d69cd1d26/go.mod h1:0gwbe1F2iBIjuQ9AH0DbQhL+Dpr5GofU8fgYyXk+ykk=
github.com/pingcap/parser v0.0.0-20181218071912-deacf026787e h1:jKibIs55HR7OMo62uhjA6Bfx3GK+rbHK4Gfd4/8aTzk=
github.com/pingcap/parser v0.0.0-20181218071912-deacf026787e/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA=
github.com/pingcap/parser v0.0.0-20181221050948-947d4ab3052f h1:X2ZRYBERoJ5VDp7CdtXWfwbKqbeYn2kkdGA0b5/VwJ8=
github.com/pingcap/parser v0.0.0-20181221050948-947d4ab3052f/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA=
github.com/pingcap/pd v2.1.0-rc.4+incompatible h1:/buwGk04aHO5odk/+O8ZOXGs4qkUjYTJ2UpCJXna8NE=
github.com/pingcap/pd v2.1.0-rc.4+incompatible/go.mod h1:nD3+EoYes4+aNNODO99ES59V83MZSI+dFbhyr667a0E=
github.com/pingcap/tidb-tools v2.1.1-0.20181218072513-b2235d442b06+incompatible h1:Bsd+NHosPVowEGB3BCx+2d8wUQGDTXSSC5ljeNS6cXo=
Expand Down Expand Up @@ -191,6 +208,8 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuA
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52 h1:JG/0uqcGdTNgq7FdU+61l5Pdmb8putNZlXb65bJBROs=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1 h1:dzEuQYa6+a3gROnSlgly5ERUm4SZKJt+dh+4iSbO+bI=
golang.org/x/tools v0.0.0-20180911133044-677d2ff680c1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
Expand Down
19 changes: 19 additions & 0 deletions hack/hack_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2018 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,
// See the License for the specific language governing permissions and
// limitations under the License.

package hack

import (
// Imported for go.mod to cache package to accelerate CI.
_ "github.com/mgechev/revive/lint"
)
Loading

0 comments on commit 65b4514

Please sign in to comment.