-
Notifications
You must be signed in to change notification settings - Fork 794
length check for usernames should take mysql version into consideration #722
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
Conversation
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
|
@@ -78,7 +78,11 @@ def initialize(*args) | |||
raise(ArgumentError, "Invalid database user #{value}") | |||
end | |||
|
|||
raise(ArgumentError, 'MySQL usernames are limited to a maximum of 16 characters') unless user_part.size <= 16 | |||
if Puppet::Util::Package.versioncmp(Facter.value(:mysql_version), '10.0.0') < 0 and user_part.size >= 16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If mysql is not installed and mysql_version is unset, what happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then versioncmp
's first argument will be nil, and it will return
NoMethodError: undefined method `scan' for nil:NilClass
Starting MariaDB 10.0.0, usernames are now 80 long. Our mysql_user and mysql_grant types now take that into consideration. This check is *opportunistic*. It will only take place if the mysql_version fact is available. If that is not the case, it will be skipped, leaving the database itself to deal with it, and returning its error verbatim to our users, if it does fail. Our fixed and extended tests assume this isn't the first run, and the fact is already in place.
FAQ: Why aren't we trying harder to determine the version on/before the first run? |
length check for usernames should take mysql version into consideration
👍 thanks @igalic |
Starting MariaDB 10.0.0, usernames are now 80 long.
Our mysql_user and mysql_grant types now take that into consideration.