Bug #80950 mysqldump warns about set-gtid-purged=OFF when not dumping data
Submitted: 4 Apr 2016 20:58 Modified: 25 Oct 2017 23:46
Reporter: monty solomon Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[4 Apr 2016 20:58] monty solomon
Description:
When executing a mysqldump command that does not dump any data it prints a warning about needing to pass --set-gtid-purged=OFF.

How to repeat:
mysqldump --single-transaction --no-data --databases test -r test.sql

Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.

Suggested fix:
Don't print the warning when --no-data is used.
[25 Oct 2017 23:46] Miguel Solorzano
Thank you for the bug report.

miguel@tikal:~/dbs $ mysqldump -uroot -p --single-transaction --no-data --databases test -r test.sql
Enter password:
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.