Merge lp:~percona-toolkit-dev/percona-toolkit/fix-set-vars-bug-1182856 into lp:~percona-toolkit-dev/percona-toolkit/release-2.2.4

Proposed by Daniel Nichter on 2013-06-25
Status: Merged
Merged at revision: 585
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/fix-set-vars-bug-1182856
Merge into: lp:~percona-toolkit-dev/percona-toolkit/release-2.2.4
Diff against target: 646 lines (+96/-54)
28 files modified
bin/pt-agent (+2/-2)
bin/pt-align (+2/-2)
bin/pt-archiver (+2/-2)
bin/pt-config-diff (+2/-2)
bin/pt-deadlock-logger (+2/-2)
bin/pt-diskstats (+2/-2)
bin/pt-duplicate-key-checker (+2/-2)
bin/pt-fifo-split (+2/-2)
bin/pt-find (+2/-2)
bin/pt-fingerprint (+2/-2)
bin/pt-fk-error-logger (+2/-2)
bin/pt-heartbeat (+2/-2)
bin/pt-index-usage (+2/-2)
bin/pt-kill (+2/-2)
bin/pt-online-schema-change (+2/-2)
bin/pt-query-digest (+2/-2)
bin/pt-show-grants (+2/-2)
bin/pt-slave-delay (+2/-2)
bin/pt-slave-find (+2/-2)
bin/pt-slave-restart (+2/-2)
bin/pt-table-checksum (+2/-2)
bin/pt-table-sync (+2/-2)
bin/pt-table-usage (+2/-2)
bin/pt-upgrade (+2/-2)
bin/pt-variable-advisor (+2/-2)
bin/pt-visual-explain (+2/-2)
lib/OptionParser.pm (+2/-2)
t/lib/OptionParser.t (+42/-0)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-set-vars-bug-1182856
Reviewer Review Type Date Requested Status
Daniel Nichter Approve on 2013-06-25
Review via email: mp+171429@code.launchpad.net
To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/pt-agent'
--- bin/pt-agent 2013-06-17 07:08:46 +0000
+++ bin/pt-agent 2013-06-25 22:36:25 +0000
@@ -3560,7 +3560,7 @@
3560 if ( $user_vars ) {3560 if ( $user_vars ) {
3561 foreach my $var_val ( @$user_vars ) {3561 foreach my $var_val ( @$user_vars ) {
3562 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;3562 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
3563 die "Invalid --set-vars value: $var_val\n" unless $var && $val;3563 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
3564 $user_vars{$var} = {3564 $user_vars{$var} = {
3565 val => $val,3565 val => $val,
3566 default => 0,3566 default => 0,
@@ -3574,7 +3574,7 @@
3574 %default_vars = map {3574 %default_vars = map {
3575 my $var_val = $_;3575 my $var_val = $_;
3576 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;3576 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
3577 die "Invalid --set-vars value: $var_val\n" unless $var && $val;3577 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
3578 $var => {3578 $var => {
3579 val => $val,3579 val => $val,
3580 default => 1,3580 default => 1,
35813581
=== modified file 'bin/pt-align'
--- bin/pt-align 2013-06-17 07:08:46 +0000
+++ bin/pt-align 2013-06-25 22:36:25 +0000
@@ -1028,7 +1028,7 @@
1028 if ( $user_vars ) {1028 if ( $user_vars ) {
1029 foreach my $var_val ( @$user_vars ) {1029 foreach my $var_val ( @$user_vars ) {
1030 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1030 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1031 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1031 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1032 $user_vars{$var} = {1032 $user_vars{$var} = {
1033 val => $val,1033 val => $val,
1034 default => 0,1034 default => 0,
@@ -1042,7 +1042,7 @@
1042 %default_vars = map {1042 %default_vars = map {
1043 my $var_val = $_;1043 my $var_val = $_;
1044 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1044 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1045 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1045 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1046 $var => {1046 $var => {
1047 val => $val,1047 val => $val,
1048 default => 1,1048 default => 1,
10491049
=== modified file 'bin/pt-archiver'
--- bin/pt-archiver 2013-06-17 07:08:46 +0000
+++ bin/pt-archiver 2013-06-25 22:36:25 +0000
@@ -1755,7 +1755,7 @@
1755 if ( $user_vars ) {1755 if ( $user_vars ) {
1756 foreach my $var_val ( @$user_vars ) {1756 foreach my $var_val ( @$user_vars ) {
1757 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1757 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1758 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1758 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1759 $user_vars{$var} = {1759 $user_vars{$var} = {
1760 val => $val,1760 val => $val,
1761 default => 0,1761 default => 0,
@@ -1769,7 +1769,7 @@
1769 %default_vars = map {1769 %default_vars = map {
1770 my $var_val = $_;1770 my $var_val = $_;
1771 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1771 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1772 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1772 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1773 $var => {1773 $var => {
1774 val => $val,1774 val => $val,
1775 default => 1,1775 default => 1,
17761776
=== modified file 'bin/pt-config-diff'
--- bin/pt-config-diff 2013-06-17 07:08:46 +0000
+++ bin/pt-config-diff 2013-06-25 22:36:25 +0000
@@ -1755,7 +1755,7 @@
1755 if ( $user_vars ) {1755 if ( $user_vars ) {
1756 foreach my $var_val ( @$user_vars ) {1756 foreach my $var_val ( @$user_vars ) {
1757 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1757 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1758 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1758 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1759 $user_vars{$var} = {1759 $user_vars{$var} = {
1760 val => $val,1760 val => $val,
1761 default => 0,1761 default => 0,
@@ -1769,7 +1769,7 @@
1769 %default_vars = map {1769 %default_vars = map {
1770 my $var_val = $_;1770 my $var_val = $_;
1771 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1771 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1772 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1772 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1773 $var => {1773 $var => {
1774 val => $val,1774 val => $val,
1775 default => 1,1775 default => 1,
17761776
=== modified file 'bin/pt-deadlock-logger'
--- bin/pt-deadlock-logger 2013-06-17 07:08:46 +0000
+++ bin/pt-deadlock-logger 2013-06-25 22:36:25 +0000
@@ -1105,7 +1105,7 @@
1105 if ( $user_vars ) {1105 if ( $user_vars ) {
1106 foreach my $var_val ( @$user_vars ) {1106 foreach my $var_val ( @$user_vars ) {
1107 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1107 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1108 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1108 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1109 $user_vars{$var} = {1109 $user_vars{$var} = {
1110 val => $val,1110 val => $val,
1111 default => 0,1111 default => 0,
@@ -1119,7 +1119,7 @@
1119 %default_vars = map {1119 %default_vars = map {
1120 my $var_val = $_;1120 my $var_val = $_;
1121 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1121 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1122 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1122 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1123 $var => {1123 $var => {
1124 val => $val,1124 val => $val,
1125 default => 1,1125 default => 1,
11261126
=== modified file 'bin/pt-diskstats'
--- bin/pt-diskstats 2013-06-17 07:08:46 +0000
+++ bin/pt-diskstats 2013-06-25 22:36:25 +0000
@@ -1101,7 +1101,7 @@
1101 if ( $user_vars ) {1101 if ( $user_vars ) {
1102 foreach my $var_val ( @$user_vars ) {1102 foreach my $var_val ( @$user_vars ) {
1103 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1103 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1104 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1104 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1105 $user_vars{$var} = {1105 $user_vars{$var} = {
1106 val => $val,1106 val => $val,
1107 default => 0,1107 default => 0,
@@ -1115,7 +1115,7 @@
1115 %default_vars = map {1115 %default_vars = map {
1116 my $var_val = $_;1116 my $var_val = $_;
1117 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1117 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1118 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1118 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1119 $var => {1119 $var => {
1120 val => $val,1120 val => $val,
1121 default => 1,1121 default => 1,
11221122
=== modified file 'bin/pt-duplicate-key-checker'
--- bin/pt-duplicate-key-checker 2013-06-17 07:08:46 +0000
+++ bin/pt-duplicate-key-checker 2013-06-25 22:36:25 +0000
@@ -2087,7 +2087,7 @@
2087 if ( $user_vars ) {2087 if ( $user_vars ) {
2088 foreach my $var_val ( @$user_vars ) {2088 foreach my $var_val ( @$user_vars ) {
2089 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;2089 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
2090 die "Invalid --set-vars value: $var_val\n" unless $var && $val;2090 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
2091 $user_vars{$var} = {2091 $user_vars{$var} = {
2092 val => $val,2092 val => $val,
2093 default => 0,2093 default => 0,
@@ -2101,7 +2101,7 @@
2101 %default_vars = map {2101 %default_vars = map {
2102 my $var_val = $_;2102 my $var_val = $_;
2103 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;2103 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
2104 die "Invalid --set-vars value: $var_val\n" unless $var && $val;2104 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
2105 $var => {2105 $var => {
2106 val => $val,2106 val => $val,
2107 default => 1,2107 default => 1,
21082108
=== modified file 'bin/pt-fifo-split'
--- bin/pt-fifo-split 2013-06-17 07:08:46 +0000
+++ bin/pt-fifo-split 2013-06-25 22:36:25 +0000
@@ -1029,7 +1029,7 @@
1029 if ( $user_vars ) {1029 if ( $user_vars ) {
1030 foreach my $var_val ( @$user_vars ) {1030 foreach my $var_val ( @$user_vars ) {
1031 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1031 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1032 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1032 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1033 $user_vars{$var} = {1033 $user_vars{$var} = {
1034 val => $val,1034 val => $val,
1035 default => 0,1035 default => 0,
@@ -1043,7 +1043,7 @@
1043 %default_vars = map {1043 %default_vars = map {
1044 my $var_val = $_;1044 my $var_val = $_;
1045 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1045 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1046 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1046 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1047 $var => {1047 $var => {
1048 val => $val,1048 val => $val,
1049 default => 1,1049 default => 1,
10501050
=== modified file 'bin/pt-find'
--- bin/pt-find 2013-06-17 07:08:46 +0000
+++ bin/pt-find 2013-06-25 22:36:25 +0000
@@ -1521,7 +1521,7 @@
1521 if ( $user_vars ) {1521 if ( $user_vars ) {
1522 foreach my $var_val ( @$user_vars ) {1522 foreach my $var_val ( @$user_vars ) {
1523 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1523 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1524 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1524 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1525 $user_vars{$var} = {1525 $user_vars{$var} = {
1526 val => $val,1526 val => $val,
1527 default => 0,1527 default => 0,
@@ -1535,7 +1535,7 @@
1535 %default_vars = map {1535 %default_vars = map {
1536 my $var_val = $_;1536 my $var_val = $_;
1537 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1537 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1538 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1538 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1539 $var => {1539 $var => {
1540 val => $val,1540 val => $val,
1541 default => 1,1541 default => 1,
15421542
=== modified file 'bin/pt-fingerprint'
--- bin/pt-fingerprint 2013-06-17 07:08:46 +0000
+++ bin/pt-fingerprint 2013-06-25 22:36:25 +0000
@@ -1030,7 +1030,7 @@
1030 if ( $user_vars ) {1030 if ( $user_vars ) {
1031 foreach my $var_val ( @$user_vars ) {1031 foreach my $var_val ( @$user_vars ) {
1032 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1032 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1033 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1033 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1034 $user_vars{$var} = {1034 $user_vars{$var} = {
1035 val => $val,1035 val => $val,
1036 default => 0,1036 default => 0,
@@ -1044,7 +1044,7 @@
1044 %default_vars = map {1044 %default_vars = map {
1045 my $var_val = $_;1045 my $var_val = $_;
1046 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1046 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1047 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1047 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1048 $var => {1048 $var => {
1049 val => $val,1049 val => $val,
1050 default => 1,1050 default => 1,
10511051
=== modified file 'bin/pt-fk-error-logger'
--- bin/pt-fk-error-logger 2013-06-17 07:08:46 +0000
+++ bin/pt-fk-error-logger 2013-06-25 22:36:25 +0000
@@ -1100,7 +1100,7 @@
1100 if ( $user_vars ) {1100 if ( $user_vars ) {
1101 foreach my $var_val ( @$user_vars ) {1101 foreach my $var_val ( @$user_vars ) {
1102 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1102 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1103 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1103 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1104 $user_vars{$var} = {1104 $user_vars{$var} = {
1105 val => $val,1105 val => $val,
1106 default => 0,1106 default => 0,
@@ -1114,7 +1114,7 @@
1114 %default_vars = map {1114 %default_vars = map {
1115 my $var_val = $_;1115 my $var_val = $_;
1116 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1116 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1117 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1117 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1118 $var => {1118 $var => {
1119 val => $val,1119 val => $val,
1120 default => 1,1120 default => 1,
11211121
=== modified file 'bin/pt-heartbeat'
--- bin/pt-heartbeat 2013-06-17 07:08:46 +0000
+++ bin/pt-heartbeat 2013-06-25 22:36:25 +0000
@@ -1837,7 +1837,7 @@
1837 if ( $user_vars ) {1837 if ( $user_vars ) {
1838 foreach my $var_val ( @$user_vars ) {1838 foreach my $var_val ( @$user_vars ) {
1839 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1839 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1840 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1840 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1841 $user_vars{$var} = {1841 $user_vars{$var} = {
1842 val => $val,1842 val => $val,
1843 default => 0,1843 default => 0,
@@ -1851,7 +1851,7 @@
1851 %default_vars = map {1851 %default_vars = map {
1852 my $var_val = $_;1852 my $var_val = $_;
1853 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1853 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1854 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1854 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1855 $var => {1855 $var => {
1856 val => $val,1856 val => $val,
1857 default => 1,1857 default => 1,
18581858
=== modified file 'bin/pt-index-usage'
--- bin/pt-index-usage 2013-06-17 07:08:46 +0000
+++ bin/pt-index-usage 2013-06-25 22:36:25 +0000
@@ -1682,7 +1682,7 @@
1682 if ( $user_vars ) {1682 if ( $user_vars ) {
1683 foreach my $var_val ( @$user_vars ) {1683 foreach my $var_val ( @$user_vars ) {
1684 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1684 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1685 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1685 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1686 $user_vars{$var} = {1686 $user_vars{$var} = {
1687 val => $val,1687 val => $val,
1688 default => 0,1688 default => 0,
@@ -1696,7 +1696,7 @@
1696 %default_vars = map {1696 %default_vars = map {
1697 my $var_val = $_;1697 my $var_val = $_;
1698 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1698 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1699 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1699 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1700 $var => {1700 $var => {
1701 val => $val,1701 val => $val,
1702 default => 1,1702 default => 1,
17031703
=== modified file 'bin/pt-kill'
--- bin/pt-kill 2013-06-17 07:08:46 +0000
+++ bin/pt-kill 2013-06-25 22:36:25 +0000
@@ -1110,7 +1110,7 @@
1110 if ( $user_vars ) {1110 if ( $user_vars ) {
1111 foreach my $var_val ( @$user_vars ) {1111 foreach my $var_val ( @$user_vars ) {
1112 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1112 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1113 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1113 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1114 $user_vars{$var} = {1114 $user_vars{$var} = {
1115 val => $val,1115 val => $val,
1116 default => 0,1116 default => 0,
@@ -1124,7 +1124,7 @@
1124 %default_vars = map {1124 %default_vars = map {
1125 my $var_val = $_;1125 my $var_val = $_;
1126 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1126 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1127 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1127 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1128 $var => {1128 $var => {
1129 val => $val,1129 val => $val,
1130 default => 1,1130 default => 1,
11311131
=== modified file 'bin/pt-online-schema-change'
--- bin/pt-online-schema-change 2013-06-25 19:52:03 +0000
+++ bin/pt-online-schema-change 2013-06-25 22:36:25 +0000
@@ -1117,7 +1117,7 @@
1117 if ( $user_vars ) {1117 if ( $user_vars ) {
1118 foreach my $var_val ( @$user_vars ) {1118 foreach my $var_val ( @$user_vars ) {
1119 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1119 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1120 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1120 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1121 $user_vars{$var} = {1121 $user_vars{$var} = {
1122 val => $val,1122 val => $val,
1123 default => 0,1123 default => 0,
@@ -1131,7 +1131,7 @@
1131 %default_vars = map {1131 %default_vars = map {
1132 my $var_val = $_;1132 my $var_val = $_;
1133 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1133 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1134 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1134 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1135 $var => {1135 $var => {
1136 val => $val,1136 val => $val,
1137 default => 1,1137 default => 1,
11381138
=== modified file 'bin/pt-query-digest'
--- bin/pt-query-digest 2013-06-17 07:08:46 +0000
+++ bin/pt-query-digest 2013-06-25 22:36:25 +0000
@@ -2350,7 +2350,7 @@
2350 if ( $user_vars ) {2350 if ( $user_vars ) {
2351 foreach my $var_val ( @$user_vars ) {2351 foreach my $var_val ( @$user_vars ) {
2352 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;2352 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
2353 die "Invalid --set-vars value: $var_val\n" unless $var && $val;2353 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
2354 $user_vars{$var} = {2354 $user_vars{$var} = {
2355 val => $val,2355 val => $val,
2356 default => 0,2356 default => 0,
@@ -2364,7 +2364,7 @@
2364 %default_vars = map {2364 %default_vars = map {
2365 my $var_val = $_;2365 my $var_val = $_;
2366 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;2366 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
2367 die "Invalid --set-vars value: $var_val\n" unless $var && $val;2367 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
2368 $var => {2368 $var => {
2369 val => $val,2369 val => $val,
2370 default => 1,2370 default => 1,
23712371
=== modified file 'bin/pt-show-grants'
--- bin/pt-show-grants 2013-06-17 07:08:46 +0000
+++ bin/pt-show-grants 2013-06-25 22:36:25 +0000
@@ -1030,7 +1030,7 @@
1030 if ( $user_vars ) {1030 if ( $user_vars ) {
1031 foreach my $var_val ( @$user_vars ) {1031 foreach my $var_val ( @$user_vars ) {
1032 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1032 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1033 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1033 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1034 $user_vars{$var} = {1034 $user_vars{$var} = {
1035 val => $val,1035 val => $val,
1036 default => 0,1036 default => 0,
@@ -1044,7 +1044,7 @@
1044 %default_vars = map {1044 %default_vars = map {
1045 my $var_val = $_;1045 my $var_val = $_;
1046 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1046 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1047 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1047 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1048 $var => {1048 $var => {
1049 val => $val,1049 val => $val,
1050 default => 1,1050 default => 1,
10511051
=== modified file 'bin/pt-slave-delay'
--- bin/pt-slave-delay 2013-06-17 07:08:46 +0000
+++ bin/pt-slave-delay 2013-06-25 22:36:25 +0000
@@ -1103,7 +1103,7 @@
1103 if ( $user_vars ) {1103 if ( $user_vars ) {
1104 foreach my $var_val ( @$user_vars ) {1104 foreach my $var_val ( @$user_vars ) {
1105 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1105 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1106 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1106 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1107 $user_vars{$var} = {1107 $user_vars{$var} = {
1108 val => $val,1108 val => $val,
1109 default => 0,1109 default => 0,
@@ -1117,7 +1117,7 @@
1117 %default_vars = map {1117 %default_vars = map {
1118 my $var_val = $_;1118 my $var_val = $_;
1119 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1119 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1120 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1120 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1121 $var => {1121 $var => {
1122 val => $val,1122 val => $val,
1123 default => 1,1123 default => 1,
11241124
=== modified file 'bin/pt-slave-find'
--- bin/pt-slave-find 2013-06-17 07:08:46 +0000
+++ bin/pt-slave-find 2013-06-25 22:36:25 +0000
@@ -1038,7 +1038,7 @@
1038 if ( $user_vars ) {1038 if ( $user_vars ) {
1039 foreach my $var_val ( @$user_vars ) {1039 foreach my $var_val ( @$user_vars ) {
1040 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1040 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1041 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1041 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1042 $user_vars{$var} = {1042 $user_vars{$var} = {
1043 val => $val,1043 val => $val,
1044 default => 0,1044 default => 0,
@@ -1052,7 +1052,7 @@
1052 %default_vars = map {1052 %default_vars = map {
1053 my $var_val = $_;1053 my $var_val = $_;
1054 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1054 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1055 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1055 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1056 $var => {1056 $var => {
1057 val => $val,1057 val => $val,
1058 default => 1,1058 default => 1,
10591059
=== modified file 'bin/pt-slave-restart'
--- bin/pt-slave-restart 2013-06-17 07:08:46 +0000
+++ bin/pt-slave-restart 2013-06-25 22:36:25 +0000
@@ -1255,7 +1255,7 @@
1255 if ( $user_vars ) {1255 if ( $user_vars ) {
1256 foreach my $var_val ( @$user_vars ) {1256 foreach my $var_val ( @$user_vars ) {
1257 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1257 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1258 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1258 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1259 $user_vars{$var} = {1259 $user_vars{$var} = {
1260 val => $val,1260 val => $val,
1261 default => 0,1261 default => 0,
@@ -1269,7 +1269,7 @@
1269 %default_vars = map {1269 %default_vars = map {
1270 my $var_val = $_;1270 my $var_val = $_;
1271 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1271 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1272 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1272 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1273 $var => {1273 $var => {
1274 val => $val,1274 val => $val,
1275 default => 1,1275 default => 1,
12761276
=== modified file 'bin/pt-table-checksum'
--- bin/pt-table-checksum 2013-06-17 07:08:46 +0000
+++ bin/pt-table-checksum 2013-06-25 22:36:25 +0000
@@ -2784,7 +2784,7 @@
2784 if ( $user_vars ) {2784 if ( $user_vars ) {
2785 foreach my $var_val ( @$user_vars ) {2785 foreach my $var_val ( @$user_vars ) {
2786 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;2786 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
2787 die "Invalid --set-vars value: $var_val\n" unless $var && $val;2787 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
2788 $user_vars{$var} = {2788 $user_vars{$var} = {
2789 val => $val,2789 val => $val,
2790 default => 0,2790 default => 0,
@@ -2798,7 +2798,7 @@
2798 %default_vars = map {2798 %default_vars = map {
2799 my $var_val = $_;2799 my $var_val = $_;
2800 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;2800 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
2801 die "Invalid --set-vars value: $var_val\n" unless $var && $val;2801 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
2802 $var => {2802 $var => {
2803 val => $val,2803 val => $val,
2804 default => 1,2804 default => 1,
28052805
=== modified file 'bin/pt-table-sync'
--- bin/pt-table-sync 2013-06-17 07:08:46 +0000
+++ bin/pt-table-sync 2013-06-25 22:36:25 +0000
@@ -1118,7 +1118,7 @@
1118 if ( $user_vars ) {1118 if ( $user_vars ) {
1119 foreach my $var_val ( @$user_vars ) {1119 foreach my $var_val ( @$user_vars ) {
1120 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1120 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1121 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1121 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1122 $user_vars{$var} = {1122 $user_vars{$var} = {
1123 val => $val,1123 val => $val,
1124 default => 0,1124 default => 0,
@@ -1132,7 +1132,7 @@
1132 %default_vars = map {1132 %default_vars = map {
1133 my $var_val = $_;1133 my $var_val = $_;
1134 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1134 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1135 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1135 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1136 $var => {1136 $var => {
1137 val => $val,1137 val => $val,
1138 default => 1,1138 default => 1,
11391139
=== modified file 'bin/pt-table-usage'
--- bin/pt-table-usage 2013-06-17 07:08:46 +0000
+++ bin/pt-table-usage 2013-06-25 22:36:25 +0000
@@ -1467,7 +1467,7 @@
1467 if ( $user_vars ) {1467 if ( $user_vars ) {
1468 foreach my $var_val ( @$user_vars ) {1468 foreach my $var_val ( @$user_vars ) {
1469 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1469 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1470 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1470 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1471 $user_vars{$var} = {1471 $user_vars{$var} = {
1472 val => $val,1472 val => $val,
1473 default => 0,1473 default => 0,
@@ -1481,7 +1481,7 @@
1481 %default_vars = map {1481 %default_vars = map {
1482 my $var_val = $_;1482 my $var_val = $_;
1483 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1483 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1484 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1484 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1485 $var => {1485 $var => {
1486 val => $val,1486 val => $val,
1487 default => 1,1487 default => 1,
14881488
=== modified file 'bin/pt-upgrade'
--- bin/pt-upgrade 2013-06-17 07:08:46 +0000
+++ bin/pt-upgrade 2013-06-25 22:36:25 +0000
@@ -2347,7 +2347,7 @@
2347 if ( $user_vars ) {2347 if ( $user_vars ) {
2348 foreach my $var_val ( @$user_vars ) {2348 foreach my $var_val ( @$user_vars ) {
2349 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;2349 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
2350 die "Invalid --set-vars value: $var_val\n" unless $var && $val;2350 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
2351 $user_vars{$var} = {2351 $user_vars{$var} = {
2352 val => $val,2352 val => $val,
2353 default => 0,2353 default => 0,
@@ -2361,7 +2361,7 @@
2361 %default_vars = map {2361 %default_vars = map {
2362 my $var_val = $_;2362 my $var_val = $_;
2363 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;2363 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
2364 die "Invalid --set-vars value: $var_val\n" unless $var && $val;2364 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
2365 $var => {2365 $var => {
2366 val => $val,2366 val => $val,
2367 default => 1,2367 default => 1,
23682368
=== modified file 'bin/pt-variable-advisor'
--- bin/pt-variable-advisor 2013-06-17 07:08:46 +0000
+++ bin/pt-variable-advisor 2013-06-25 22:36:25 +0000
@@ -1107,7 +1107,7 @@
1107 if ( $user_vars ) {1107 if ( $user_vars ) {
1108 foreach my $var_val ( @$user_vars ) {1108 foreach my $var_val ( @$user_vars ) {
1109 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1109 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1110 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1110 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1111 $user_vars{$var} = {1111 $user_vars{$var} = {
1112 val => $val,1112 val => $val,
1113 default => 0,1113 default => 0,
@@ -1121,7 +1121,7 @@
1121 %default_vars = map {1121 %default_vars = map {
1122 my $var_val = $_;1122 my $var_val = $_;
1123 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1123 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1124 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1124 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1125 $var => {1125 $var => {
1126 val => $val,1126 val => $val,
1127 default => 1,1127 default => 1,
11281128
=== modified file 'bin/pt-visual-explain'
--- bin/pt-visual-explain 2013-06-17 07:08:46 +0000
+++ bin/pt-visual-explain 2013-06-25 22:36:25 +0000
@@ -1704,7 +1704,7 @@
1704 if ( $user_vars ) {1704 if ( $user_vars ) {
1705 foreach my $var_val ( @$user_vars ) {1705 foreach my $var_val ( @$user_vars ) {
1706 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1706 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1707 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1707 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1708 $user_vars{$var} = {1708 $user_vars{$var} = {
1709 val => $val,1709 val => $val,
1710 default => 0,1710 default => 0,
@@ -1718,7 +1718,7 @@
1718 %default_vars = map {1718 %default_vars = map {
1719 my $var_val = $_;1719 my $var_val = $_;
1720 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1720 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1721 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1721 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1722 $var => {1722 $var => {
1723 val => $val,1723 val => $val,
1724 default => 1,1724 default => 1,
17251725
=== modified file 'lib/OptionParser.pm'
--- lib/OptionParser.pm 2013-02-28 01:47:00 +0000
+++ lib/OptionParser.pm 2013-06-25 22:36:25 +0000
@@ -1289,7 +1289,7 @@
1289 if ( $user_vars ) {1289 if ( $user_vars ) {
1290 foreach my $var_val ( @$user_vars ) {1290 foreach my $var_val ( @$user_vars ) {
1291 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1291 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1292 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1292 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1293 $user_vars{$var} = {1293 $user_vars{$var} = {
1294 val => $val,1294 val => $val,
1295 default => 0,1295 default => 0,
@@ -1303,7 +1303,7 @@
1303 %default_vars = map {1303 %default_vars = map {
1304 my $var_val = $_;1304 my $var_val = $_;
1305 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;1305 my ($var, $val) = $var_val =~ m/([^\s=]+)=(\S+)/;
1306 die "Invalid --set-vars value: $var_val\n" unless $var && $val;1306 die "Invalid --set-vars value: $var_val\n" unless $var && defined $val;
1307 $var => {1307 $var => {
1308 val => $val,1308 val => $val,
1309 default => 1,1309 default => 1,
13101310
=== modified file 't/lib/OptionParser.t'
--- t/lib/OptionParser.t 2013-03-13 18:38:45 +0000
+++ t/lib/OptionParser.t 2013-06-25 22:36:25 +0000
@@ -2021,6 +2021,48 @@
2021 "Non-zero exit status on error parsing options (bug 1039074)"2021 "Non-zero exit status on error parsing options (bug 1039074)"
2022);2022);
20232023
2024
2025# #############################################################################
2026# --set-vars/set_vars()
2027# #############################################################################
2028
2029@ARGV = qw();
2030$o = new OptionParser(file => "$trunk/bin/pt-archiver");
2031$o->get_specs();
2032$o->get_opts();
2033
2034my $vars = $o->set_vars("$trunk/bin/pt-archiver");
2035is_deeply(
2036 $vars,
2037 {
2038 wait_timeout => {
2039 default => 1,
2040 val => '10000',
2041 },
2042 },
2043 "set_vars(): 1 default from docs"
2044) or diag(Dumper($vars));
2045
2046# Bug 1182856: Zero values causes "Invalid --set-vars value: var=0"
2047@ARGV = qw(--set-vars SQL_LOG_BIN=0);
2048$o->get_opts();
2049
2050$vars = $o->set_vars("$trunk/bin/pt-archiver");
2051is_deeply(
2052 $vars,
2053 {
2054 wait_timeout => {
2055 default => 1,
2056 val => '10000',
2057 },
2058 SQL_LOG_BIN => {
2059 default => 0,
2060 val => '0',
2061 },
2062 },
2063 "set_vars(): var=0 (bug 1182856)"
2064) or diag(Dumper($vars));
2065
2024# #############################################################################2066# #############################################################################
2025# Done.2067# Done.
2026# #############################################################################2068# #############################################################################

Subscribers

People subscribed via source and target branches

to all changes: