Skip to content
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

Improve checks for MySQL user's name. #588

Merged
merged 1 commit into from
Nov 7, 2014

Conversation

maxenced
Copy link
Contributor

As per http://dev.mysql.com/doc/refman/5.5/en/identifiers.html , MySQL
allows for more than '\w-'. This commit improves the check to ensure
that:

  • if username only contains [0-9a-zA-Z$_], it might be quoted. It is
    not a requirement though
  • if username contains anything else, it MUST be quoted

I kept 2 checks, but the 2nd one can probably be removed (I can't find a
username which match the 2nd one but not the first.)

@igalic
Copy link
Contributor

igalic commented Nov 6, 2014

could you please squash those two commits?

As per http://dev.mysql.com/doc/refman/5.5/en/identifiers.html , MySQL
allows for more than '\w-'. This commit improves the check to ensure
that:
 - if username only contains [0-9a-zA-Z$_], it might be quoted. It is
   not a requirement though
 - if username contains anything else, it MUST be quoted

I kept 2 checks, but the 2nd one can probably be removed (I can't find a
username which match the 2nd one but not the first.)
@maxenced
Copy link
Contributor Author

maxenced commented Nov 6, 2014

Sure. Just done it :)

igalic added a commit that referenced this pull request Nov 7, 2014
@igalic igalic merged commit 1494412 into puppetlabs:master Nov 7, 2014
@igalic
Copy link
Contributor

igalic commented Nov 7, 2014

thanks for the patch @maxenced!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants