Skip to content

Conversation

zx06
Copy link

@zx06 zx06 commented Aug 4, 2021

Description

Please explain the changes you made here.

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

@shogo82148
Copy link
Contributor

Thank you for your pull request.

The format of the Data Source Name comes from PEAR DB, and it says that username and password are %-encoded.

If your database, option values, username or password contain characters used to delineate DSN parts, you can escape them via URI hex encodings:

: = %3a   / = %2f   @ = %40
+ = %2b   ( = %28   ) = %29
? = %3f   = = %3d   & = %26

But, README says escaping password is not necessary. https://github.com/go-sql-driver/mysql#password

Password
Passwords can consist of any character. Escaping is not necessary.

I think we should accept %-encoded usernames and passwords, and fix the README.
Because passwords can't include @ with the current implementation.

@methane @julienschmidt How do you think?

@methane
Copy link
Member

methane commented Aug 6, 2021

I think it's good idea.
What about backward compatibility?

@shogo82148 shogo82148 merged commit a5bb807 into go-sql-driver:master Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants