Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Mar 4, 2015
  1. @igalic

    document mysql_server_id fact and add spec tests

    igalic authored
    add spec tests, expand documentation to mention lo behaviour
    also, rename fact, for, consistency.
  2. @NoodlesNZ @igalic

    Added server_id fact

    NoodlesNZ authored igalic committed
    use mac address for "guaranteed" uniqueness ;)
Commits on Feb 9, 2015
  1. @mhaskel

    MODULES-1759: Remove dependency on stdlib >=4.1.0

    mhaskel authored
    Backported dirname => mysql_dirname since updating dependency to stdlib
    4.1.0 is backwards incompatible with some versions of PE.
Commits on Feb 6, 2015
  1. @hunner

    Merge pull request #645 from dveeden/auth-plugins

    hunner authored
    Support authentication plugins
  2. @hunner

    Make grant autorequire user

    hunner authored
    grants that happen before a user is created cause an ERROR 1396
Commits on Feb 5, 2015
  1. @hunner

    Merge pull request #646 from dveeden/emptypwd

    hunner authored
    Return an empty string for an empty input.
Commits on Jan 28, 2015
  1. @dveeden

    Return an empty string for an empty input.

    dveeden authored
    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)
Commits on Jan 26, 2015
  1. @dveeden
Commits on Jan 24, 2015
  1. @dveeden

    Support authentication plugins

    dveeden authored
    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 */"
Commits on Jan 22, 2015
  1. @cmurphy
Commits on Jan 17, 2015
  1. @dveeden

    Support authentication plugins

    dveeden authored
    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.
Commits on Dec 31, 2014
  1. @mhaskel

    MODULES-1520 - update username validation

    mhaskel authored
    Don't fail on validation where the user isn't quoted with special
    characters. The providers quote these strings by default.
Commits on Dec 13, 2014
  1. @mhaskel

    Fix issues introduced in puppetlabs/puppetlabs-mysql#612

    mhaskel authored
    The regex updates caused failures in some places where it previously
    (correctly) worked.
Commits on Nov 27, 2014
  1. @lavoiesl

    Reworked all identifier quoting detections

    lavoiesl authored
    Otherwise, trying to manage `debian-sys-maint` will fail miserably, quoted or not.
    
    Fixes #609
Commits on Nov 20, 2014
  1. @michaeltchapman

    Support size 15 and 16 quoted usernames

    michaeltchapman authored
    As usernames containing special characters must be quoted, they
    may have two extra characters that are not counted against the
    size limit of 16 characters. This patch adds a regex to handle
    this case.
Commits on Nov 13, 2014
  1. @MasonM

    Fix regression in username validation

    MasonM authored
    Commit cdd7132 added logic to catch invalid database usernames,
    but the regex it uses fails to match usernames with special characters that are properly quoted,
    causing errors with usernames that used to work in versions < 3.0.0. This fixes the regex so that
    if the username is quoted, anything is allowed between the quotes.
    
    From the docs (http://dev.mysql.com/doc/refman/5.5/en/identifiers.html):
    "Permitted characters in quoted identifiers include the full Unicode Basic Multilingual Plane (BMP),
    except U+0000"
Commits on Nov 7, 2014
  1. @igalic

    Merge pull request #594 from skroll/escape_backslash

    igalic authored
    Fix escaped backslashes in grants
Commits on Nov 6, 2014
  1. @maxenced

    Improve checks for MySQL user's name.

    maxenced authored
    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.)
Commits on Nov 5, 2014
  1. @skroll

    Fix escaped backslashes in grants

    skroll authored
    * Mysql uses the underscore character to represent a single character
      wildcard.
    * A grant on table `the_database`.* would match `theAdatabase`.*, so
      underscores must be escaped to avoid this match.
    * The output from mysql escapes special characters (\n, \t, \0, and \\),
      but the input does not need to be escaped.
    * In order for the provider to compare the tables, the output of
      mysql -NBe <query> must have \\ substituted with \.
Commits on Oct 28, 2014
  1. @igalic

    Merge pull request #571 from jtopper/master

    igalic authored
    [MODULES-1333] Add explicit dependencies for mysql_database and mysql_user types
Commits on Oct 27, 2014
  1. @maxenced

    The old regex requires something after the 'host' part. Fix this.

    maxenced authored
    Old regex is : /^GRANT\s(.+)\sON\s(.+)\sTO\s(.*)@(.*?)(\s.*)$/ . The
    last part (\s.*)$ means "a space followed by anything". The issue is
    that when user has no GRANT privileges, the "SHOW GRANTS FOR #{user_string}" returns
    "GRANT SELECT ON `database`.* TO 'user'@'%'" which does not match (\s.*)$ .
    This small patch fixes this making last bloc optional (thanks to '?').
