backport of fix in PR 109

see [PR 109](https://github.com/go-sql-driver/mysql/pull/109)