- Added MySQL version and flavour detection support
- Added mysql_datadir provider/type (replaces Exec[mysql_install_db])
- Added version specific parameters my.cnf ([mysqld-5.X] sections)
- Version specific user mangement SQL (ALTER USER for 5.7.6++ ...)
Rebased-By: David Schmitt <david.schmitt@puppetlabs.com>
Switching out the puppet version, as puppet_facts does, does not work,
as this will confuse code that wants to use version-dependent features.
Instead this uses rspec-puppet-facts, which doesn't touch the puppet
version.
The password column has been renamed to authentication_string in MySQL >=5.7.6.
By using: SELECT /*!50706 AUTHENTICATION_STRING AS */ PASSWORD the query will
continue to work in older versions as well as newer ones.
We want to make sure we are validating the entire user parameter (and
validating it consistently between mysql_user and mysql_grant).
Additionally, for munging we do not want to do anything that could
truncate the username.
This code have been remove here 4bab65edcb (diff-0938042fe2382aeb10032aa7f8444995) but it is required otherwise we get an `Evaluation Error: Unknown variable: 'install_db_args'.` when using `manage_config_file = false`
Running RHEL 7.1, puppetlabs-mysql is not idempotent.
After a second run, puppet tries to change the SElinux context:
/File[mysql-config-file]/seltype: seltype changed 'etc_t' to
'mysqld_etc_t'
Since packaging already manages SElinux labels, we should not let
Puppet doing it (default behavior).
This patch aims to set selinux_ignore_defaults to True for the
mysql-config-file File resource.
Thanks to that patch, Puppet will be indempotent between all runs on
RHEL platforms.
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.
- There are older versions of mysql that do not support the privilege TRIGGER and need to change default to not include
http://dev.mysql.com/doc/refman/5.0/en/grant.html
'MySQL does not support the standard SQL UNDER privilege, and does not support the TRIGGER privilege until MySQL 5.1.6'
- Updated tests to have both 5.1.6 and 5.0.11 tests for mysql_version fact
This patch changes the raise_error matchers to use `catalogue` instead
of `subject` since `subject` is not evaluated the way it used to be;
changes a parameter value from empty string to nil to be compatible
with the future parser, and unpins rspec-puppet.
the recently added feature to support galera by allowing independent
creation of the root@localhost user in the DB and the /root/.my.cnf
file contains a bug.
specifically the .my.cnf file resource still requires the root@localhost
resource, even when it is not available.
this fixes the issue by making the dependency conditional.
https://tickets.puppetlabs.com/browse/MODULES-1676
This is identical to what PASSWORD('') in MySQL does:
5.6.22-debug-log> CREATE USER 'testpwd'@'localhost' IDENTIFIED BY 'foo';
Query OK, 0 rows affected (0.03 sec)
5.6.22-debug-log> SELECT User,Host,Password FROM mysql.user WHERE
User='testpwd';
+---------+-----------+-------------------------------------------+
| User | Host | Password |
+---------+-----------+-------------------------------------------+
| testpwd | localhost | *F3A2A51A9B0F2BE2468926B4132313728C250DBF |
+---------+-----------+-------------------------------------------+
1 row in set (0.01 sec)
5.6.22-debug-log> SET PASSWORD FOR 'testpwd'@'localhost' = PASSWORD('');
Query OK, 0 rows affected (0.00 sec)
5.6.22-debug-log> SELECT User,Host,Password FROM mysql.user WHERE
User='testpwd';
+---------+-----------+----------+
| User | Host | Password |
+---------+-----------+----------+
| testpwd | localhost | |
+---------+-----------+----------+
1 row in set (0.00 sec)
This uses CREATE USER xxx IDENTIFIED WITH yyy
For tests:
unix_socket is not loaded by default, so this might require:
install plugin unix_socket soname 'auth_socket.so';
The mysql_native_password plugin is available by default and
allows you to also set a password.
Try to make it compatible with MySQL < 5.5.7 it uses version
specific code with "/*!50508 stmt */"