-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prevent net/url encoding the user password #69
prevent net/url encoding the user password #69
Conversation
Agreed. For now, fixing every db driver is the right approach. |
@bcho @RyanDeng I'll probably have to revert this PR as it's breaking for users who have A future release of the MySQL driver shouldn't have the same encoding problems: go-sql-driver/mysql#591 |
ok, that makes sense
…On Tue, Jul 24, 2018, 3:10 PM Dale Hui ***@***.***> wrote:
@bcho <https://github.com/bcho> @RyanDeng <https://github.com/RyanDeng>
I'll probably have to revert this PR as it's breaking for users who have @
in their db username. Any encoding interplay between migrate DB drivers and
the underlying DB driver will have to be dealt with in the driver. The best
approach in this case may be to "re-encode" URL and make the url parts
compatible with the MySQL DSN.
A future release of the MySQL driver *shouldn't* have the same encoding
problems: go-sql-driver/mysql#591
<go-sql-driver/mysql#591>
There may always be encoding issues when using url.Parse() directly with
the MySQL driver: go-sql-driver/mysql#460 (comment)
<go-sql-driver/mysql#460 (comment)>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB4jTlffMMq6w2ilDHKveC-ufzHo15wnks5uJshdgaJpZM4U8_xj>
.
|
This is a cherry-pick fix from mattes/migrate#324. This should fix mattes/migrate#256
cc @RyanDeng
According to net/url
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