Change-Id: I6b5d66b68715f7d71ce665dbf90dfc0d4eefab5a
This commit is contained in:
Brad Fitzpatrick 2012-11-30 17:43:55 -08:00
parent ed67d8926a
commit 43e240f0f6
2 changed files with 4 additions and 3 deletions

View File

@ -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
}

View File

@ -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
}
}