Bug #85886 Replication breaks on collumn privilege with reserved words
Submitted: 10 Apr 2017 22:32 Modified: 11 Apr 2017 7:54
Reporter: Marcelo Altmann Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.7.18 OS:Any
Assigned to: CPU Architecture:Any
Tags: regression

[10 Apr 2017 22:32] Marcelo Altmann
Description:
MySQL will break replication if you assign a grant on a column with reserved word.
5.6 series is not affected by this issue.

How to repeat:
CREATE DATABASE IF NOT EXISTS test;
USE test;
CREATE TABLE rpl_reserved_words(`join` varchar(10));
GRANT SELECT(`join`) ON test.rpl_reserved_words TO test@`%` IDENTIFIED BY 'Som3Password!';

Suggested fix:
Escape columns from GRANTS the same way it's done on TABLES, HOSTS, ...
[11 Apr 2017 7:54] MySQL Verification Team
Hello Marcelo,

Thank you for the report and test case.
Observed that 5.7.18 is affected.

Thanks,
Umesh
[8 Aug 2017 2:27] ashe sun
And I can not skip this inaccurate transaction by 
mysql> set gtid_next='b530069d-78df-11e7-832d-000c29c0110c:24';
Query OK, 0 rows affected (0.00 sec)
mysql> begin;
Query OK, 0 rows affected (0.00 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> set gtid_next=automatic;
Query OK, 0 rows affected (0.00 sec)

 because there are not ·begin· ·end·  in binary log file :
#170808 10:15:50 server id 12713307  end_log_pos 622 CRC32 0xbf94d78c   GTID    last_committed=2        sequence_number=3
SET @@SESSION.GTID_NEXT= 'b530069d-78df-11e7-832d-000c29c0110c:24'/*!*/;
# at 835
#170808 10:15:50 server id 12713307  end_log_pos 869 CRC32 0xdbcda000   Query   thread_id=4     exec_time=0     error_code=0
SET TIMESTAMP=1502158550/*!*/;
GRANT SELECT (join) ON `test`.`rpl_reserved_words` TO 'test'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*6C223D843699F48FAB6137104D1C8845DEFF96F0'
/*!*/;
# at 1082