Bug #99164 mysqldump --set-gtid-purged=COMMENTED should not disable binlogging.
Submitted: 2 Apr 2020 18:11 Modified: 3 Apr 2020 7:08
Reporter: Manuel Ung Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:8.0.19 OS:Any
Assigned to: CPU Architecture:Any

[2 Apr 2020 18:11] Manuel Ung
Description:
This is feedback for https://dev.mysql.com/worklog/task/?id=12959

When we run mysqldump with --set-gtid-purged=COMMENTED, the idea is that these gtids are for informational purposes only, and don't actually need to be executed.

However, turning sql_log_bin off, when we're not running the SET @@GLOBAL.GTID_PURGED statement does not make sense.  These statements should be omitted.

How to repeat:
Look at mysql-test/r/mysqldump_gtid.result

and note that we print these statements:

SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;
SET @@SESSION.SQL_LOG_BIN= 0;
...
SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;

Suggested fix:
Don't print these statements.
[3 Apr 2020 7:08] MySQL Verification Team
Hello Manuel Ung,

Thank you for the bug report and feedback.

regards,
Umesh