Skip to content

Clean up #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A MySQL-Driver for Go's [database/sql](http://golang.org/pkg/database/sql) packa
* Optional `time.Time` parsing

## Requirements
* Go 1.0.3 or higher
* Go 1.1 or higher (use [v1.0](https://github.com/go-sql-driver/mysql/tags) for Go 1.0.x)
* MySQL (Version 4.1 or higher), MariaDB or Percona Server

---------------------------------------
Expand Down
24 changes: 11 additions & 13 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ type mysqlConn struct {
}

type config struct {
user string
passwd string
net string
addr string
dbname string
params map[string]string
loc *time.Location
timeout time.Duration
tls *tls.Config
user string
passwd string
net string
addr string
dbname string
params map[string]string
loc *time.Location
timeout time.Duration
tls *tls.Config
allowAllFiles bool
clientFoundRows bool
}

// Handles parameters set in DSN
Expand All @@ -64,10 +66,6 @@ func (mc *mysqlConn) handleParams() (err error) {
return
}

// handled elsewhere
case "allowAllFiles", "clientFoundRows":
continue

// time.Time parsing
case "parseTime":
mc.parseTime = readBool(val)
Expand Down
9 changes: 2 additions & 7 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ func (d *mysqlDriver) Open(dsn string) (driver.Conn, error) {
}

// Connect to Server
if mc.cfg.timeout > 0 { // with timeout
if err == nil {
mc.netConn, err = net.DialTimeout(mc.cfg.net, mc.cfg.addr, mc.cfg.timeout)
}
} else { // no timeout
mc.netConn, err = net.Dial(mc.cfg.net, mc.cfg.addr)
}
nd := net.Dialer{Timeout: mc.cfg.timeout}
mc.netConn, err = nd.Dial(mc.cfg.net, mc.cfg.addr)
if err != nil {
return nil, err
}
Expand Down
Loading