Skip to content

Default mysqld_type should be "mysql" #824

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

Merged
merged 1 commit into from
Apr 25, 2016
Merged

Conversation

ih84ds
Copy link
Contributor

@ih84ds ih84ds commented Apr 14, 2016

Default mysqld_type return value should be "mysql" if another type is not detected. Returning nil breaks mysql 5.7.11 on Ubuntu (at least) due to the conditional used in mysql_user provider.

Default mysqld_type return value should be "mysql" if another type is not detected. Returning nil breaks mysql 5.7.11 on Ubuntu (at least) due to the conditional used in mysql_user provider.
@solomonty
Copy link

What is the version string for mysql on Ubuntu?

@ih84ds
Copy link
Contributor Author

ih84ds commented Apr 14, 2016

mysqld Ver 5.7.11-0ubuntu6 for Linux on x86_64 ((Ubuntu))

@@ -24,7 +24,7 @@ def self.mysqld_type
mysqld_version_string.scan(/mariadb/i) { return "mariadb" }
mysqld_version_string.scan(/\s\(mysql/i) { return "mysql" }
mysqld_version_string.scan(/\s\(percona/i) { return "percona" }
nil
return "mysql"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to match on what we know instead of assuming everything is "mysql"

add this above the nil instead

mysqld_version_string.scan(/\s\(\(ubuntu/i) { return "mysql" }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. This is the mysql module, after all. mysql should be the default. Why nil? There are Ubuntu packages out there for mariadb as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's nil specifically for catching unhandled cases instead of propagating incorrectly handled cases. Fail-fast style.

Anyway, I think I agree with @solomonty that if ((Ubuntu)) is the moniker that Ubuntu packagers have chosen to mark their packages with, we can only follow suit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds OK in theory, but it only works if it is caught where it is used. It is most definitely not caught in the mysql_user provider.

I feel that mariadb and percona are the special cases that need to be trapped, not mysql. If there is a "mysqld" executable, it should be assumed to actually be mysql unless a special case is detected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable.

@mmailand
Copy link

I have the some problem on Ubuntu Xenial.

@hunner hunner merged commit 2603411 into puppetlabs:master Apr 25, 2016
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.

5 participants