Bug #68540 Syntax error when adding schema privileges for a database with an underscore (_)
Submitted: 1 Mar 2013 18:01 Modified: 2 Mar 2013 18:07
Reporter: Ben Stillman Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S2 (Serious)
Version:5.2.47 OS:Any
Assigned to: CPU Architecture:Any

[1 Mar 2013 18:01] Ben Stillman
Description:
A syntax error happens when adding schema privileges to a user for a database with an underscore (_). For example, databasename_dev. This did not happen with previous version of MySQL Workbench. It started happening when I updated to 5.2.47.

How to repeat:
Open a connection to a database server under the "Server Administration".

Click on "User and Privileges".

Click "Schema Privileges" tab. 

Click "Add Entry...".

Under "Selected Schema", choose one with an underscore. 

The following error will be presented:

Error executing 'GRANT SELECT ON databasename_dev.* TO 'username'@'hostname'
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\dev.* TO 'username'@'hostname' at line 1.
SQL Error: 1064

"databasename_dev", "username", and "hostname" have been changed to generic entities.
[1 Mar 2013 18:02] Ben Stillman
Meant to add: Running the grant statement via the CLI works fine.
[2 Mar 2013 18:07] MySQL Verification Team
Thank you for the bug report. Duplicate of http://bugs.mysql.com/bug.php?id=68175 .