Bug #80055 Wrong return code and incosistent error message on --set-gtid-purged=ON
Submitted: 19 Jan 2016 18:55 Modified: 20 Jan 2016 9:38
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:5.7.10, 5.6.28 OS:Any
Assigned to: CPU Architecture:Any
Tags: GTID, mysqldump, returncode

[19 Jan 2016 18:55] Daniël van Eeden
Description:
When using mysqldump with --set-gtid-purged=ON on a server without GTID is supposed to fail. But in that case I would expect a non-zero return code.

Also the formatting of the error differs other errors.

How to repeat:
$ mysqldump -A -u foo -pbar > /dev/null; echo $?
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Got error: 1045: Access denied for user 'foo'@'localhost' (using password: YES) when trying to connect
2
$ mysqldump -A --set-gtid-purged=ON > /dev/null; echo $?
Error: Server has GTIDs disabled.
0

Suggested fix:
- set a non-zero returncode when mysqldump fails
- use "mysqldump: [Error] Server has GTIDs disabled." as error message
[20 Jan 2016 9:38] MySQL Verification Team
Hello Daniël,

Thank you for the report.
Verified as described with 5.7.28 and 5.7.10 builds.

Thanks,
Umesh
[20 Jan 2016 9:38] MySQL Verification Team
-- 5.7.10 (you may have to create create user ''@''; in order to trigger this on 5.7)

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10: bin/mysqldump -A -u foo -pbar -S/tmp/mysql_ushastry.sock  > /dev/null; echo $?
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Got error: 1045: Access denied for user 'foo'@'localhost' (using password: YES) when trying to connect
2
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.10: bin/mysqldump -A --set-gtid-purged=ON -S/tmp/mysql_ushastry.sock > /dev/null; echo $?
Error: Server has GTIDs disabled.
0

-- 5.6.28

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.28: bin/mysqldump -A -u foo -pbar -S/tmp/mysql_ushastry.sock  > /dev/null; echo $?
Warning: Using a password on the command line interface can be insecure.
mysqldump: Got error: 1045: Access denied for user 'foo'@'localhost' (using password: YES) when trying to connect
2
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.28: bin/mysqldump -A --set-gtid-purged=ON -S/tmp/mysql_ushastry.sock > /dev/null; echo $?
Error: Server has GTIDs disabled.
0
[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.28: