pt-table-sync - incorrect return code on error

Bug #1647909 reported by Ryan Brothers
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Confirmed
Undecided
Unassigned

Bug Description

The manual for pt-table-sync states that an exit code of 2 indicates "At least one table differed on the destination". In the below example, the error is an invalid username/password, but the return code is 2. Should this be a return code of 1 for "Internal Error"?

[test@test ~]$ pt-table-sync --dry-run h=127.0.0.1,P=3306,u=test,p=test,D=test1,t=table1 h=127.0.0.1,P=3306,u=test,p=test,D=test2
DBI connect('test1;host=127.0.0.1;port=3306;mysql_read_default_group=client','test',...) failed: Access denied for user 'test'@'127.0.0.1' (using password: YES) at /usr/bin/pt-table-sync line 2242.
[test@test ~]$ echo $?
2

Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

Thank you for the report.

Verified as described:

sveta@Thinkie:~/issues$ ~/src/percona-toolkit/bin/pt-table-sync --sync-to-master --dry-run h=127.0.0.1,P=13002,u=root,p=foo
DBI connect(';host=127.0.0.1;port=13002;mysql_read_default_group=client','root',...) failed: Access denied for user 'root'@'localhost' (using password: YES) at /home/sveta/src/percona-toolkit/bin/pt-table-sync line 2248.
sveta@Thinkie:~/issues$ echo $?
2
sveta@Thinkie:~/issues$ ~/src/percona-toolkit/bin/pt-table-sync --version
pt-table-sync 2.2.19

Changed in percona-toolkit:
status: New → Confirmed
tags: added: pt-table-sync
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1402

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.