Bug #106234 MysqlDump Don`t reset SESSION.SQL_LOG_BIN in the end of dump file
Submitted: 21 Jan 2022 11:18 Modified: 21 Jan 2022 16:00
Reporter: mohamed atef Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.7.37 OS:Windows (64)
Assigned to: CPU Architecture:Any
Tags: Mysqldump SESSION.SQL_LOG_BIN

[21 Jan 2022 11:18] mohamed atef
Description:
When Run MysqlDump the Result Dump don`t contain
SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;
to Reset SESSION.SQL_LOG_BIN from 0 to Old One.

How to repeat:
run mysqldump using Windows cmd
("c:\program files\mysql\mysql server 5.7\bin\mysqldump" --defaults-extra-file=E:\abcdatabackup\dump.cnf --hex-blob --single-transaction --quick --routines --events --triggers --master-data=2 --set-gtid-purged  --add-drop-database --databases db1 db2 > "E:\backup.sql
the result file doesnot contain 
SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;
as in version 5.7.36

Suggested fix:
i Don`t Know
[21 Jan 2022 14:13] MySQL Verification Team
Hi Mr. atef,

Thank you for your bug report.

However, this is not a bug.

Our Reference Manual describes the conditions under which that value will be printed in the output file.

You should set the mode for GTID to the proper value. Then , your binary logging should be on and your server should use GTID. There are a couple of other conditions as described in the same manual.

Not a bug.
[21 Jan 2022 16:00] mohamed atef
my server is configured as master and slave for replication with other server
here is my config file

master-info-file = master.info
relay-log = ph-relay
replicate-do-db = db1
replicate-do-db = db2
enforce_gtid_consistency = ON
log-bin = ph-bin
binlog-format = ROW
master_info_repository = TABLE
explicit_defaults_for_timestamp
relay_log_recovery
log_slave_updates
sync_binlog = 1
binlog-do-db = db1
binlog-do-db = db2
gtid-mode = ON
relay-log-info-repository = TABLE

When i Downgraded my server to 5.7.36 the statement added Successfully
also when is use mysql server 8.0.28 the statement added Successfully in the result file

also why the result file contain the following
SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;
SET @@SESSION.SQL_LOG_BIN= 0;
it wired situation to set session.log_bin to 0 to prevent server from writing the to binlog file and didn't write the statement to restore it to original statement after importing this dump to other server
[21 Jan 2022 16:22] MySQL Verification Team
Hi,

Your comments are unrelated to what we wrote in our response.

Beside that, downgrading 8.0 -> 5.7 is not fully supported.

Not a bug .