Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-6875

mysql : PASSWORD field renamed to AUTHENTICATION_STRING needs to work for mariadb also

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mysql
    • Labels:
    • Environment:

      Puppet Master on RHEL 7, version v2017.3.5

      Client RHEL 7, MariaDB 10.2.13

      mysql forge module 5.3.0

    • Template:
      MODULES Bug Template
    • Acceptance Criteria:
      Hide

      It needs to run successfully when MariaDB 10.2 is the DB.

      Show
      It needs to run successfully when MariaDB 10.2 is the DB.
    • Epic Link:
    • Team:
      Modules
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      The user management operations fail for MariaDB 10.2 as the PASSWORD field is no longer available.  It needs to be treated that same as mysql and percona server.

      We get this error message:

      Error: Failed to apply catalog: Execution of '/bin/mysql --defaults-extra-file=/root/.my.cnf -NBe SELECT MAX_USER_CONNECTIONS, MAX_CONNECTIONS, MAX_QUESTIONS, MAX_UPDATES, SSL_TYPE, SSL_CIPHER, X509_ISSUER, X509_SUBJECT, PASSWORD /*!50508 , PLUGIN */ FROM mysql.user WHERE CONCAT(user, '@', host) = 'mysql.session@localhost'' returned 1: ERROR 1054 (42S22) at line 1: Unknown column 'PASSWORD' in 'field list'
      

      This is the fix:

      --- lib/puppet/provider/mysql_user/mysql.rb.old 2018-03-20 14:54:18.877859873 +1100
      +++ lib/puppet/provider/mysql_user/mysql.rb 2018-03-20 14:36:58.990713313 +1100
      @@ -14,7 +14,7 @@
       ## Default ...
       # rubocop:disable Metrics/LineLength
       query = "SELECT MAX_USER_CONNECTIONS, MAX_CONNECTIONS, MAX_QUESTIONS, MAX_UPDATES, SSL_TYPE, SSL_CIPHER, X509_ISSUER, X509_SUBJECT, PASSWORD /*!50508 , PLUGIN */ FROM mysql.user WHERE CONCAT(user, '@', host) = '#\{name}'"
      - elsif (mysqld_type == 'mysql' || mysqld_type == 'percona') && Puppet::Util::Package.versioncmp(mysqld_version, '5.7.6') >= 0
      + elsif (mysqld_type == 'mysql' || mysqld_type == 'percona' || mysqld_type == 'mariadb') && Puppet::Util::Package.versioncmp(mysqld_version, '5.7.6') >= 0
       query = "SELECT MAX_USER_CONNECTIONS, MAX_CONNECTIONS, MAX_QUESTIONS, MAX_UPDATES, SSL_TYPE, SSL_CIPHER, X509_ISSUER, X509_SUBJECT, AUTHENTICATION_STRING, PLUGIN FROM mysql.user WHERE CONCAT(user, '@', host) = '#\{name}'"
       else
       query = "SELECT MAX_USER_CONNECTIONS, MAX_CONNECTIONS, MAX_QUESTIONS, MAX_UPDATES, SSL_TYPE, SSL_CIPHER, X509_ISSUER, X509_SUBJECT, PASSWORD /*!50508 , PLUGIN */ FROM mysql.user WHERE CONCAT(user, '@', host) = '#\{name}'"
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              mattqm Matthew Mallard
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:

                  Zendesk Support