summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-sql-driver/mysql/driver.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-sql-driver/mysql/driver.go')
-rw-r--r--vendor/github.com/go-sql-driver/mysql/driver.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/vendor/github.com/go-sql-driver/mysql/driver.go b/vendor/github.com/go-sql-driver/mysql/driver.go
index ba1297825..1a75a16ec 100644
--- a/vendor/github.com/go-sql-driver/mysql/driver.go
+++ b/vendor/github.com/go-sql-driver/mysql/driver.go
@@ -23,6 +23,11 @@ import (
"sync"
)
+// watcher interface is used for context support (From Go 1.8)
+type watcher interface {
+ startWatcher()
+}
+
// MySQLDriver is exported to make the driver directly accessible.
// In general the driver is used via the database/sql package.
type MySQLDriver struct{}
@@ -91,7 +96,9 @@ func (d MySQLDriver) Open(dsn string) (driver.Conn, error) {
}
// Call startWatcher for context support (From Go 1.8)
- mc.startWatcher()
+ if s, ok := interface{}(mc).(watcher); ok {
+ s.startWatcher()
+ }
mc.buf = newBuffer(mc.netConn)
@@ -105,9 +112,6 @@ func (d MySQLDriver) Open(dsn string) (driver.Conn, error) {
mc.cleanup()
return nil, err
}
- if plugin == "" {
- plugin = defaultAuthPlugin
- }
// Send Client Authentication Packet
authResp, addNUL, err := mc.auth(authData, plugin)