Bug #77868 False syntax error for valid SHOW GRANTS statement
Submitted: 29 Jul 2015 6:33 Modified: 9 Dec 2015 17:32
Reporter: Umesh Shastry Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:6.3.4 revision 0 build 828 (64 bit) OS:Any
Assigned to: CPU Architecture:Any

[29 Jul 2015 6:33] Umesh Shastry
Description:
To list the privileges granted to the account that you are using to connect to the server, you can use any of the following statements:

SHOW GRANTS;
SHOW GRANTS FOR CURRENT_USER;
SHOW GRANTS FOR CURRENT_USER();

But, observed that SQL Editor falsely claims syntax error for first statement i.e for  SHOW GRANTS;

Verified this on Win7, and should be seen in other OS as well.

How to repeat:
See decsription

Suggested fix:
Should not show syntax error for valid GRANT GRANT; statement
[29 Jul 2015 6:34] MySQL Verification Team
Screenshot..

Attachment: 77868_Screenshot.png (image/png, text), 51.82 KiB.

[29 Jul 2015 7:05] MySQL Verification Team
From mysql CLI:

mysql> SHOW GRANTS;
+---------------------------------------------------------------------+
| Grants for root@localhost                                           |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION        |
+---------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> SHOW GRANTS FOR CURRENT_USER;
+---------------------------------------------------------------------+
| Grants for root@localhost                                           |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION        |
+---------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> SHOW GRANTS FOR CURRENT_USER();
+---------------------------------------------------------------------+
| Grants for root@localhost                                           |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION        |
+---------------------------------------------------------------------+
2 rows in set (0.00 sec)

SHOW GRANTS Syntax - https://dev.mysql.com/doc/refman/5.6/en/show-grants.html
[9 Dec 2015 17:32] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.3.6 release, and here's the changelog entry:

The SHOW GRANTS statement would be seen as invalid syntax.

Thank you for the bug report.