migrate
migrate copied to clipboard
prevent net/url encoding the user password
According to net/url
// A URL represents a parsed URL (technically, a URI reference).
//
// The general form represented is:
//
// [scheme:][//[userinfo@]host][/]path[?query][#fragment]
//
// URLs that do not start with a slash after the scheme are interpreted as:
//
// scheme:opaque[?query][#fragment]
//
If the url starts with a slash after the scheme, the url.String()
func will do url encode for the userinfo. In this case, password that has non-alphanumeric char will be url encoded and mysql auth will fail.
Probably the best fix should be in Open() func of database/driver.go. However I'm using mysql and not familiar with other drivers, so make a tiny fix in the mysql driver