Bug #93692 "SET NAMES binary COLLATE binary" returns syntax without quote
Submitted: 20 Dec 2018 0:02 Modified: 6 Jan 2020 11:31
Reporter: Rene' Cannao' Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.6/5.7/8.0 OS:Any
Assigned to: CPU Architecture:Any

[20 Dec 2018 0:02] Rene' Cannao'
Description:
According to the documentation on SET NAMES syntax (https://dev.mysql.com/doc/refman/5.7/en/set-names.html) :

charset_name and collation_name may be quoted or unquoted

This doesn't seem true for "SET NAMES binary COLLATE binary" , that requires the collation name to be quoted.

How to repeat:
mysql> SET NAMES utf8 COLLATE 'utf8_bin';
Query OK, 0 rows affected (0.00 sec)

mysql> SET NAMES utf8 COLLATE utf8_bin;
Query OK, 0 rows affected (0.00 sec)

mysql> SET NAMES binary COLLATE 'binary';
Query OK, 0 rows affected (0.00 sec)

mysql> SET NAMES binary COLLATE binary;
ERROR 1064 (42000): 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 'binary' at line 1

Suggested fix:
Allow the use of "COLLATE binary" to be unquoted.
[20 Dec 2018 2:08] MySQL Verification Team
Thank you for the bug report.
[6 Jan 2020 11:31] Gleb Shchepa
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/