mysqldump has this code:
The conditional use of LOCAL seems to come from this mysql bug:
But I think the patch for that bug is rather confused. I do not think there is
ever a reason for mysqldump to issue a FLUSH TABLES that will be written into
the binlog and replicated to slaves. It should always use LOCAL.
This is particularly serious in 10.0+ where we have GTID. In this case, any
attempt to mysqldump a slave will silently inject a local binlogged
transaction on the slave, which causes that slave to have an alternate future
(extra GTID not present on the master), which is generally a bad thing.
So I propose to fix this in 10.0 by using LOCAL unconditionally.