Skip to content

Commit

Permalink
Start the watcher after handshake (#627)
Browse files Browse the repository at this point in the history
Fixes #626
  • Loading branch information
shogo82148 authored and julienschmidt committed Jul 3, 2017
1 parent 8fefef0 commit bf7f34f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ func (d MySQLDriver) Open(dsn string) (driver.Conn, error) {
mc.parseTime = mc.cfg.ParseTime
mc.strict = mc.cfg.Strict

// Call startWatcher for context support (From Go 1.8)
if s, ok := interface{}(mc).(watcher); ok {
s.startWatcher()
}

// Connect to Server
if dial, ok := dials[mc.cfg.Net]; ok {
mc.netConn, err = dial(mc.cfg.Addr)
Expand All @@ -92,6 +87,11 @@ func (d MySQLDriver) Open(dsn string) (driver.Conn, error) {
}
}

// Call startWatcher for context support (From Go 1.8)
if s, ok := interface{}(mc).(watcher); ok {
s.startWatcher()
}

mc.buf = newBuffer(mc.netConn)

// Set I/O timeouts
Expand Down

0 comments on commit bf7f34f

Please sign in to comment.