go-sql-driver/mysql — pull request #151 by julienschmidt (2013-11-02 09:45:32+00:00)
Title: Return ErrBadConn for invalid connections

This helps with #142
The database/sql package only retries if it encounters an ErrBadConn.
With errInvalidConn it returns immediately