diff --git a/pkg/index/mysql/mysqlindexer.go b/pkg/index/mysql/mysqlindexer.go index 0f344044a..eb3e96650 100644 --- a/pkg/index/mysql/mysqlindexer.go +++ b/pkg/index/mysql/mysqlindexer.go @@ -42,7 +42,8 @@ var _ index.IndexStorage = (*myIndexStorage)(nil) // This exists mostly for testing and does not initialize the schema. func NewStorage(host, user, password, dbname string) (index.IndexStorage, error) { // TODO(bradfitz): host is ignored; how to plumb it through with mymysql? - db, err := sql.Open("mymysql", dbname+"/"+user+"/"+password) + dsn := dbname+"/"+user+"/"+password + db, err := sql.Open("mymysql", dsn) if err != nil { return nil, err } diff --git a/third_party/github.com/ziutek/mymysql/native/mysql.go b/third_party/github.com/ziutek/mymysql/native/mysql.go index b6829a96b..74bcb283b 100644 --- a/third_party/github.com/ziutek/mymysql/native/mysql.go +++ b/third_party/github.com/ziutek/mymysql/native/mysql.go @@ -104,12 +104,12 @@ func (my *Conn) connect() (err error) { case "tcp", "tcp4", "tcp6": var la, ra *net.TCPAddr if my.laddr != "" { - if la, err = net.ResolveTCPAddr("", my.laddr); err != nil { + if la, err = net.ResolveTCPAddr("tcp", my.laddr); err != nil { return } } if my.raddr != "" { - if ra, err = net.ResolveTCPAddr("", my.raddr); err != nil { + if ra, err = net.ResolveTCPAddr("tcp", my.raddr); err != nil { return } }