Skip to content

Database URL does not support plus sign in password #199

@matt-snider

Description

@matt-snider

When a mysql password contains +, it appears to not be handled correctly.

I am encoding the password that I pass via --url so that + becomes %2B. I can see that after url.Parse() in main.go this gets converted back to +. The problem is that the mysql Driver calls url.QueryUnescape(), after which the + becomes a single space.

If I don't encode the +, url.Parse() leaves it as is, but url.QueryUnescape() converts it to a single space, as in the first case.

I've experimented with url.PathUnescape(), and when this is used, everything seems to work properly. It seems like this is a safe switch to make since the documentation says:

PathUnescape is identical to QueryUnescape except that it does not unescape '+' to ' ' (space).

I can see that this change was introduced in #76. @kriive care to weigh on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions