Bug #76249 Replication should ignore safe update mode
Submitted: 10 Mar 2015 21:42 Modified: 9 Mar 2018 9:47
Reporter: Robert Wultsch Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.6 OS:Any
Assigned to: Bogdan Kecman CPU Architecture:Any

[10 Mar 2015 21:42] Robert Wultsch
Description:
The SQL thread for statement based replication should ignore sql_safe_updates. This not happening causes replication to break.

How to repeat:
On slave:
set global sql_safe_updates=on;
start slave;

On master:
set global sql_safe_updates=on;
set sql_safe_updates=off;
# Run a command that would be fail with safe updates on.
delete from mysql.user where user="rwultsch";

Replication breaks:
               Last_SQL_Errno: 1175
               Last_SQL_Error: Error 'You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column' on query. Default database: ''. Query: 'delete from mysql.user where user="rwultsch"'

Suggested fix:
The SQL thread should ignore sql_safe_updates.
[9 Mar 2018 9:47] Bogdan Kecman
Hi,

I apologize but I disagree with you. There is no reason for safe_update to be ignored, just as there's no reason for safe_update to be set on slave system.

kind regards
Bogdan