Commits on Oct 7, 2014
  1. @igalic

    Merge pull request #570 from fnerdwq/mysql_grant_column_privs

    igalic authored
    (MODULES-552) Add capability to specify column_privileges
Commits on Oct 6, 2014
  1. @fnerdwq
Commits on Sep 16, 2014
  1. @jtopper

    Add explicit dependencies for types

    jtopper authored
    mysql_grant has an autorequire()'d dependency on the .my.cnf file used
    by the provider to talk to the database.
    
    I've added this to mysql_database and mysql_user too since logically
    these also need the file to be in place.
    
    I've hit this bug because of a slightly unusual edge case in our own
    manifests, but I think this fix belongs upstream regardless.
  2. @igalic

    Merge pull request #569 from fnerdwq/mysql_grant_revokation

    igalic authored
    (MODULES-1330) Change order of revokation.
  3. @fnerdwq
  4. @mmonaco

    mysql_database: prevent syntax error with collate=>'binary'

    mmonaco authored
    On MySQL v5.5.38, creating a database such as:
    
    	CREATE DATABASE `mydb` CHARACTER SET binary COLLATE binary;
    
    seems to hit a parser bug. A workaround is simply to quote COLLATE
    `binary`. As the quoting is harmless, and for aesthetics, quote both
    the CHARACTER SET and COLLATE arguments.
Commits on Aug 8, 2014
  1. Remove all the deprecated code.

    Ashley Penney authored
Commits on Jul 24, 2014
  1. @rayl

    Prevent ERROR 1008 in mysql_database provider

    rayl authored
    Check for database existence when dropping to prevent
    
      ERROR 1008 (HY000): Can't drop database 'test'; database doesn't exist
    
    Signed-off-by: Ray Lehtiniemi <rayl@mail.com>
Commits on Jul 13, 2014
  1. @jsosic

    Fix problem with GRANT not recognizing backslash

    jsosic authored
    If database grant has backslash in database name (for example: example\_dev), then puppet will try to apply same resource every run because MySQL reports that table name with double backslash (for example: example\\_dev). By global replace of double backslash with single one, this issue is fixed.
Commits on Jun 17, 2014
  1. @spil-jaak

    Change grant provider to ignore grants for non existing users.

    spil-jaak authored
    In the grant provider users are fetched by querying mysql.user table. Grants
    for those users are fetched using show grants for... syntax. This can lead to
    errors, when some of the users in mysql.user table do not have currently
    active grants.
    
    This happens at least when MySQL is started with --skip-name-resolve option,
    when there are users with the hostname part specified as a FQDN. Such users are
    created by mysql_install_db. This leads to problems if mysql::account_security
    is included for the node and skip-name-resolve is specified in override_options
    hash for mysql::server.
    
    Includes acceptance test for the change.
Commits on Jun 5, 2014
  1. Merge pull request #522 from cmurphy/fix_mysql_grant_MODULES-1040

    Ashley Penney authored
    Require title of mysql_grant resource to match form user/table
Commits on Jun 4, 2014
  1. @cmurphy

    Require title of mysql_grant resource to match form user/table

    cmurphy authored
    This addresses https://tickets.puppetlabs.com/browse/MODULES-1040.
    The user parameter is required to have the form username@host. A grant
    is identified in the instances method by a name of the form
    username@host/table. The resource will fail to be identified as already
    existing if the name given to the resource does not match this form.
  2. @larsks

    lowercase hostname values in qualified usernames

    larsks authored
    MySQL/MariaDB automatically downcase hostnames:
    
      MariaDB [mysql]> create user 'testuser'@'HOSTNAME';
      MariaDB [mysql]> select user,host from user where host = 'hostname';
      +----------+----------+
      | user     | host     |
      +----------+----------+
      | testuser | hostname |
      +----------+----------+
    
    This causes problems when a mysql_user or datbase_user has an hostname
    with non-lowercase characters:
    
      database_user { "root@HOSTNAME":
        ensure => absent,
      }
    
    The SELECT statements used to determine if the user exists will fail
    because the comparisons use "HOSTNAME" but the database has "hostname".
    This patch forces the hostname part of "user@hostname" to lower case in
    the custom type definitions.
Commits on Feb 18, 2014
  1. Repair this by ensuring calls to mysql include the database name.

    Ashley Penney authored
    A prior commit accidently broke this, meaning that mysql_database
    was querying the mysql defaults instead of each individual database
    when trying to determine the current collate settings.
Something went wrong with that request. Please try again.