Bug #90538 mysqldump error bad exit code
Submitted: 20 Apr 2018 19:30 Modified: 24 Apr 2018 4:48
Reporter: Ryan Masse Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:5.7.21, 5.7.22 OS:Any
Assigned to: CPU Architecture:Any
Tags: mysqldump exit code

[20 Apr 2018 19:30] Ryan Masse
Description:
When mysqldump errors it's not returning the proper exit code.

How to repeat:
$ mysqldump --login-path=fluffy --routines --triggers --single-transaction --quick --set-gtid-purged=OFF | gzip > ~/dump.sql.gz

mysqldump: Error: 'Query execution was interrupted, maximum statement execution time exceeded' when trying to dump tablespaces
mysqldump: Error 3024: Query execution was interrupted, maximum statement execution time exceeded when dumping table `_audit_schema` at row: 0

$ echo $?
0

Suggested fix:
Should return exit status of 1
[24 Apr 2018 4:48] MySQL Verification Team
Hello Ryan Masse,

Thank you for the report.

Thanks,
Umesh