Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
-
None
-
Debian 11
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'; |