Skip to content

Commit

Permalink
*: Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shenli committed Sep 21, 2015
1 parent e7d2bff commit 37cf491
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
7 changes: 6 additions & 1 deletion bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ import (
"github.com/pingcap/tidb/util/errors2"
)

const (
// CreateUserTable is the SQL statement creates User table in system db.
CreateUserTable = "CREATE TABLE if not exists mysql.user (Host CHAR(64), User CHAR(16), Password CHAR(41), PRIMARY KEY (Host, User));"
)

// Bootstrap initiates system DB for a store.
func bootstrap(s *session) {
// Create a test database.
Expand All @@ -50,7 +55,7 @@ func bootstrap(s *session) {
}

func initUserTable(s *session) {
_, err := s.Execute(mysql.CreateUserTable)
_, err := s.Execute(CreateUserTable)
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 0 additions & 2 deletions mysqldef/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,4 @@ const (
SystemDB = "mysql"
// UserTable is the table in system db contains user info.
UserTable = "User"
// CreateUserTable is the SQL statement creates User table in system db.
CreateUserTable = "CREATE TABLE if not exists mysql.user (Host CHAR(64), User CHAR(16), Password CHAR(41), PRIMARY KEY (Host, User));"
)
2 changes: 1 addition & 1 deletion stmt/stmts/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *testStmtSuite) SetUpTest(c *C) {
mustExec(c, s.testDB, s.useDBSql)

s.createSystemDBSQL = fmt.Sprintf("create database if not exists %s;", mysql.SystemDB)
s.createUserTableSQL = mysql.CreateUserTable
s.createUserTableSQL = tidb.CreateUserTable

mustExec(c, s.testDB, s.createSystemDBSQL)
mustExec(c, s.testDB, s.createUserTableSQL)
Expand Down
2 changes: 1 addition & 1 deletion table/tables/tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type testSuite struct {

func (ts *testSuite) SetUpSuite(c *C) {
driver := localstore.Driver{Driver: goleveldb.MemoryDriver{}}
store, err := driver.Open("memory-tables-test")
store, err := driver.Open("memory")
c.Check(err, IsNil)
ts.store = store
ts.se, err = tidb.CreateSession(ts.store)
Expand Down

0 comments on commit 37cf491

Please sign in to comment.