Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30056

Impossible to export column grants

    XMLWordPrintable

Details

    Description

      when we want export role from MariaDB, and when it use 'reserved key word' it's not possible to import these roles :

      example :

      mysql --skip-column-names --no-auto-rehash --silent --execute="SELECT CONCAT('SHOW GRANTS FOR ''',User,''';') FROM mysql.user WHERE is_role = 'Y'" | mysql --skip-column-names --no-auto-rehash | sed 's/$/;/g;1s/^/## Grants for Roles ##\n/' > /tmp/role-grants.sql
      

      GRANT SELECT (segmentation, cms, order, idAccount, runRateAmount, sector) ON `pc_common_copy`.`accountsSalesForceData` TO 'role_devro01';
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'order, idAccount, runRateAmount, sector) ON `pc_common_copy`.`accountsSalesForce' at line 1
      

      Here the problem with ORDER but it's the same with other keysword.

      The goal there, should be to encapsulate fields with back quotes.

      GRANT SELECT (segmentation, cms, `order`, idAccount, runRateAmount, sector) ON `pc_common_copy`.`accountsSalesForceData` TO 'role_devro01';
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            Aurelien_LEQUOY Aurélien LEQUOY
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.