Merge lp:~percona-toolkit-dev/percona-toolkit/fix-pt-archiver-dry-run-bug-1199589 into lp:percona-toolkit/2.2

Proposed by Daniel Nichter on 2013-08-08
Status: Merged
Approved by: Daniel Nichter on 2013-08-13
Approved revision: 603
Merged at revision: 589
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/fix-pt-archiver-dry-run-bug-1199589
Merge into: lp:percona-toolkit/2.2
Diff against target: 2437 lines (+766/-367)
53 files modified
Changelog (+2/-0)
Makefile.PL (+1/-1)
bin/pt-agent (+12/-2)
bin/pt-align (+12/-2)
bin/pt-archiver (+12/-2)
bin/pt-config-diff (+12/-2)
bin/pt-deadlock-logger (+12/-2)
bin/pt-diskstats (+12/-2)
bin/pt-duplicate-key-checker (+12/-2)
bin/pt-fifo-split (+12/-2)
bin/pt-find (+12/-2)
bin/pt-fingerprint (+12/-2)
bin/pt-fk-error-logger (+12/-2)
bin/pt-heartbeat (+12/-2)
bin/pt-index-usage (+12/-2)
bin/pt-ioprofile (+28/-24)
bin/pt-kill (+12/-2)
bin/pt-mext (+1/-1)
bin/pt-mysql-summary (+28/-24)
bin/pt-online-schema-change (+12/-2)
bin/pt-pmp (+28/-24)
bin/pt-query-digest (+12/-2)
bin/pt-show-grants (+12/-2)
bin/pt-sift (+28/-24)
bin/pt-slave-delay (+12/-2)
bin/pt-slave-find (+12/-2)
bin/pt-slave-restart (+12/-2)
bin/pt-stalk (+28/-24)
bin/pt-summary (+28/-24)
bin/pt-table-checksum (+12/-2)
bin/pt-table-sync (+12/-2)
bin/pt-table-usage (+12/-2)
bin/pt-upgrade (+12/-2)
bin/pt-variable-advisor (+12/-2)
bin/pt-visual-explain (+12/-2)
lib/OptionParser.pm (+12/-1)
lib/PerconaTest.pm (+14/-0)
lib/VariableAdvisorRules.pm (+1/-0)
lib/bash/parse_options.sh (+27/-23)
t/lib/Daemon.t (+58/-52)
t/lib/OptionParser.t (+54/-0)
t/lib/Percona/Toolkit.t (+2/-1)
t/lib/Percona/WebAPI/Client.t (+2/-1)
t/lib/QueryReportFormatter.t (+2/-2)
t/lib/VariableAdvisorRules.t (+1/-0)
t/lib/VersionCheck.t (+1/-0)
t/pt-archiver/bugs.t (+56/-0)
t/pt-diskstats/expected/all_int_bug-1035311.txt (+0/-31)
t/pt-diskstats/expected/disk_int_bug-1035311.txt (+0/-3)
t/pt-diskstats/expected/sample_int_bug-1035311.txt (+0/-3)
t/pt-diskstats/pt-diskstats.t (+50/-51)
t/pt-mext/pt-mext.t (+2/-0)
t/pt-stalk/pt-stalk.t (+0/-1)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-pt-archiver-dry-run-bug-1199589
Reviewer Review Type Date Requested Status
Daniel Nichter Approve on 2013-08-13
Review via email: mp+179086@code.launchpad.net
To post a comment you must log in.
593. By Daniel Nichter on 2013-08-08

Fix VariableAdvisorRules: test didn't pass mysql_version and rule didn't check if it's defined.

594. By Daniel Nichter on 2013-08-08

Fix t/lib/Percona/Toolkit.t.

595. By Daniel Nichter on 2013-08-08

Bump version 2.2.3 to 2.2.4 in tools, Changelog, and Makefile.PL. This went missing from 2.2.4 release.

596. By Daniel Nichter on 2013-08-08

Fix t/lib/Percona/Toolkit.t and t/lib/Percona/WebAPI/Client.t.

597. By Daniel Nichter on 2013-08-08

Fix t/lib/VersionCheck.t.

598. By Daniel Nichter on 2013-08-08

Fix t/lib/QueryReportFormatter.t

599. By Daniel Nichter on 2013-08-08

Fix sorting of results for t/pt-mext/pt-mext.t.

600. By Daniel Nichter on 2013-08-09

Clean up t/pt-diskstats/pt-diskstats.t and update samples: I'm guessing the diff is just cosmetic since no data has changed.

601. By Daniel Nichter on 2013-08-11

Fix fix-daemon-tests.

602. By Daniel Nichter on 2013-08-11

Merge latest.

603. By Daniel Nichter on 2013-08-13

Remove debug stuff from pt-stalk.t

review: Approve
Daniel Nichter (daniel-nichter) wrote :

This branch fixes several things:

1) OptionParser.pm so string opts can't consume the next op
2) parse_options to fix a false-positive test failure: "cat: write error: broken pipe"
3) Makes Daemon.t more reliable
4) Add PerconaTest::get_cmd_pid()
5) Applies 2.2.4 version bumps forgotten in the release
6) Fixes some false-positive pt-diskstat.t failures

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Changelog'
2--- Changelog 2013-07-15 21:32:00 +0000
3+++ Changelog 2013-08-13 03:46:05 +0000
4@@ -1,5 +1,7 @@
5 Changelog for Percona Toolkit
6
7+v2.2.4 released 2013-07-18
8+
9 * Implemented pt-query-digest anonymous JSON output
10 * Implemented pt-online-schema-change timestamp output
11 * Fixed bug 1182856: Zero values causes "Invalid --set-vars value: var=0"
12
13=== modified file 'Makefile.PL'
14--- Makefile.PL 2013-06-17 07:08:46 +0000
15+++ Makefile.PL 2013-08-13 03:46:05 +0000
16@@ -2,7 +2,7 @@
17
18 WriteMakefile(
19 NAME => 'percona-toolkit',
20- VERSION => '2.2.3',
21+ VERSION => '2.2.4',
22 EXE_FILES => [ <bin/*> ],
23 MAN1PODS => {
24 'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p',
25
26=== modified file 'bin/pt-agent'
27--- bin/pt-agent 2013-08-03 21:28:04 +0000
28+++ bin/pt-agent 2013-08-13 03:46:05 +0000
29@@ -2963,11 +2963,21 @@
30 my $long = exists $self->{opts}->{$opt} ? $opt
31 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
32 : die "Getopt::Long gave a nonexistent option: $opt";
33-
34 $opt = $self->{opts}->{$long};
35 if ( $opt->{is_cumulative} ) {
36 $opt->{value}++;
37 }
38+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
39+ my $next_opt = $1;
40+ if ( exists $self->{opts}->{$next_opt}
41+ || exists $self->{short_opts}->{$next_opt} ) {
42+ $self->save_error("--$long requires a string value");
43+ return;
44+ }
45+ else {
46+ $opt->{value} = $val;
47+ }
48+ }
49 else {
50 $opt->{value} = $val;
51 }
52@@ -9381,6 +9391,6 @@
53
54 =head1 VERSION
55
56-pt-agent 2.2.3
57+pt-agent 2.2.4
58
59 =cut
60
61=== modified file 'bin/pt-align'
62--- bin/pt-align 2013-06-25 22:32:19 +0000
63+++ bin/pt-align 2013-08-13 03:46:05 +0000
64@@ -431,11 +431,21 @@
65 my $long = exists $self->{opts}->{$opt} ? $opt
66 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
67 : die "Getopt::Long gave a nonexistent option: $opt";
68-
69 $opt = $self->{opts}->{$long};
70 if ( $opt->{is_cumulative} ) {
71 $opt->{value}++;
72 }
73+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
74+ my $next_opt = $1;
75+ if ( exists $self->{opts}->{$next_opt}
76+ || exists $self->{short_opts}->{$next_opt} ) {
77+ $self->save_error("--$long requires a string value");
78+ return;
79+ }
80+ else {
81+ $opt->{value} = $val;
82+ }
83+ }
84 else {
85 $opt->{value} = $val;
86 }
87@@ -1313,6 +1323,6 @@
88
89 =head1 VERSION
90
91-pt-align 2.2.3
92+pt-align 2.2.4
93
94 =cut
95
96=== modified file 'bin/pt-archiver'
97--- bin/pt-archiver 2013-07-17 19:41:00 +0000
98+++ bin/pt-archiver 2013-08-13 03:46:05 +0000
99@@ -1158,11 +1158,21 @@
100 my $long = exists $self->{opts}->{$opt} ? $opt
101 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
102 : die "Getopt::Long gave a nonexistent option: $opt";
103-
104 $opt = $self->{opts}->{$long};
105 if ( $opt->{is_cumulative} ) {
106 $opt->{value}++;
107 }
108+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
109+ my $next_opt = $1;
110+ if ( exists $self->{opts}->{$next_opt}
111+ || exists $self->{short_opts}->{$next_opt} ) {
112+ $self->save_error("--$long requires a string value");
113+ return;
114+ }
115+ else {
116+ $opt->{value} = $val;
117+ }
118+ }
119 else {
120 $opt->{value} = $val;
121 }
122@@ -7899,6 +7909,6 @@
123
124 =head1 VERSION
125
126-pt-archiver 2.2.3
127+pt-archiver 2.2.4
128
129 =cut
130
131=== modified file 'bin/pt-config-diff'
132--- bin/pt-config-diff 2013-07-17 19:41:00 +0000
133+++ bin/pt-config-diff 2013-08-13 03:46:05 +0000
134@@ -1158,11 +1158,21 @@
135 my $long = exists $self->{opts}->{$opt} ? $opt
136 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
137 : die "Getopt::Long gave a nonexistent option: $opt";
138-
139 $opt = $self->{opts}->{$long};
140 if ( $opt->{is_cumulative} ) {
141 $opt->{value}++;
142 }
143+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
144+ my $next_opt = $1;
145+ if ( exists $self->{opts}->{$next_opt}
146+ || exists $self->{short_opts}->{$next_opt} ) {
147+ $self->save_error("--$long requires a string value");
148+ return;
149+ }
150+ else {
151+ $opt->{value} = $val;
152+ }
153+ }
154 else {
155 $opt->{value} = $val;
156 }
157@@ -5740,6 +5750,6 @@
158
159 =head1 VERSION
160
161-pt-config-diff 2.2.3
162+pt-config-diff 2.2.4
163
164 =cut
165
166=== modified file 'bin/pt-deadlock-logger'
167--- bin/pt-deadlock-logger 2013-07-17 19:41:00 +0000
168+++ bin/pt-deadlock-logger 2013-08-13 03:46:05 +0000
169@@ -508,11 +508,21 @@
170 my $long = exists $self->{opts}->{$opt} ? $opt
171 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
172 : die "Getopt::Long gave a nonexistent option: $opt";
173-
174 $opt = $self->{opts}->{$long};
175 if ( $opt->{is_cumulative} ) {
176 $opt->{value}++;
177 }
178+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
179+ my $next_opt = $1;
180+ if ( exists $self->{opts}->{$next_opt}
181+ || exists $self->{short_opts}->{$next_opt} ) {
182+ $self->save_error("--$long requires a string value");
183+ return;
184+ }
185+ else {
186+ $opt->{value} = $val;
187+ }
188+ }
189 else {
190 $opt->{value} = $val;
191 }
192@@ -5518,6 +5528,6 @@
193
194 =head1 VERSION
195
196-pt-deadlock-logger 2.2.3
197+pt-deadlock-logger 2.2.4
198
199 =cut
200
201=== modified file 'bin/pt-diskstats'
202--- bin/pt-diskstats 2013-07-17 19:41:00 +0000
203+++ bin/pt-diskstats 2013-08-13 03:46:05 +0000
204@@ -504,11 +504,21 @@
205 my $long = exists $self->{opts}->{$opt} ? $opt
206 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
207 : die "Getopt::Long gave a nonexistent option: $opt";
208-
209 $opt = $self->{opts}->{$long};
210 if ( $opt->{is_cumulative} ) {
211 $opt->{value}++;
212 }
213+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
214+ my $next_opt = $1;
215+ if ( exists $self->{opts}->{$next_opt}
216+ || exists $self->{short_opts}->{$next_opt} ) {
217+ $self->save_error("--$long requires a string value");
218+ return;
219+ }
220+ else {
221+ $opt->{value} = $val;
222+ }
223+ }
224 else {
225 $opt->{value} = $val;
226 }
227@@ -5586,6 +5596,6 @@
228
229 =head1 VERSION
230
231-pt-diskstats 2.2.3
232+pt-diskstats 2.2.4
233
234 =cut
235
236=== modified file 'bin/pt-duplicate-key-checker'
237--- bin/pt-duplicate-key-checker 2013-07-17 19:41:00 +0000
238+++ bin/pt-duplicate-key-checker 2013-08-13 03:46:05 +0000
239@@ -1490,11 +1490,21 @@
240 my $long = exists $self->{opts}->{$opt} ? $opt
241 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
242 : die "Getopt::Long gave a nonexistent option: $opt";
243-
244 $opt = $self->{opts}->{$long};
245 if ( $opt->{is_cumulative} ) {
246 $opt->{value}++;
247 }
248+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
249+ my $next_opt = $1;
250+ if ( exists $self->{opts}->{$next_opt}
251+ || exists $self->{short_opts}->{$next_opt} ) {
252+ $self->save_error("--$long requires a string value");
253+ return;
254+ }
255+ else {
256+ $opt->{value} = $val;
257+ }
258+ }
259 else {
260 $opt->{value} = $val;
261 }
262@@ -5530,6 +5540,6 @@
263
264 =head1 VERSION
265
266-pt-duplicate-key-checker 2.2.3
267+pt-duplicate-key-checker 2.2.4
268
269 =cut
270
271=== modified file 'bin/pt-fifo-split'
272--- bin/pt-fifo-split 2013-06-25 22:32:19 +0000
273+++ bin/pt-fifo-split 2013-08-13 03:46:05 +0000
274@@ -432,11 +432,21 @@
275 my $long = exists $self->{opts}->{$opt} ? $opt
276 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
277 : die "Getopt::Long gave a nonexistent option: $opt";
278-
279 $opt = $self->{opts}->{$long};
280 if ( $opt->{is_cumulative} ) {
281 $opt->{value}++;
282 }
283+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
284+ my $next_opt = $1;
285+ if ( exists $self->{opts}->{$next_opt}
286+ || exists $self->{short_opts}->{$next_opt} ) {
287+ $self->save_error("--$long requires a string value");
288+ return;
289+ }
290+ else {
291+ $opt->{value} = $val;
292+ }
293+ }
294 else {
295 $opt->{value} = $val;
296 }
297@@ -1602,6 +1612,6 @@
298
299 =head1 VERSION
300
301-pt-fifo-split 2.2.3
302+pt-fifo-split 2.2.4
303
304 =cut
305
306=== modified file 'bin/pt-find'
307--- bin/pt-find 2013-07-17 19:41:00 +0000
308+++ bin/pt-find 2013-08-13 03:46:05 +0000
309@@ -924,11 +924,21 @@
310 my $long = exists $self->{opts}->{$opt} ? $opt
311 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
312 : die "Getopt::Long gave a nonexistent option: $opt";
313-
314 $opt = $self->{opts}->{$long};
315 if ( $opt->{is_cumulative} ) {
316 $opt->{value}++;
317 }
318+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
319+ my $next_opt = $1;
320+ if ( exists $self->{opts}->{$next_opt}
321+ || exists $self->{short_opts}->{$next_opt} ) {
322+ $self->save_error("--$long requires a string value");
323+ return;
324+ }
325+ else {
326+ $opt->{value} = $val;
327+ }
328+ }
329 else {
330 $opt->{value} = $val;
331 }
332@@ -4991,6 +5001,6 @@
333
334 =head1 VERSION
335
336-pt-find 2.2.3
337+pt-find 2.2.4
338
339 =cut
340
341=== modified file 'bin/pt-fingerprint'
342--- bin/pt-fingerprint 2013-06-27 19:06:24 +0000
343+++ bin/pt-fingerprint 2013-08-13 03:46:05 +0000
344@@ -433,11 +433,21 @@
345 my $long = exists $self->{opts}->{$opt} ? $opt
346 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
347 : die "Getopt::Long gave a nonexistent option: $opt";
348-
349 $opt = $self->{opts}->{$long};
350 if ( $opt->{is_cumulative} ) {
351 $opt->{value}++;
352 }
353+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
354+ my $next_opt = $1;
355+ if ( exists $self->{opts}->{$next_opt}
356+ || exists $self->{short_opts}->{$next_opt} ) {
357+ $self->save_error("--$long requires a string value");
358+ return;
359+ }
360+ else {
361+ $opt->{value} = $val;
362+ }
363+ }
364 else {
365 $opt->{value} = $val;
366 }
367@@ -2193,6 +2203,6 @@
368
369 =head1 VERSION
370
371-pt-fingerprint 2.2.3
372+pt-fingerprint 2.2.4
373
374 =cut
375
376=== modified file 'bin/pt-fk-error-logger'
377--- bin/pt-fk-error-logger 2013-07-17 19:41:00 +0000
378+++ bin/pt-fk-error-logger 2013-08-13 03:46:05 +0000
379@@ -503,11 +503,21 @@
380 my $long = exists $self->{opts}->{$opt} ? $opt
381 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
382 : die "Getopt::Long gave a nonexistent option: $opt";
383-
384 $opt = $self->{opts}->{$long};
385 if ( $opt->{is_cumulative} ) {
386 $opt->{value}++;
387 }
388+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
389+ my $next_opt = $1;
390+ if ( exists $self->{opts}->{$next_opt}
391+ || exists $self->{short_opts}->{$next_opt} ) {
392+ $self->save_error("--$long requires a string value");
393+ return;
394+ }
395+ else {
396+ $opt->{value} = $val;
397+ }
398+ }
399 else {
400 $opt->{value} = $val;
401 }
402@@ -4516,6 +4526,6 @@
403
404 =head1 VERSION
405
406-pt-fk-error-logger 2.2.3
407+pt-fk-error-logger 2.2.4
408
409 =cut
410
411=== modified file 'bin/pt-heartbeat'
412--- bin/pt-heartbeat 2013-07-17 19:41:00 +0000
413+++ bin/pt-heartbeat 2013-08-13 03:46:05 +0000
414@@ -1240,11 +1240,21 @@
415 my $long = exists $self->{opts}->{$opt} ? $opt
416 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
417 : die "Getopt::Long gave a nonexistent option: $opt";
418-
419 $opt = $self->{opts}->{$long};
420 if ( $opt->{is_cumulative} ) {
421 $opt->{value}++;
422 }
423+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
424+ my $next_opt = $1;
425+ if ( exists $self->{opts}->{$next_opt}
426+ || exists $self->{short_opts}->{$next_opt} ) {
427+ $self->save_error("--$long requires a string value");
428+ return;
429+ }
430+ else {
431+ $opt->{value} = $val;
432+ }
433+ }
434 else {
435 $opt->{value} = $val;
436 }
437@@ -6199,6 +6209,6 @@
438
439 =head1 VERSION
440
441-pt-heartbeat 2.2.3
442+pt-heartbeat 2.2.4
443
444 =cut
445
446=== modified file 'bin/pt-index-usage'
447--- bin/pt-index-usage 2013-07-17 19:41:00 +0000
448+++ bin/pt-index-usage 2013-08-13 03:46:05 +0000
449@@ -1085,11 +1085,21 @@
450 my $long = exists $self->{opts}->{$opt} ? $opt
451 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
452 : die "Getopt::Long gave a nonexistent option: $opt";
453-
454 $opt = $self->{opts}->{$long};
455 if ( $opt->{is_cumulative} ) {
456 $opt->{value}++;
457 }
458+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
459+ my $next_opt = $1;
460+ if ( exists $self->{opts}->{$next_opt}
461+ || exists $self->{short_opts}->{$next_opt} ) {
462+ $self->save_error("--$long requires a string value");
463+ return;
464+ }
465+ else {
466+ $opt->{value} = $val;
467+ }
468+ }
469 else {
470 $opt->{value} = $val;
471 }
472@@ -7526,6 +7536,6 @@
473
474 =head1 VERSION
475
476-pt-index-usage 2.2.3
477+pt-index-usage 2.2.4
478
479 =cut
480
481=== modified file 'bin/pt-ioprofile'
482--- bin/pt-ioprofile 2013-06-17 07:08:46 +0000
483+++ bin/pt-ioprofile 2013-08-13 03:46:05 +0000
484@@ -209,34 +209,38 @@
485 _parse_pod() {
486 local file="$1"
487
488- cat "$file" | PO_DIR="$PO_DIR" perl -ne '
489- BEGIN { $/ = ""; }
490- next unless $_ =~ m/^=head1 OPTIONS/;
491- while ( defined(my $para = <>) ) {
492- last if $para =~ m/^=head1/;
493- chomp;
494- if ( $para =~ m/^=item --(\S+)/ ) {
495- my $opt = $1;
496- my $file = "$ENV{PO_DIR}/$opt";
497- open my $opt_fh, ">", $file or die "Cannot open $file: $!";
498- print $opt_fh "long:$opt\n";
499- $para = <>;
500+ PO_FILE="$file" PO_DIR="$PO_DIR" perl -e '
501+ $/ = "";
502+ my $file = $ENV{PO_FILE};
503+ open my $fh, "<", $file or die "Cannot open $file: $!";
504+ while ( defined(my $para = <$fh>) ) {
505+ next unless $para =~ m/^=head1 OPTIONS/;
506+ while ( defined(my $para = <$fh>) ) {
507+ last if $para =~ m/^=head1/;
508 chomp;
509- if ( $para =~ m/^[a-z ]+:/ ) {
510- map {
511+ if ( $para =~ m/^=item --(\S+)/ ) {
512+ my $opt = $1;
513+ my $file = "$ENV{PO_DIR}/$opt";
514+ open my $opt_fh, ">", $file or die "Cannot open $file: $!";
515+ print $opt_fh "long:$opt\n";
516+ $para = <$fh>;
517+ chomp;
518+ if ( $para =~ m/^[a-z ]+:/ ) {
519+ map {
520+ chomp;
521+ my ($attrib, $val) = split(/: /, $_);
522+ print $opt_fh "$attrib:$val\n";
523+ } split(/; /, $para);
524+ $para = <$fh>;
525 chomp;
526- my ($attrib, $val) = split(/: /, $_);
527- print $opt_fh "$attrib:$val\n";
528- } split(/; /, $para);
529- $para = <>;
530- chomp;
531+ }
532+ my ($desc) = $para =~ m/^([^?.]+)/;
533+ print $opt_fh "desc:$desc.\n";
534+ close $opt_fh;
535 }
536- my ($desc) = $para =~ m/^([^?.]+)/;
537- print $opt_fh "desc:$desc.\n";
538- close $opt_fh;
539 }
540+ last;
541 }
542- last;
543 '
544 }
545
546@@ -1115,7 +1119,7 @@
547
548 =head1 VERSION
549
550-pt-ioprofile 2.2.3
551+pt-ioprofile 2.2.4
552
553 =cut
554
555
556=== modified file 'bin/pt-kill'
557--- bin/pt-kill 2013-07-17 19:41:00 +0000
558+++ bin/pt-kill 2013-08-13 03:46:05 +0000
559@@ -513,11 +513,21 @@
560 my $long = exists $self->{opts}->{$opt} ? $opt
561 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
562 : die "Getopt::Long gave a nonexistent option: $opt";
563-
564 $opt = $self->{opts}->{$long};
565 if ( $opt->{is_cumulative} ) {
566 $opt->{value}++;
567 }
568+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
569+ my $next_opt = $1;
570+ if ( exists $self->{opts}->{$next_opt}
571+ || exists $self->{short_opts}->{$next_opt} ) {
572+ $self->save_error("--$long requires a string value");
573+ return;
574+ }
575+ else {
576+ $opt->{value} = $val;
577+ }
578+ }
579 else {
580 $opt->{value} = $val;
581 }
582@@ -8171,6 +8181,6 @@
583
584 =head1 VERSION
585
586-pt-kill 2.2.3
587+pt-kill 2.2.4
588
589 =cut
590
591=== modified file 'bin/pt-mext'
592--- bin/pt-mext 2013-06-17 07:08:46 +0000
593+++ bin/pt-mext 2013-08-13 03:46:05 +0000
594@@ -791,7 +791,7 @@
595
596 =head1 VERSION
597
598-pt-mext 2.2.3
599+pt-mext 2.2.4
600
601 =cut
602
603
604=== modified file 'bin/pt-mysql-summary'
605--- bin/pt-mysql-summary 2013-06-17 07:08:46 +0000
606+++ bin/pt-mysql-summary 2013-08-13 03:46:05 +0000
607@@ -211,34 +211,38 @@
608 _parse_pod() {
609 local file="$1"
610
611- cat "$file" | PO_DIR="$PO_DIR" perl -ne '
612- BEGIN { $/ = ""; }
613- next unless $_ =~ m/^=head1 OPTIONS/;
614- while ( defined(my $para = <>) ) {
615- last if $para =~ m/^=head1/;
616- chomp;
617- if ( $para =~ m/^=item --(\S+)/ ) {
618- my $opt = $1;
619- my $file = "$ENV{PO_DIR}/$opt";
620- open my $opt_fh, ">", $file or die "Cannot open $file: $!";
621- print $opt_fh "long:$opt\n";
622- $para = <>;
623+ PO_FILE="$file" PO_DIR="$PO_DIR" perl -e '
624+ $/ = "";
625+ my $file = $ENV{PO_FILE};
626+ open my $fh, "<", $file or die "Cannot open $file: $!";
627+ while ( defined(my $para = <$fh>) ) {
628+ next unless $para =~ m/^=head1 OPTIONS/;
629+ while ( defined(my $para = <$fh>) ) {
630+ last if $para =~ m/^=head1/;
631 chomp;
632- if ( $para =~ m/^[a-z ]+:/ ) {
633- map {
634+ if ( $para =~ m/^=item --(\S+)/ ) {
635+ my $opt = $1;
636+ my $file = "$ENV{PO_DIR}/$opt";
637+ open my $opt_fh, ">", $file or die "Cannot open $file: $!";
638+ print $opt_fh "long:$opt\n";
639+ $para = <$fh>;
640+ chomp;
641+ if ( $para =~ m/^[a-z ]+:/ ) {
642+ map {
643+ chomp;
644+ my ($attrib, $val) = split(/: /, $_);
645+ print $opt_fh "$attrib:$val\n";
646+ } split(/; /, $para);
647+ $para = <$fh>;
648 chomp;
649- my ($attrib, $val) = split(/: /, $_);
650- print $opt_fh "$attrib:$val\n";
651- } split(/; /, $para);
652- $para = <>;
653- chomp;
654+ }
655+ my ($desc) = $para =~ m/^([^?.]+)/;
656+ print $opt_fh "desc:$desc.\n";
657+ close $opt_fh;
658 }
659- my ($desc) = $para =~ m/^([^?.]+)/;
660- print $opt_fh "desc:$desc.\n";
661- close $opt_fh;
662 }
663+ last;
664 }
665- last;
666 '
667 }
668
669@@ -3111,7 +3115,7 @@
670
671 =head1 VERSION
672
673-pt-mysql-summary 2.2.3
674+pt-mysql-summary 2.2.4
675
676 =cut
677
678
679=== modified file 'bin/pt-online-schema-change'
680--- bin/pt-online-schema-change 2013-07-17 19:41:00 +0000
681+++ bin/pt-online-schema-change 2013-08-13 03:46:05 +0000
682@@ -520,11 +520,21 @@
683 my $long = exists $self->{opts}->{$opt} ? $opt
684 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
685 : die "Getopt::Long gave a nonexistent option: $opt";
686-
687 $opt = $self->{opts}->{$long};
688 if ( $opt->{is_cumulative} ) {
689 $opt->{value}++;
690 }
691+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
692+ my $next_opt = $1;
693+ if ( exists $self->{opts}->{$next_opt}
694+ || exists $self->{short_opts}->{$next_opt} ) {
695+ $self->save_error("--$long requires a string value");
696+ return;
697+ }
698+ else {
699+ $opt->{value} = $val;
700+ }
701+ }
702 else {
703 $opt->{value} = $val;
704 }
705@@ -11451,6 +11461,6 @@
706
707 =head1 VERSION
708
709-pt-online-schema-change 2.2.3
710+pt-online-schema-change 2.2.4
711
712 =cut
713
714=== modified file 'bin/pt-pmp'
715--- bin/pt-pmp 2013-06-17 07:08:46 +0000
716+++ bin/pt-pmp 2013-08-13 03:46:05 +0000
717@@ -252,34 +252,38 @@
718 _parse_pod() {
719 local file="$1"
720
721- cat "$file" | PO_DIR="$PO_DIR" perl -ne '
722- BEGIN { $/ = ""; }
723- next unless $_ =~ m/^=head1 OPTIONS/;
724- while ( defined(my $para = <>) ) {
725- last if $para =~ m/^=head1/;
726- chomp;
727- if ( $para =~ m/^=item --(\S+)/ ) {
728- my $opt = $1;
729- my $file = "$ENV{PO_DIR}/$opt";
730- open my $opt_fh, ">", $file or die "Cannot open $file: $!";
731- print $opt_fh "long:$opt\n";
732- $para = <>;
733+ PO_FILE="$file" PO_DIR="$PO_DIR" perl -e '
734+ $/ = "";
735+ my $file = $ENV{PO_FILE};
736+ open my $fh, "<", $file or die "Cannot open $file: $!";
737+ while ( defined(my $para = <$fh>) ) {
738+ next unless $para =~ m/^=head1 OPTIONS/;
739+ while ( defined(my $para = <$fh>) ) {
740+ last if $para =~ m/^=head1/;
741 chomp;
742- if ( $para =~ m/^[a-z ]+:/ ) {
743- map {
744+ if ( $para =~ m/^=item --(\S+)/ ) {
745+ my $opt = $1;
746+ my $file = "$ENV{PO_DIR}/$opt";
747+ open my $opt_fh, ">", $file or die "Cannot open $file: $!";
748+ print $opt_fh "long:$opt\n";
749+ $para = <$fh>;
750+ chomp;
751+ if ( $para =~ m/^[a-z ]+:/ ) {
752+ map {
753+ chomp;
754+ my ($attrib, $val) = split(/: /, $_);
755+ print $opt_fh "$attrib:$val\n";
756+ } split(/; /, $para);
757+ $para = <$fh>;
758 chomp;
759- my ($attrib, $val) = split(/: /, $_);
760- print $opt_fh "$attrib:$val\n";
761- } split(/; /, $para);
762- $para = <>;
763- chomp;
764+ }
765+ my ($desc) = $para =~ m/^([^?.]+)/;
766+ print $opt_fh "desc:$desc.\n";
767+ close $opt_fh;
768 }
769- my ($desc) = $para =~ m/^([^?.]+)/;
770- print $opt_fh "desc:$desc.\n";
771- close $opt_fh;
772 }
773+ last;
774 }
775- last;
776 '
777 }
778
779@@ -885,7 +889,7 @@
780
781 =head1 VERSION
782
783-pt-pmp 2.2.3
784+pt-pmp 2.2.4
785
786 =cut
787
788
789=== modified file 'bin/pt-query-digest'
790--- bin/pt-query-digest 2013-08-03 21:04:05 +0000
791+++ bin/pt-query-digest 2013-08-13 03:46:05 +0000
792@@ -1753,11 +1753,21 @@
793 my $long = exists $self->{opts}->{$opt} ? $opt
794 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
795 : die "Getopt::Long gave a nonexistent option: $opt";
796-
797 $opt = $self->{opts}->{$long};
798 if ( $opt->{is_cumulative} ) {
799 $opt->{value}++;
800 }
801+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
802+ my $next_opt = $1;
803+ if ( exists $self->{opts}->{$next_opt}
804+ || exists $self->{short_opts}->{$next_opt} ) {
805+ $self->save_error("--$long requires a string value");
806+ return;
807+ }
808+ else {
809+ $opt->{value} = $val;
810+ }
811+ }
812 else {
813 $opt->{value} = $val;
814 }
815@@ -16536,6 +16546,6 @@
816
817 =head1 VERSION
818
819-pt-query-digest 2.2.3
820+pt-query-digest 2.2.4
821
822 =cut
823
824=== modified file 'bin/pt-show-grants'
825--- bin/pt-show-grants 2013-06-25 22:32:19 +0000
826+++ bin/pt-show-grants 2013-08-13 03:46:05 +0000
827@@ -433,11 +433,21 @@
828 my $long = exists $self->{opts}->{$opt} ? $opt
829 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
830 : die "Getopt::Long gave a nonexistent option: $opt";
831-
832 $opt = $self->{opts}->{$long};
833 if ( $opt->{is_cumulative} ) {
834 $opt->{value}++;
835 }
836+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
837+ my $next_opt = $1;
838+ if ( exists $self->{opts}->{$next_opt}
839+ || exists $self->{short_opts}->{$next_opt} ) {
840+ $self->save_error("--$long requires a string value");
841+ return;
842+ }
843+ else {
844+ $opt->{value} = $val;
845+ }
846+ }
847 else {
848 $opt->{value} = $val;
849 }
850@@ -2396,6 +2406,6 @@
851
852 =head1 VERSION
853
854-pt-show-grants 2.2.3
855+pt-show-grants 2.2.4
856
857 =cut
858
859=== modified file 'bin/pt-sift'
860--- bin/pt-sift 2013-06-26 18:40:23 +0000
861+++ bin/pt-sift 2013-08-13 03:46:05 +0000
862@@ -250,34 +250,38 @@
863 _parse_pod() {
864 local file="$1"
865
866- cat "$file" | PO_DIR="$PO_DIR" perl -ne '
867- BEGIN { $/ = ""; }
868- next unless $_ =~ m/^=head1 OPTIONS/;
869- while ( defined(my $para = <>) ) {
870- last if $para =~ m/^=head1/;
871- chomp;
872- if ( $para =~ m/^=item --(\S+)/ ) {
873- my $opt = $1;
874- my $file = "$ENV{PO_DIR}/$opt";
875- open my $opt_fh, ">", $file or die "Cannot open $file: $!";
876- print $opt_fh "long:$opt\n";
877- $para = <>;
878+ PO_FILE="$file" PO_DIR="$PO_DIR" perl -e '
879+ $/ = "";
880+ my $file = $ENV{PO_FILE};
881+ open my $fh, "<", $file or die "Cannot open $file: $!";
882+ while ( defined(my $para = <$fh>) ) {
883+ next unless $para =~ m/^=head1 OPTIONS/;
884+ while ( defined(my $para = <$fh>) ) {
885+ last if $para =~ m/^=head1/;
886 chomp;
887- if ( $para =~ m/^[a-z ]+:/ ) {
888- map {
889+ if ( $para =~ m/^=item --(\S+)/ ) {
890+ my $opt = $1;
891+ my $file = "$ENV{PO_DIR}/$opt";
892+ open my $opt_fh, ">", $file or die "Cannot open $file: $!";
893+ print $opt_fh "long:$opt\n";
894+ $para = <$fh>;
895+ chomp;
896+ if ( $para =~ m/^[a-z ]+:/ ) {
897+ map {
898+ chomp;
899+ my ($attrib, $val) = split(/: /, $_);
900+ print $opt_fh "$attrib:$val\n";
901+ } split(/; /, $para);
902+ $para = <$fh>;
903 chomp;
904- my ($attrib, $val) = split(/: /, $_);
905- print $opt_fh "$attrib:$val\n";
906- } split(/; /, $para);
907- $para = <>;
908- chomp;
909+ }
910+ my ($desc) = $para =~ m/^([^?.]+)/;
911+ print $opt_fh "desc:$desc.\n";
912+ close $opt_fh;
913 }
914- my ($desc) = $para =~ m/^([^?.]+)/;
915- print $opt_fh "desc:$desc.\n";
916- close $opt_fh;
917 }
918+ last;
919 }
920- last;
921 '
922 }
923
924@@ -1233,7 +1237,7 @@
925
926 =head1 VERSION
927
928-pt-sift 2.2.3
929+pt-sift 2.2.4
930
931 =cut
932
933
934=== modified file 'bin/pt-slave-delay'
935--- bin/pt-slave-delay 2013-07-17 19:41:00 +0000
936+++ bin/pt-slave-delay 2013-08-13 03:46:05 +0000
937@@ -506,11 +506,21 @@
938 my $long = exists $self->{opts}->{$opt} ? $opt
939 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
940 : die "Getopt::Long gave a nonexistent option: $opt";
941-
942 $opt = $self->{opts}->{$long};
943 if ( $opt->{is_cumulative} ) {
944 $opt->{value}++;
945 }
946+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
947+ my $next_opt = $1;
948+ if ( exists $self->{opts}->{$next_opt}
949+ || exists $self->{short_opts}->{$next_opt} ) {
950+ $self->save_error("--$long requires a string value");
951+ return;
952+ }
953+ else {
954+ $opt->{value} = $val;
955+ }
956+ }
957 else {
958 $opt->{value} = $val;
959 }
960@@ -4876,6 +4886,6 @@
961
962 =head1 VERSION
963
964-pt-slave-delay 2.2.3
965+pt-slave-delay 2.2.4
966
967 =cut
968
969=== modified file 'bin/pt-slave-find'
970--- bin/pt-slave-find 2013-06-25 22:32:19 +0000
971+++ bin/pt-slave-find 2013-08-13 03:46:05 +0000
972@@ -441,11 +441,21 @@
973 my $long = exists $self->{opts}->{$opt} ? $opt
974 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
975 : die "Getopt::Long gave a nonexistent option: $opt";
976-
977 $opt = $self->{opts}->{$long};
978 if ( $opt->{is_cumulative} ) {
979 $opt->{value}++;
980 }
981+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
982+ my $next_opt = $1;
983+ if ( exists $self->{opts}->{$next_opt}
984+ || exists $self->{short_opts}->{$next_opt} ) {
985+ $self->save_error("--$long requires a string value");
986+ return;
987+ }
988+ else {
989+ $opt->{value} = $val;
990+ }
991+ }
992 else {
993 $opt->{value} = $val;
994 }
995@@ -4324,6 +4334,6 @@
996
997 =head1 VERSION
998
999-pt-slave-find 2.2.3
1000+pt-slave-find 2.2.4
1001
1002 =cut
1003
1004=== modified file 'bin/pt-slave-restart'
1005--- bin/pt-slave-restart 2013-07-17 19:41:00 +0000
1006+++ bin/pt-slave-restart 2013-08-13 03:46:05 +0000
1007@@ -658,11 +658,21 @@
1008 my $long = exists $self->{opts}->{$opt} ? $opt
1009 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
1010 : die "Getopt::Long gave a nonexistent option: $opt";
1011-
1012 $opt = $self->{opts}->{$long};
1013 if ( $opt->{is_cumulative} ) {
1014 $opt->{value}++;
1015 }
1016+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
1017+ my $next_opt = $1;
1018+ if ( exists $self->{opts}->{$next_opt}
1019+ || exists $self->{short_opts}->{$next_opt} ) {
1020+ $self->save_error("--$long requires a string value");
1021+ return;
1022+ }
1023+ else {
1024+ $opt->{value} = $val;
1025+ }
1026+ }
1027 else {
1028 $opt->{value} = $val;
1029 }
1030@@ -5818,6 +5828,6 @@
1031
1032 =head1 VERSION
1033
1034-pt-slave-restart 2.2.3
1035+pt-slave-restart 2.2.4
1036
1037 =cut
1038
1039=== modified file 'bin/pt-stalk'
1040--- bin/pt-stalk 2013-06-17 07:08:46 +0000
1041+++ bin/pt-stalk 2013-08-13 03:46:05 +0000
1042@@ -263,34 +263,38 @@
1043 _parse_pod() {
1044 local file="$1"
1045
1046- cat "$file" | PO_DIR="$PO_DIR" perl -ne '
1047- BEGIN { $/ = ""; }
1048- next unless $_ =~ m/^=head1 OPTIONS/;
1049- while ( defined(my $para = <>) ) {
1050- last if $para =~ m/^=head1/;
1051- chomp;
1052- if ( $para =~ m/^=item --(\S+)/ ) {
1053- my $opt = $1;
1054- my $file = "$ENV{PO_DIR}/$opt";
1055- open my $opt_fh, ">", $file or die "Cannot open $file: $!";
1056- print $opt_fh "long:$opt\n";
1057- $para = <>;
1058+ PO_FILE="$file" PO_DIR="$PO_DIR" perl -e '
1059+ $/ = "";
1060+ my $file = $ENV{PO_FILE};
1061+ open my $fh, "<", $file or die "Cannot open $file: $!";
1062+ while ( defined(my $para = <$fh>) ) {
1063+ next unless $para =~ m/^=head1 OPTIONS/;
1064+ while ( defined(my $para = <$fh>) ) {
1065+ last if $para =~ m/^=head1/;
1066 chomp;
1067- if ( $para =~ m/^[a-z ]+:/ ) {
1068- map {
1069+ if ( $para =~ m/^=item --(\S+)/ ) {
1070+ my $opt = $1;
1071+ my $file = "$ENV{PO_DIR}/$opt";
1072+ open my $opt_fh, ">", $file or die "Cannot open $file: $!";
1073+ print $opt_fh "long:$opt\n";
1074+ $para = <$fh>;
1075+ chomp;
1076+ if ( $para =~ m/^[a-z ]+:/ ) {
1077+ map {
1078+ chomp;
1079+ my ($attrib, $val) = split(/: /, $_);
1080+ print $opt_fh "$attrib:$val\n";
1081+ } split(/; /, $para);
1082+ $para = <$fh>;
1083 chomp;
1084- my ($attrib, $val) = split(/: /, $_);
1085- print $opt_fh "$attrib:$val\n";
1086- } split(/; /, $para);
1087- $para = <>;
1088- chomp;
1089+ }
1090+ my ($desc) = $para =~ m/^([^?.]+)/;
1091+ print $opt_fh "desc:$desc.\n";
1092+ close $opt_fh;
1093 }
1094- my ($desc) = $para =~ m/^([^?.]+)/;
1095- print $opt_fh "desc:$desc.\n";
1096- close $opt_fh;
1097 }
1098+ last;
1099 }
1100- last;
1101 '
1102 }
1103
1104@@ -2200,7 +2204,7 @@
1105
1106 =head1 VERSION
1107
1108-pt-stalk 2.2.3
1109+pt-stalk 2.2.4
1110
1111 =cut
1112
1113
1114=== modified file 'bin/pt-summary'
1115--- bin/pt-summary 2013-06-17 07:08:46 +0000
1116+++ bin/pt-summary 2013-08-13 03:46:05 +0000
1117@@ -218,34 +218,38 @@
1118 _parse_pod() {
1119 local file="$1"
1120
1121- cat "$file" | PO_DIR="$PO_DIR" perl -ne '
1122- BEGIN { $/ = ""; }
1123- next unless $_ =~ m/^=head1 OPTIONS/;
1124- while ( defined(my $para = <>) ) {
1125- last if $para =~ m/^=head1/;
1126- chomp;
1127- if ( $para =~ m/^=item --(\S+)/ ) {
1128- my $opt = $1;
1129- my $file = "$ENV{PO_DIR}/$opt";
1130- open my $opt_fh, ">", $file or die "Cannot open $file: $!";
1131- print $opt_fh "long:$opt\n";
1132- $para = <>;
1133+ PO_FILE="$file" PO_DIR="$PO_DIR" perl -e '
1134+ $/ = "";
1135+ my $file = $ENV{PO_FILE};
1136+ open my $fh, "<", $file or die "Cannot open $file: $!";
1137+ while ( defined(my $para = <$fh>) ) {
1138+ next unless $para =~ m/^=head1 OPTIONS/;
1139+ while ( defined(my $para = <$fh>) ) {
1140+ last if $para =~ m/^=head1/;
1141 chomp;
1142- if ( $para =~ m/^[a-z ]+:/ ) {
1143- map {
1144+ if ( $para =~ m/^=item --(\S+)/ ) {
1145+ my $opt = $1;
1146+ my $file = "$ENV{PO_DIR}/$opt";
1147+ open my $opt_fh, ">", $file or die "Cannot open $file: $!";
1148+ print $opt_fh "long:$opt\n";
1149+ $para = <$fh>;
1150+ chomp;
1151+ if ( $para =~ m/^[a-z ]+:/ ) {
1152+ map {
1153+ chomp;
1154+ my ($attrib, $val) = split(/: /, $_);
1155+ print $opt_fh "$attrib:$val\n";
1156+ } split(/; /, $para);
1157+ $para = <$fh>;
1158 chomp;
1159- my ($attrib, $val) = split(/: /, $_);
1160- print $opt_fh "$attrib:$val\n";
1161- } split(/; /, $para);
1162- $para = <>;
1163- chomp;
1164+ }
1165+ my ($desc) = $para =~ m/^([^?.]+)/;
1166+ print $opt_fh "desc:$desc.\n";
1167+ close $opt_fh;
1168 }
1169- my ($desc) = $para =~ m/^([^?.]+)/;
1170- print $opt_fh "desc:$desc.\n";
1171- close $opt_fh;
1172 }
1173+ last;
1174 }
1175- last;
1176 '
1177 }
1178
1179@@ -2682,7 +2686,7 @@
1180
1181 =head1 VERSION
1182
1183-pt-summary 2.2.3
1184+pt-summary 2.2.4
1185
1186 =cut
1187
1188
1189=== modified file 'bin/pt-table-checksum'
1190--- bin/pt-table-checksum 2013-07-17 19:41:00 +0000
1191+++ bin/pt-table-checksum 2013-08-13 03:46:05 +0000
1192@@ -2187,11 +2187,21 @@
1193 my $long = exists $self->{opts}->{$opt} ? $opt
1194 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
1195 : die "Getopt::Long gave a nonexistent option: $opt";
1196-
1197 $opt = $self->{opts}->{$long};
1198 if ( $opt->{is_cumulative} ) {
1199 $opt->{value}++;
1200 }
1201+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
1202+ my $next_opt = $1;
1203+ if ( exists $self->{opts}->{$next_opt}
1204+ || exists $self->{short_opts}->{$next_opt} ) {
1205+ $self->save_error("--$long requires a string value");
1206+ return;
1207+ }
1208+ else {
1209+ $opt->{value} = $val;
1210+ }
1211+ }
1212 else {
1213 $opt->{value} = $val;
1214 }
1215@@ -12435,6 +12445,6 @@
1216
1217 =head1 VERSION
1218
1219-pt-table-checksum 2.2.3
1220+pt-table-checksum 2.2.4
1221
1222 =cut
1223
1224=== modified file 'bin/pt-table-sync'
1225--- bin/pt-table-sync 2013-07-17 19:41:00 +0000
1226+++ bin/pt-table-sync 2013-08-13 03:46:05 +0000
1227@@ -521,11 +521,21 @@
1228 my $long = exists $self->{opts}->{$opt} ? $opt
1229 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
1230 : die "Getopt::Long gave a nonexistent option: $opt";
1231-
1232 $opt = $self->{opts}->{$long};
1233 if ( $opt->{is_cumulative} ) {
1234 $opt->{value}++;
1235 }
1236+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
1237+ my $next_opt = $1;
1238+ if ( exists $self->{opts}->{$next_opt}
1239+ || exists $self->{short_opts}->{$next_opt} ) {
1240+ $self->save_error("--$long requires a string value");
1241+ return;
1242+ }
1243+ else {
1244+ $opt->{value} = $val;
1245+ }
1246+ }
1247 else {
1248 $opt->{value} = $val;
1249 }
1250@@ -12675,6 +12685,6 @@
1251
1252 =head1 VERSION
1253
1254-pt-table-sync 2.2.3
1255+pt-table-sync 2.2.4
1256
1257 =cut
1258
1259=== modified file 'bin/pt-table-usage'
1260--- bin/pt-table-usage 2013-06-27 19:06:24 +0000
1261+++ bin/pt-table-usage 2013-08-13 03:46:05 +0000
1262@@ -870,11 +870,21 @@
1263 my $long = exists $self->{opts}->{$opt} ? $opt
1264 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
1265 : die "Getopt::Long gave a nonexistent option: $opt";
1266-
1267 $opt = $self->{opts}->{$long};
1268 if ( $opt->{is_cumulative} ) {
1269 $opt->{value}++;
1270 }
1271+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
1272+ my $next_opt = $1;
1273+ if ( exists $self->{opts}->{$next_opt}
1274+ || exists $self->{short_opts}->{$next_opt} ) {
1275+ $self->save_error("--$long requires a string value");
1276+ return;
1277+ }
1278+ else {
1279+ $opt->{value} = $val;
1280+ }
1281+ }
1282 else {
1283 $opt->{value} = $val;
1284 }
1285@@ -7512,6 +7522,6 @@
1286
1287 =head1 VERSION
1288
1289-pt-table-usage 2.2.3
1290+pt-table-usage 2.2.4
1291
1292 =cut
1293
1294=== modified file 'bin/pt-upgrade'
1295--- bin/pt-upgrade 2013-07-17 19:41:00 +0000
1296+++ bin/pt-upgrade 2013-08-13 03:46:05 +0000
1297@@ -1750,11 +1750,21 @@
1298 my $long = exists $self->{opts}->{$opt} ? $opt
1299 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
1300 : die "Getopt::Long gave a nonexistent option: $opt";
1301-
1302 $opt = $self->{opts}->{$long};
1303 if ( $opt->{is_cumulative} ) {
1304 $opt->{value}++;
1305 }
1306+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
1307+ my $next_opt = $1;
1308+ if ( exists $self->{opts}->{$next_opt}
1309+ || exists $self->{short_opts}->{$next_opt} ) {
1310+ $self->save_error("--$long requires a string value");
1311+ return;
1312+ }
1313+ else {
1314+ $opt->{value} = $val;
1315+ }
1316+ }
1317 else {
1318 $opt->{value} = $val;
1319 }
1320@@ -11217,6 +11227,6 @@
1321
1322 =head1 VERSION
1323
1324-pt-upgrade 2.2.3
1325+pt-upgrade 2.2.4
1326
1327 =cut
1328
1329=== modified file 'bin/pt-variable-advisor'
1330--- bin/pt-variable-advisor 2013-07-17 19:41:00 +0000
1331+++ bin/pt-variable-advisor 2013-08-13 03:46:05 +0000
1332@@ -510,11 +510,21 @@
1333 my $long = exists $self->{opts}->{$opt} ? $opt
1334 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
1335 : die "Getopt::Long gave a nonexistent option: $opt";
1336-
1337 $opt = $self->{opts}->{$long};
1338 if ( $opt->{is_cumulative} ) {
1339 $opt->{value}++;
1340 }
1341+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
1342+ my $next_opt = $1;
1343+ if ( exists $self->{opts}->{$next_opt}
1344+ || exists $self->{short_opts}->{$next_opt} ) {
1345+ $self->save_error("--$long requires a string value");
1346+ return;
1347+ }
1348+ else {
1349+ $opt->{value} = $val;
1350+ }
1351+ }
1352 else {
1353 $opt->{value} = $val;
1354 }
1355@@ -6146,6 +6156,6 @@
1356
1357 =head1 VERSION
1358
1359-pt-variable-advisor 2.2.3
1360+pt-variable-advisor 2.2.4
1361
1362 =cut
1363
1364=== modified file 'bin/pt-visual-explain'
1365--- bin/pt-visual-explain 2013-06-25 22:32:19 +0000
1366+++ bin/pt-visual-explain 2013-08-13 03:46:05 +0000
1367@@ -1107,11 +1107,21 @@
1368 my $long = exists $self->{opts}->{$opt} ? $opt
1369 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
1370 : die "Getopt::Long gave a nonexistent option: $opt";
1371-
1372 $opt = $self->{opts}->{$long};
1373 if ( $opt->{is_cumulative} ) {
1374 $opt->{value}++;
1375 }
1376+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
1377+ my $next_opt = $1;
1378+ if ( exists $self->{opts}->{$next_opt}
1379+ || exists $self->{short_opts}->{$next_opt} ) {
1380+ $self->save_error("--$long requires a string value");
1381+ return;
1382+ }
1383+ else {
1384+ $opt->{value} = $val;
1385+ }
1386+ }
1387 else {
1388 $opt->{value} = $val;
1389 }
1390@@ -3233,6 +3243,6 @@
1391
1392 =head1 VERSION
1393
1394-pt-visual-explain 2.2.3
1395+pt-visual-explain 2.2.4
1396
1397 =cut
1398
1399=== modified file 'lib/OptionParser.pm'
1400--- lib/OptionParser.pm 2013-06-25 22:31:39 +0000
1401+++ lib/OptionParser.pm 2013-08-13 03:46:05 +0000
1402@@ -554,12 +554,23 @@
1403 my $long = exists $self->{opts}->{$opt} ? $opt
1404 : exists $self->{short_opts}->{$opt} ? $self->{short_opts}->{$opt}
1405 : die "Getopt::Long gave a nonexistent option: $opt";
1406-
1407 # Reassign $opt.
1408 $opt = $self->{opts}->{$long};
1409 if ( $opt->{is_cumulative} ) {
1410 $opt->{value}++;
1411 }
1412+ elsif ( ($opt->{type} || '') eq 's' && $val =~ m/^--?(.+)/ ) {
1413+ # https://bugs.launchpad.net/percona-toolkit/+bug/1199589
1414+ my $next_opt = $1;
1415+ if ( exists $self->{opts}->{$next_opt}
1416+ || exists $self->{short_opts}->{$next_opt} ) {
1417+ $self->save_error("--$long requires a string value");
1418+ return;
1419+ }
1420+ else {
1421+ $opt->{value} = $val;
1422+ }
1423+ }
1424 else {
1425 $opt->{value} = $val;
1426 }
1427
1428=== modified file 'lib/PerconaTest.pm'
1429--- lib/PerconaTest.pm 2013-03-21 19:50:49 +0000
1430+++ lib/PerconaTest.pm 2013-08-13 03:46:05 +0000
1431@@ -819,6 +819,20 @@
1432 return [ sort keys %tables ];
1433 }
1434
1435+sub get_cmd_pid {
1436+ my $cmd = shift;
1437+ $cmd =~ s/\./\\./g;
1438+ $cmd =~ s/-/\\-/g;
1439+ my $output = `ps xww | grep -v grep | grep '$cmd'`;
1440+ my @cmds = $output =~ m/\n/g;
1441+ if ( @cmds > 1 ) {
1442+ die "Found " . scalar @cmds . " commands matching '$cmd': @cmds";
1443+ }
1444+ my ($pid) = $output =~ m/^\s*(\d+)/;
1445+ return wantarray ? ($pid, $output) : $pid;
1446+}
1447+
1448+
1449 sub can_load_data {
1450 my $output = `/tmp/12345/use -e "SELECT * FROM percona_test.load_data" 2>/dev/null`;
1451 return ($output || '') =~ /1/;
1452
1453=== modified file 'lib/VariableAdvisorRules.pm'
1454--- lib/VariableAdvisorRules.pm 2013-06-27 21:45:56 +0000
1455+++ lib/VariableAdvisorRules.pm 2013-08-13 03:46:05 +0000
1456@@ -215,6 +215,7 @@
1457 code => sub {
1458 my ( %args ) = @_;
1459 my $mysql_version = $args{mysql_version};
1460+ return 0 unless $mysql_version;
1461 return _var_lt($args{variables}->{innodb_max_dirty_pages_pct},
1462 ($mysql_version < '5.5' ? 90 : 75));
1463 },
1464
1465=== modified file 'lib/bash/parse_options.sh'
1466--- lib/bash/parse_options.sh 2013-02-25 14:21:46 +0000
1467+++ lib/bash/parse_options.sh 2013-08-13 03:46:05 +0000
1468@@ -230,34 +230,38 @@
1469 # default=foo
1470 # That's the spec for --string-opt2. Each line is a key:value pair
1471 # from the option's POD line like "type: string; default: foo".
1472- cat "$file" | PO_DIR="$PO_DIR" perl -ne '
1473- BEGIN { $/ = ""; }
1474- next unless $_ =~ m/^=head1 OPTIONS/;
1475- while ( defined(my $para = <>) ) {
1476- last if $para =~ m/^=head1/;
1477- chomp;
1478- if ( $para =~ m/^=item --(\S+)/ ) {
1479- my $opt = $1;
1480- my $file = "$ENV{PO_DIR}/$opt";
1481- open my $opt_fh, ">", $file or die "Cannot open $file: $!";
1482- print $opt_fh "long:$opt\n";
1483- $para = <>;
1484+ PO_FILE="$file" PO_DIR="$PO_DIR" perl -e '
1485+ $/ = "";
1486+ my $file = $ENV{PO_FILE};
1487+ open my $fh, "<", $file or die "Cannot open $file: $!";
1488+ while ( defined(my $para = <$fh>) ) {
1489+ next unless $para =~ m/^=head1 OPTIONS/;
1490+ while ( defined(my $para = <$fh>) ) {
1491+ last if $para =~ m/^=head1/;
1492 chomp;
1493- if ( $para =~ m/^[a-z ]+:/ ) {
1494- map {
1495+ if ( $para =~ m/^=item --(\S+)/ ) {
1496+ my $opt = $1;
1497+ my $file = "$ENV{PO_DIR}/$opt";
1498+ open my $opt_fh, ">", $file or die "Cannot open $file: $!";
1499+ print $opt_fh "long:$opt\n";
1500+ $para = <$fh>;
1501+ chomp;
1502+ if ( $para =~ m/^[a-z ]+:/ ) {
1503+ map {
1504+ chomp;
1505+ my ($attrib, $val) = split(/: /, $_);
1506+ print $opt_fh "$attrib:$val\n";
1507+ } split(/; /, $para);
1508+ $para = <$fh>;
1509 chomp;
1510- my ($attrib, $val) = split(/: /, $_);
1511- print $opt_fh "$attrib:$val\n";
1512- } split(/; /, $para);
1513- $para = <>;
1514- chomp;
1515+ }
1516+ my ($desc) = $para =~ m/^([^?.]+)/;
1517+ print $opt_fh "desc:$desc.\n";
1518+ close $opt_fh;
1519 }
1520- my ($desc) = $para =~ m/^([^?.]+)/;
1521- print $opt_fh "desc:$desc.\n";
1522- close $opt_fh;
1523 }
1524+ last;
1525 }
1526- last;
1527 '
1528 }
1529
1530
1531=== modified file 't/lib/Daemon.t'
1532--- t/lib/Daemon.t 2013-04-05 18:16:16 +0000
1533+++ t/lib/Daemon.t 2013-08-13 03:46:05 +0000
1534@@ -31,13 +31,14 @@
1535 # Test that it daemonizes, creates a PID file, and removes that PID file.
1536 # ############################################################################
1537
1538-my $ret_val = system("$cmd 5 --daemonize --pid $pid_file >/dev/null 2>&1");
1539+my $ret_val = system("$cmd 3 --daemonize --pid $pid_file --log $log_file");
1540 die 'Cannot test Daemon.pm because t/daemonizes.pl is not working'
1541 unless $ret_val == 0;
1542
1543-PerconaTest::wait_for_files($pid_file);
1544+PerconaTest::wait_for_files($pid_file, $log_file)
1545+ or die "$cmd did not create $pid_file and $log_file";
1546
1547-my $output = `ps wx | grep '$cmd 5' | grep -v grep`;
1548+my ($pid, $output) = PerconaTest::get_cmd_pid("$cmd 3");
1549
1550 like(
1551 $output,
1552@@ -50,7 +51,6 @@
1553 'Creates PID file'
1554 );
1555
1556-my ($pid) = $output =~ /^\s*(\d+)\s+/;
1557 $output = slurp_file($pid_file);
1558 chomp($output) if $output;
1559
1560@@ -60,12 +60,16 @@
1561 'PID file has correct PID'
1562 );
1563
1564-# Wait until the process goes away
1565-PerconaTest::wait_until(sub { !kill(0, $pid) });
1566-ok(
1567- ! -f $pid_file,
1568- 'Removes PID file upon exit'
1569-);
1570+SKIP: {
1571+ skip "Previous tests failed", 1 unless $pid;
1572+
1573+ # Wait until the process goes away
1574+ PerconaTest::wait_until(sub { !kill(0, $pid) });
1575+ ok(
1576+ ! -f $pid_file,
1577+ 'Removes PID file upon exit'
1578+ );
1579+}
1580
1581 # ############################################################################
1582 # Check that STDOUT can be redirected
1583@@ -132,12 +136,14 @@
1584 # ##########################################################################
1585 rm_tmp_files();
1586 SKIP: {
1587- skip 'No /proc', 2 unless -d '/proc';
1588- skip 'No fd in /proc', 2 unless -l "/proc/$PID/0" || -l "/proc/$PID/fd/0";
1589+ skip 'No /proc', 1 unless -d '/proc';
1590+ skip 'No fd in /proc', 1 unless -l "/proc/$PID/0" || -l "/proc/$PID/fd/0";
1591
1592- system("$cmd 5 --daemonize --pid $pid_file --log $log_file");
1593- PerconaTest::wait_for_files($pid_file);
1594- chomp($pid = slurp_file($pid_file));
1595+ system("$cmd 15 --daemonize --pid $pid_file --log $log_file");
1596+ PerconaTest::wait_for_files($pid_file, $log_file)
1597+ or die "$cmd did not create $pid_file and $log_file";
1598+ my $pid = PerconaTest::get_cmd_pid("$cmd 15")
1599+ or die "Cannot get PID of $cmd 15\n" . `ps xww`;
1600 my $proc_fd_0 = -l "/proc/$pid/0" ? "/proc/$pid/0"
1601 : -l "/proc/$pid/fd/0" ? "/proc/$pid/fd/0"
1602 : die "Cannot find fd 0 symlink in /proc/$pid";
1603@@ -150,38 +156,41 @@
1604 'Reopens STDIN to /dev/null'
1605 );
1606
1607- SKIP: {
1608- skip "-t is not reliable", 1;
1609- rm_tmp_files();
1610- system("echo foo | $cmd 5 --daemonize --pid $pid_file --log $log_file");
1611- PerconaTest::wait_for_files($pid_file, $log_file);
1612- chomp($pid = slurp_file($pid_file));
1613- $proc_fd_0 = -l "/proc/$pid/0" ? "/proc/$pid/0"
1614- : -l "/proc/$pid/fd/0" ? "/proc/$pid/fd/0"
1615- : die "Cannot find fd 0 symlink in /proc/$pid";
1616- PTDEVDEBUG && PerconaTest::_d('pid_file', $pid_file,
1617- 'pid', $pid, 'proc_fd_0', $proc_fd_0, `ls -l $proc_fd_0`);
1618- $stdin = readlink $proc_fd_0;
1619- like(
1620- $stdin,
1621- qr/pipe/,
1622- 'Does not reopen STDIN to /dev/null when piped',
1623- );
1624- rm_tmp_files();
1625- }
1626-};
1627+ PerconaTest::kill_program(pid => $pid);
1628+
1629+# SKIP: {
1630+# skip "-t is not reliable", 1;
1631+# rm_tmp_files();
1632+# system("echo foo | $cmd 5 --daemonize --pid $pid_file --log $log_file");
1633+# PerconaTest::wait_for_files($pid_file, $log_file);
1634+# chomp($pid = slurp_file($pid_file));
1635+# $proc_fd_0 = -l "/proc/$pid/0" ? "/proc/$pid/0"
1636+# : -l "/proc/$pid/fd/0" ? "/proc/$pid/fd/0"
1637+# : die "Cannot find fd 0 symlink in /proc/$pid";
1638+# PTDEVDEBUG && PerconaTest::_d('pid_file', $pid_file,
1639+# 'pid', $pid, 'proc_fd_0', $proc_fd_0, `ls -l $proc_fd_0`);
1640+# $stdin = readlink $proc_fd_0;
1641+# like(
1642+# $stdin,
1643+# qr/pipe/,
1644+# 'Does not reopen STDIN to /dev/null when piped',
1645+# );
1646+# rm_tmp_files();
1647+# }
1648+}
1649
1650 # ##########################################################################
1651 # Issue 419: Daemon should check wether process with pid obtained from
1652 # pid-file is still running
1653 # ##########################################################################
1654 rm_tmp_files();
1655-system("$cmd 5 --daemonize --pid $pid_file >/dev/null 2>&1");
1656+system("$cmd 7 --daemonize --pid $pid_file >/dev/null 2>&1");
1657 PerconaTest::wait_for_files($pid_file);
1658-chomp($pid = slurp_file($pid_file));
1659+$pid = PerconaTest::get_cmd_pid("$cmd 7")
1660+ or die "Cannot get PID of $cmd 7";
1661 kill 9, $pid;
1662 sleep 0.25;
1663-$output = `ps wx | grep '^[ ]*$pid' | grep -v grep`;
1664+(undef, $output) = PerconaTest::get_cmd_pid("$cmd 7");
1665 unlike(
1666 $output,
1667 qr/daemonize/,
1668@@ -194,11 +203,10 @@
1669
1670 my (undef, $tempfile) = tempfile();
1671
1672-system("$cmd 5 --daemonize --log $log_file --pid $pid_file > $tempfile 2>&1");
1673+system("$cmd 6 --daemonize --log $log_file --pid $pid_file > $tempfile 2>&1");
1674 PerconaTest::wait_for_files($log_file, $pid_file, $tempfile);
1675-
1676-$output = `ps wx | grep '$cmd 5' | grep -v grep`;
1677-chomp(my $new_pid = slurp_file($pid_file));
1678+my $new_pid;
1679+($new_pid, $output) = PerconaTest::get_cmd_pid("$cmd 6");
1680
1681 like(
1682 $output,
1683@@ -212,12 +220,14 @@
1684 'Says that old PID is not running (issue 419)'
1685 );
1686
1687-ok(
1688- $pid != $new_pid,
1689+cmp_ok(
1690+ $pid,
1691+ '!=',
1692+ $new_pid,
1693 'Overwrites PID file with new PID (issue 419)'
1694 );
1695
1696-PerconaTest::wait_until(sub { !-e $pid_file });
1697+PerconaTest::wait_until(sub { !-f $pid_file });
1698 ok(
1699 !-f $pid_file,
1700 'Re-used PID file still removed (issue 419)'
1701@@ -229,21 +239,17 @@
1702 # Check that it actually checks the running process.
1703 # ############################################################################
1704 rm_tmp_files();
1705-system("$cmd 20 --daemonize --log $log_file --pid $pid_file");
1706+system("$cmd 10 --daemonize --log $log_file --pid $pid_file");
1707 PerconaTest::wait_for_files($pid_file, $log_file);
1708 chomp($pid = slurp_file($pid_file));
1709-$output = `$cmd 0 --daemonize --pid $pid_file 2>&1`;
1710+$output = `$cmd 1 --daemonize --pid $pid_file 2>&1`;
1711 like(
1712 $output,
1713 qr/PID file $pid_file exists and PID $pid is running/,
1714 'Says that PID is running (issue 419)'
1715 );
1716
1717-if ( $pid ) {
1718- kill 9, $pid;
1719-}
1720-
1721-sleep 0.25;
1722+PerconaTest::kill_program(pid => $pid);
1723 rm_tmp_files();
1724
1725 # #############################################################################
1726
1727=== modified file 't/lib/OptionParser.t'
1728--- t/lib/OptionParser.t 2013-06-25 22:28:48 +0000
1729+++ t/lib/OptionParser.t 2013-08-13 03:46:05 +0000
1730@@ -2063,6 +2063,60 @@
1731 "set_vars(): var=0 (bug 1182856)"
1732 ) or diag(Dumper($vars));
1733
1734+
1735+# #############################################################################
1736+# https://bugs.launchpad.net/percona-toolkit/+bug/1199589
1737+# pt-archiver deletes data despite --dry-run
1738+# #############################################################################
1739+
1740+# From the issue: "One problem is that --optimize is not being used correctly:
1741+# the option takes an argument: d, s, or ds (see --analyze). The real problem
1742+# is that --optimize is consuming the next option, which is --dry-run in this
1743+# case. This shouldn't happen; it means the option parser is failing to notice
1744+# that --dry-run is not the string val to --optimize but rather an option;
1745+# it should catch this and the tool should fail to start with an error like
1746+# "--optimize requires a value".
1747+
1748+@ARGV = qw(--optimize --dry-run --ascend-first --where 1=1 --purge --source localhost);
1749+$o = new OptionParser(file => "$trunk/bin/pt-archiver");
1750+$o->get_specs();
1751+$o->get_opts();
1752+
1753+$output = output(
1754+ sub { $o->usage_or_errors(undef, 1); },
1755+);
1756+
1757+like(
1758+ $output,
1759+ qr/--optimize requires a string value/,
1760+ "String opts don't consume the next opt (bug 1199589)"
1761+);
1762+
1763+is(
1764+ $o->get('optimize'),
1765+ undef,
1766+ "--optimize didn't consume --dry-run (bug 1199589)"
1767+);
1768+
1769+@ARGV = qw(--optimize ds --dry-run --ascend-first --where 1=1 --purge --source localhost);
1770+$o->get_opts();
1771+
1772+$output = output(
1773+ sub { $o->usage_or_errors(undef, 1); },
1774+);
1775+
1776+is(
1777+ $output,
1778+ '',
1779+ "String opts still work (bug 1199589)"
1780+);
1781+
1782+is(
1783+ $o->get('optimize'),
1784+ 'ds',
1785+ "--optimize got its value (bug 1199589)"
1786+);
1787+
1788 # #############################################################################
1789 # Done.
1790 # #############################################################################
1791
1792=== modified file 't/lib/Percona/Toolkit.t'
1793--- t/lib/Percona/Toolkit.t 2013-01-18 23:21:10 +0000
1794+++ t/lib/Percona/Toolkit.t 2013-08-13 03:46:05 +0000
1795@@ -10,6 +10,7 @@
1796 use warnings FATAL => 'all';
1797 use English qw(-no_match_vars);
1798 use Test::More;
1799+use IPC::Cmd qw(can_run run);
1800
1801 use PerconaTest;
1802 use Percona::Toolkit;
1803@@ -70,7 +71,7 @@
1804 SKIP: {
1805 skip "Can't run bzr, skipping tag checking", 1 unless $bzr;
1806 chomp(my $root = `$bzr root 2>/dev/null`);
1807- skip '$trunk and bzr root differ, skipping tag checking'
1808+ skip '$trunk and bzr root differ, skipping tag checking', 1
1809 unless $root eq $trunk;
1810
1811 my @tags = split /\n/, `$bzr tags`;
1812
1813=== modified file 't/lib/Percona/WebAPI/Client.t'
1814--- t/lib/Percona/WebAPI/Client.t 2013-03-01 16:47:49 +0000
1815+++ t/lib/Percona/WebAPI/Client.t 2013-08-13 03:46:05 +0000
1816@@ -76,7 +76,7 @@
1817 is_deeply(
1818 $ua->{requests},
1819 [
1820- 'GET https://api.tools.percona.com',
1821+ 'GET https://cloud-api.percona.com',
1822 ],
1823 "1 request, 1 GET"
1824 ) or diag(Dumper($ua->{requests}));
1825@@ -195,6 +195,7 @@
1826 );
1827
1828 my $svc0 = Percona::WebAPI::Resource::Service->new(
1829+ ts => '123',
1830 name => 'query-monitor',
1831 run_schedule => '1 * * * *',
1832 spool_schedule => '2 * * * *',
1833
1834=== modified file 't/lib/QueryReportFormatter.t'
1835--- t/lib/QueryReportFormatter.t 2013-02-25 16:10:03 +0000
1836+++ t/lib/QueryReportFormatter.t 2013-08-13 03:46:05 +0000
1837@@ -1161,7 +1161,7 @@
1838 );
1839
1840 is(
1841- $qrf->files(files=>[qw(foo bar)]),
1842+ $qrf->files(files=>[{name=>"foo"},{name=>"bar"}]),
1843 "# Files: foo, bar\n",
1844 "files report"
1845 );
1846@@ -1211,7 +1211,7 @@
1847 worst => [['select col from tbl where id=?','top',1]],
1848 orderby => 'Query_time',
1849 groupby => 'fingerprint',
1850- files => [qw(foo bar)],
1851+ files => [{name=>"foo"},{name=>"bar"}],
1852 group => {map {$_=>1} qw(rusage date files header)},
1853 ); }
1854 );
1855
1856=== modified file 't/lib/VariableAdvisorRules.t'
1857--- t/lib/VariableAdvisorRules.t 2012-07-30 14:44:28 +0000
1858+++ t/lib/VariableAdvisorRules.t 2013-08-13 03:46:05 +0000
1859@@ -159,6 +159,7 @@
1860 },
1861 { name => "innodb_max_dirty_pages_pct",
1862 vars => [qw(innodb_max_dirty_pages_pct 89)],
1863+ mysql_version => VersionParser->new('5.1.59'),
1864 advice => [qw(innodb_max_dirty_pages_pct)],
1865 },
1866 { name => "key_buffer_size",
1867
1868=== modified file 't/lib/VersionCheck.t'
1869--- t/lib/VersionCheck.t 2013-02-21 07:41:57 +0000
1870+++ t/lib/VersionCheck.t 2013-08-13 03:46:05 +0000
1871@@ -700,6 +700,7 @@
1872
1873 foreach my $tool ( @vc_tools ) {
1874 my $tool_name = basename($tool);
1875+ next if $tool_name eq 'pt-agent';
1876 my $output = `$tool --help`;
1877 like(
1878 $output,
1879
1880=== added file 't/pt-archiver/bugs.t'
1881--- t/pt-archiver/bugs.t 1970-01-01 00:00:00 +0000
1882+++ t/pt-archiver/bugs.t 2013-08-13 03:46:05 +0000
1883@@ -0,0 +1,56 @@
1884+#!/usr/bin/env perl
1885+
1886+BEGIN {
1887+ die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
1888+ unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
1889+ unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
1890+};
1891+
1892+use strict;
1893+use warnings FATAL => 'all';
1894+use English qw(-no_match_vars);
1895+use Test::More;
1896+use Data::Dumper;
1897+
1898+use PerconaTest;
1899+use Sandbox;
1900+require "$trunk/bin/pt-archiver";
1901+
1902+my $dp = new DSNParser(opts=>$dsn_opts);
1903+my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
1904+my $master_dbh = $sb->get_dbh_for('master');
1905+
1906+if ( !$master_dbh ) {
1907+ plan skip_all => 'Cannot connect to sandbox master';
1908+}
1909+
1910+my $output;
1911+my $cnf = "/tmp/12345/my.sandbox.cnf";
1912+my $cmd = "$trunk/bin/pt-archiver";
1913+
1914+$sb->create_dbs($master_dbh, ['test']);
1915+$sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql');
1916+
1917+# ###########################################################################
1918+# pt-archiver deletes data despite --dry-run
1919+# https://bugs.launchpad.net/percona-toolkit/+bug/1199589
1920+# ###########################################################################
1921+
1922+my $rows_before = $master_dbh->selectall_arrayref("SELECT * FROM test.table_1 ORDER BY a");
1923+
1924+$output = `$cmd --optimize --dry-run --purge --where 1=1 --source D=test,t=table_1,F=$cnf 2>&1`;
1925+
1926+my $rows_after = $master_dbh->selectall_arrayref("SELECT * FROM test.table_1 ORDER BY a");
1927+
1928+is_deeply(
1929+ $rows_after,
1930+ $rows_before,
1931+ "--optimize does not consume --dry-run (bug 1199589)"
1932+) or diag(Dumper($rows_after));
1933+
1934+# #############################################################################
1935+# Done.
1936+# #############################################################################
1937+$sb->wipe_clean($master_dbh);
1938+ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
1939+done_testing;
1940
1941=== modified file 't/pt-diskstats/expected/all_int_bug-1035311.txt'
1942--- t/pt-diskstats/expected/all_int_bug-1035311.txt 2012-08-10 18:36:34 +0000
1943+++ t/pt-diskstats/expected/all_int_bug-1035311.txt 2013-08-13 03:46:05 +0000
1944@@ -1,4 +1,3 @@
1945-
1946 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
1947 1.0 xvda 29.2 13.9 0.4 0% 0.3 9.3 1.0 4.0 0.0 0% 0.0 0.0 6% 0 30.2 6.7 1.9
1948 1.0 xvda1 29.2 13.9 0.4 0% 0.3 9.3 0.0 0.0 0.0 0% 0.0 0.0 6% 0 29.2 7.0 2.0
1949@@ -7,7 +6,6 @@
1950 1.0 xvdb1 258.9 42.4 10.7 0% 2.3 9.1 152.8 36.6 5.5 27% 2.7 12.9 50% 37 411.6 9.7 1.1
1951 1.0 dm-0 258.9 42.4 10.7 0% 2.3 9.1 241.3 27.0 6.4 0% 2.9 11.9 50% 66 500.2 9.4 1.0
1952 1.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
1953-
1954 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
1955 2.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
1956 2.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1957@@ -17,7 +15,6 @@
1958 2.0 dm-0 181.4 40.3 7.1 0% 2.1 11.7 492.7 19.2 9.2 0% 5.2 10.5 69% 44 674.0 16.3 1.0
1959 2.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
1960 2.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1961-
1962 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
1963 3.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 7.0 11.4 0.1 65% 0.0 0.0 0% 0 7.0 0.0 0.0
1964 3.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1965@@ -27,7 +24,6 @@
1966 3.0 dm-0 137.0 39.9 5.3 0% 5.8 42.3 668.8 25.0 16.3 0% 23.3 34.9 97% 29 805.8 30.3 1.2
1967 3.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 20.0 4.0 0.1 0% 0.0 0.0 0% 0 20.0 0.0 0.0
1968 3.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1969-
1970 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
1971 4.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 2.0 4.0 0.0 0% 0.0 0.0 0% 0 2.0 0.0 0.0
1972 4.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1973@@ -37,7 +33,6 @@
1974 4.0 dm-0 272.5 42.0 11.2 0% 3.1 11.5 650.6 22.1 14.0 0% 10.1 15.5 78% 30 923.1 13.5 0.8
1975 4.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 2.0 4.0 0.0 0% 0.0 0.0 0% 0 2.0 0.0 0.0
1976 4.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1977-
1978 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
1979 5.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1980 5.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1981@@ -47,7 +42,6 @@
1982 5.0 dm-0 201.3 40.5 8.0 0% 2.6 13.0 643.5 17.8 11.2 0% 9.4 14.7 86% 50 844.8 13.7 1.0
1983 5.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1984 5.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1985-
1986 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
1987 6.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
1988 6.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1989@@ -57,7 +51,6 @@
1990 6.0 dm-0 206.9 39.9 8.1 0% 3.3 16.1 664.7 19.1 12.4 0% 10.0 15.0 92% 43 871.6 15.5 1.1
1991 6.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
1992 6.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1993-
1994 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
1995 7.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 6.0 7.3 0.0 45% 0.4 40.0 20% 0 6.0 21.8 18.2
1996 7.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
1997@@ -67,7 +60,6 @@
1998 7.0 dm-0 224.5 38.2 8.4 0% 4.1 18.4 261.6 24.0 6.1 0% 6.6 25.2 92% 22 486.2 19.1 1.9
1999 7.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2000 7.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 10.0 4.0 0.0 0% 0.6 56.0 20% 0 10.0 36.0 20.0
2001-
2002 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2003 8.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 3.0 13.3 0.0 70% 0.0 1.0 1% 0 3.0 0.0 1.0
2004 8.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2005@@ -77,7 +69,6 @@
2006 8.0 dm-0 93.0 37.8 3.4 0% 5.3 56.9 409.9 28.4 11.4 0% 13.2 32.2 94% 37 502.9 34.6 1.9
2007 8.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 10.0 4.0 0.0 0% 0.0 1.0 1% 0 10.0 0.0 1.0
2008 8.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2009-
2010 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2011 9.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2012 9.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2013@@ -87,7 +78,6 @@
2014 9.0 dm-0 180.9 37.5 6.6 0% 5.7 31.7 749.8 22.1 16.2 0% 28.2 37.5 99% 27 930.7 34.8 1.1
2015 9.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2016 9.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2017-
2018 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2019 10.0 xvda 8.6 16.0 0.1 10% 0.1 8.0 1.0 4.0 0.0 0% 0.0 0.0 4% 0 9.6 3.6 3.6
2020 10.0 xvda1 8.6 16.0 0.1 10% 0.1 8.0 0.0 0.0 0.0 0% 0.0 0.0 4% 0 8.6 4.0 4.0
2021@@ -97,7 +87,6 @@
2022 10.0 dm-0 279.1 37.5 10.2 0% 3.3 11.7 516.0 24.2 12.2 0% 4.7 9.2 92% 89 795.1 8.6 1.2
2023 10.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2024 10.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2025-
2026 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2027 11.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 2.1 4.0 0.0 0% 0.0 5.0 1% 0 2.1 0.0 5.0
2028 11.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2029@@ -107,7 +96,6 @@
2030 11.0 dm-0 114.3 36.7 4.1 0% 5.8 50.7 212.9 21.5 4.5 0% 6.1 28.8 92% 7 327.2 42.7 2.8
2031 11.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 10.0 1% 0 1.0 0.0 10.0
2032 11.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2033-
2034 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2035 12.0 xvda 2.0 6.0 0.0 0% 0.0 20.0 2.0 4.0 0.0 0% 0.0 0.0 2% 0 3.9 5.0 5.0
2036 12.0 xvda1 2.0 6.0 0.0 0% 0.0 20.0 0.0 0.0 0.0 0% 0.0 0.0 2% 0 2.0 10.0 10.0
2037@@ -117,7 +105,6 @@
2038 12.0 dm-0 72.1 39.0 2.7 0% 5.6 77.8 127.4 35.5 4.4 0% 3.1 24.6 100% 31 199.4 37.1 5.0
2039 12.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 2.0 4.0 0.0 0% 0.0 0.0 0% 0 2.0 0.0 0.0
2040 12.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2041-
2042 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2043 13.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 41.6 41.8 1.7 18% 0.5 9.0 2% 0 41.6 8.6 0.4
2044 13.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2045@@ -127,7 +114,6 @@
2046 13.0 dm-0 94.3 41.4 3.8 0% 5.4 57.7 602.6 24.7 14.5 0% 15.8 26.2 97% 144 696.9 27.5 1.4
2047 13.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 50.7 34.2 1.7 0% 0.6 12.6 2% 0 50.7 12.2 0.4
2048 13.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2049-
2050 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2051 14.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 10.0 1% 0 1.0 0.0 10.0
2052 14.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2053@@ -137,7 +123,6 @@
2054 14.0 dm-0 269.7 39.9 10.5 0% 4.2 15.5 733.8 18.9 13.5 0% 19.9 27.1 88% 2 1003.4 23.8 0.9
2055 14.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 10.0 1% 0 1.0 0.0 10.0
2056 14.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2057-
2058 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2059 15.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 1% 1 1.0 -5.0 10.0
2060 15.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2061@@ -147,7 +132,6 @@
2062 15.0 dm-0 179.2 40.0 7.0 0% 2.0 11.0 256.4 11.1 2.8 0% 1.6 6.4 76% 7 435.5 10.5 1.8
2063 15.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 2.0 4.0 0.0 0% 0.0 0.0 1% 1 2.0 -1.7 5.0
2064 15.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2065-
2066 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2067 16.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 2.0 4.0 0.0 0% 0.2 120.0 23% 0 2.0 115.0 115.0
2068 16.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2069@@ -157,7 +141,6 @@
2070 16.0 dm-0 224.4 41.7 9.1 0% 5.9 26.4 296.2 18.6 5.4 0% 4.3 14.5 89% 1 520.6 14.6 1.7
2071 16.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.2 240.0 23% 0 1.0 0.0 230.0
2072 16.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2073-
2074 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2075 17.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 2.0 12.0 0.0 67% 0.0 0.0 1% 1 2.0 -0.2 1.7
2076 17.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2077@@ -167,7 +150,6 @@
2078 17.0 dm-0 220.0 42.1 9.0 0% 1.0 4.6 580.1 5.9 3.3 0% 1.6 2.7 52% 7 800.1 2.6 0.7
2079 17.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 1% 1 1.0 -5.0 10.0
2080 17.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 6.0 4.0 0.0 0% 0.0 0.0 0% 0 6.0 0.0 0.0
2081-
2082 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2083 18.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 5.0 9.6 0.0 58% 0.0 0.8 0% 0 5.0 0.0 0.0
2084 18.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2085@@ -177,7 +159,6 @@
2086 18.0 dm-0 97.1 42.4 4.0 0% 4.6 47.4 133.2 8.2 1.1 0% 2.4 17.9 85% 1 230.3 27.4 3.7
2087 18.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 11.0 4.0 0.0 0% 0.0 0.9 0% 0 11.0 0.0 0.0
2088 18.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2089-
2090 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2091 19.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2092 19.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2093@@ -187,7 +168,6 @@
2094 19.0 dm-0 119.5 42.7 5.0 0% 4.8 40.2 218.0 9.5 2.0 0% 2.7 12.6 86% 0 337.5 19.9 2.5
2095 19.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2096 19.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2097-
2098 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2099 20.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2100 20.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2101@@ -197,7 +177,6 @@
2102 20.0 dm-0 172.1 42.0 7.1 0% 4.9 28.2 113.1 10.3 1.1 0% 1.1 9.3 86% 7 285.2 17.4 3.0
2103 20.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2104 20.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2105-
2106 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2107 21.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 3.0 4.0 0.0 0% 0.0 0.0 0% 0 3.0 0.0 0.0
2108 21.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2109@@ -207,7 +186,6 @@
2110 21.0 dm-0 244.0 42.3 10.1 0% 1.8 7.5 454.9 8.5 3.8 0% 1.8 4.0 44% 0 698.9 4.6 0.6
2111 21.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 2.0 4.0 0.0 0% 0.0 0.0 0% 0 2.0 0.0 0.0
2112 21.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2113-
2114 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2115 22.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2116 22.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2117@@ -217,7 +195,6 @@
2118 22.0 dm-0 234.7 40.5 9.3 0% 2.5 10.7 559.2 7.5 4.1 0% 2.2 4.0 69% 0 793.9 5.1 0.9
2119 22.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2120 22.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2121-
2122 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2123 23.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 3.0 14.7 0.0 73% 0.0 0.0 0% 0 3.0 0.0 0.0
2124 23.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2125@@ -227,7 +204,6 @@
2126 23.0 dm-0 217.1 42.4 9.0 0% 1.8 8.4 267.8 11.4 3.0 0% 1.1 4.2 46% 0 484.9 5.2 0.9
2127 23.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 11.0 4.0 0.0 0% 0.0 0.0 0% 0 11.0 0.0 0.0
2128 23.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2129-
2130 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2131 24.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2132 24.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2133@@ -237,7 +213,6 @@
2134 24.0 dm-0 80.2 42.0 3.3 0% 3.6 45.2 234.6 9.0 2.1 0% 6.0 25.7 77% 35 314.9 53.9 2.5
2135 24.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2136 24.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2137-
2138 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2139 25.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2140 25.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2141@@ -247,7 +222,6 @@
2142 25.0 dm-0 114.0 39.9 4.4 0% 6.0 52.5 244.0 18.8 4.5 0% 17.4 71.2 93% 12 358.0 37.6 2.6
2143 25.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2144 25.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2145-
2146 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2147 26.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2148 26.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2149@@ -257,7 +231,6 @@
2150 26.0 dm-0 225.5 42.3 9.3 0% 2.1 9.3 402.0 7.0 2.7 0% 1.5 3.6 73% 8 627.5 6.4 1.2
2151 26.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2152 26.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2153-
2154 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2155 27.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 3.0 9.3 0.0 57% 0.0 0.0 0% 0 3.0 0.0 0.0
2156 27.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2157@@ -267,7 +240,6 @@
2158 27.0 dm-0 221.8 42.7 9.2 0% 3.8 17.0 175.8 13.3 2.3 0% 1.1 6.2 53% 0 397.7 7.7 1.3
2159 27.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 1.0 4.0 0.0 0% 0.0 0.0 0% 0 1.0 0.0 0.0
2160 27.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 6.0 4.0 0.0 0% 0.0 0.0 0% 0 6.0 0.0 0.0
2161-
2162 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2163 28.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 3.0 20.0 0.1 0% 0.0 0.0 0% 0 3.0 0.0 0.0
2164 28.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2165@@ -277,7 +249,6 @@
2166 28.0 dm-0 162.6 42.5 6.7 0% 2.2 13.4 139.6 11.6 1.6 0% 1.0 7.4 61% 8 302.2 10.4 2.0
2167 28.0 dm-1 0.0 0.0 0.0 0% 0.0 0.0 3.0 20.0 0.1 0% 0.0 0.0 0% 0 3.0 0.0 0.0
2168 28.0 dm-3 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2169-
2170 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2171 29.0 xvda 0.0 0.0 0.0 0% 0.0 0.0 3.0 17.3 0.1 77% 0.0 0.0 0% 0 3.0 0.0 0.0
2172 29.0 xvda1 0.0 0.0 0.0 0% 0.0 0.0 0.0 0.0 0.0 0% 0.0 0.0 0% 0 0.0 0.0 0.0
2173@@ -310,7 +281,6 @@
2174 20.0 {8} 504.4 42.0 20.7 0% 1.8 28.9 320.2 10.9 3.4 0% 0.4 9.8 32% 21 824.6 18.0 3.1
2175 21.0 {8} 744.0 42.3 30.8 0% 0.7 7.4 1223.0 9.5 11.3 5% 0.6 3.5 17% 0 1967.1 4.2 0.7
2176 22.0 {8} 704.0 40.5 27.9 0% 0.9 10.7 1473.0 8.6 12.3 3% 0.8 4.2 26% 0 2177.0 5.3 0.9
2177- #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2178 23.0 {8} 651.2 42.4 27.0 0% 0.7 8.4 720.9 12.9 9.1 9% 0.4 3.9 17% 0 1372.1 5.0 1.0
2179 24.0 {8} 228.6 42.0 9.4 0% 1.4 47.7 566.5 7.0 3.9 0% 2.3 31.9 29% 105 795.2 62.9 2.9
2180 25.0 {8} 342.0 39.9 13.3 0% 2.2 52.5 733.1 22.0 15.7 3% 6.5 68.3 35% 34 1075.1 32.8 2.5
2181@@ -334,7 +304,6 @@
2182 13.0 xvdb1 94.3 41.4 3.8 0% 5.4 57.7 377.4 32.0 11.8 28% 12.4 23.5 97% 106 471.7 24.8 1.6
2183 14.0 xvdb1 272.7 40.4 10.8 1% 4.1 14.9 658.6 26.8 17.3 19% 15.6 19.3 88% 2 931.3 15.5 0.8
2184 15.0 xvdb1 173.2 39.9 6.8 0% 2.0 11.4 215.8 13.3 2.8 9% 1.3 5.5 76% 7 389.0 10.3 1.9
2185- #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2186 16.0 xvdb1 230.5 41.8 9.4 0% 5.9 25.7 277.0 19.9 5.4 0% 4.3 15.5 88% 1 507.5 14.7 1.7
2187 17.0 xvdb1 214.0 42.1 8.8 0% 1.0 4.8 481.1 7.1 3.3 3% 1.4 2.8 54% 7 695.1 2.6 0.8
2188 18.0 xvdb1 103.1 42.4 4.3 0% 4.6 44.8 122.2 9.0 1.1 0% 2.4 19.5 85% 1 225.3 27.1 3.8
2189
2190=== modified file 't/pt-diskstats/expected/disk_int_bug-1035311.txt'
2191--- t/pt-diskstats/expected/disk_int_bug-1035311.txt 2012-08-10 18:36:34 +0000
2192+++ t/pt-diskstats/expected/disk_int_bug-1035311.txt 2013-08-13 03:46:05 +0000
2193@@ -1,4 +1,3 @@
2194-
2195 #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2196 {29} xvda 1.4 14.0 0.0 2% 0.0 9.5 3.4 22.5 0.1 40% 0.0 7.0 2% 0 4.8 4.5 3.0
2197 {29} xvda1 1.4 14.0 0.0 2% 0.0 9.5 0.0 0.0 0.0 0% 0.0 0.0 0% 0 1.4 6.4 2.9
2198@@ -31,7 +30,6 @@
2199 20.0 {8} 504.4 42.0 20.7 0% 1.8 28.9 320.2 10.9 3.4 0% 0.4 9.8 32% 21 824.6 18.0 3.1
2200 21.0 {8} 744.0 42.3 30.8 0% 0.7 7.4 1223.0 9.5 11.3 5% 0.6 3.5 17% 0 1967.1 4.2 0.7
2201 22.0 {8} 704.0 40.5 27.9 0% 0.9 10.7 1473.0 8.6 12.3 3% 0.8 4.2 26% 0 2177.0 5.3 0.9
2202- #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2203 23.0 {8} 651.2 42.4 27.0 0% 0.7 8.4 720.9 12.9 9.1 9% 0.4 3.9 17% 0 1372.1 5.0 1.0
2204 24.0 {8} 228.6 42.0 9.4 0% 1.4 47.7 566.5 7.0 3.9 0% 2.3 31.9 29% 105 795.2 62.9 2.9
2205 25.0 {8} 342.0 39.9 13.3 0% 2.2 52.5 733.1 22.0 15.7 3% 6.5 68.3 35% 34 1075.1 32.8 2.5
2206@@ -55,7 +53,6 @@
2207 13.0 xvdb1 94.3 41.4 3.8 0% 5.4 57.7 377.4 32.0 11.8 28% 12.4 23.5 97% 106 471.7 24.8 1.6
2208 14.0 xvdb1 272.7 40.4 10.8 1% 4.1 14.9 658.6 26.8 17.3 19% 15.6 19.3 88% 2 931.3 15.5 0.8
2209 15.0 xvdb1 173.2 39.9 6.8 0% 2.0 11.4 215.8 13.3 2.8 9% 1.3 5.5 76% 7 389.0 10.3 1.9
2210- #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2211 16.0 xvdb1 230.5 41.8 9.4 0% 5.9 25.7 277.0 19.9 5.4 0% 4.3 15.5 88% 1 507.5 14.7 1.7
2212 17.0 xvdb1 214.0 42.1 8.8 0% 1.0 4.8 481.1 7.1 3.3 3% 1.4 2.8 54% 7 695.1 2.6 0.8
2213 18.0 xvdb1 103.1 42.4 4.3 0% 4.6 44.8 122.2 9.0 1.1 0% 2.4 19.5 85% 1 225.3 27.1 3.8
2214
2215=== modified file 't/pt-diskstats/expected/sample_int_bug-1035311.txt'
2216--- t/pt-diskstats/expected/sample_int_bug-1035311.txt 2012-08-10 18:36:34 +0000
2217+++ t/pt-diskstats/expected/sample_int_bug-1035311.txt 2013-08-13 03:46:05 +0000
2218@@ -7,7 +7,6 @@
2219 6.0 {8} 620.7 39.9 24.2 0% 1.3 16.2 1751.2 21.8 37.2 10% 3.0 12.4 34% 93 2371.9 12.5 1.1
2220 7.0 {8} 661.6 38.2 24.6 0% 1.6 18.8 763.8 25.2 18.8 8% 2.2 21.0 42% 66 1425.4 16.1 2.3
2221 8.0 {8} 276.9 38.1 10.3 1% 2.0 56.7 1081.7 31.2 33.0 12% 4.4 28.4 36% 111 1358.7 30.1 1.9
2222- #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2223 9.0 {8} 554.8 37.6 20.4 0% 2.1 31.0 1952.4 26.4 50.3 14% 8.6 30.1 37% 55 2507.3 27.6 1.0
2224 10.0 {8} 843.1 37.0 30.5 0% 1.2 11.7 1351.4 26.5 34.9 8% 1.6 8.8 35% 199 2194.5 8.2 1.2
2225 11.0 {8} 342.8 36.7 12.3 0% 2.2 50.7 678.3 24.3 16.1 8% 1.9 21.1 35% 21 1021.1 25.4 2.6
2226@@ -31,7 +30,6 @@
2227 29.0 {8} 682.9 42.4 28.3 0% 1.6 18.5 938.3 14.6 13.4 11% 2.0 14.9 34% 0 1621.2 13.7 1.6
2228 Enter a disk/device pattern: #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2229 1.0 xvdb1 258.9 42.4 10.7 0% 2.3 9.1 152.8 36.6 5.5 27% 2.7 12.9 50% 37 411.6 9.6 1.1
2230- #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2231 2.0 xvdb1 177.3 40.3 7.0 0% 2.1 12.0 409.2 21.5 8.6 12% 3.6 7.7 69% 44 586.4 13.5 1.1
2232 3.0 xvdb1 135.0 39.9 5.3 0% 5.8 42.9 515.9 33.7 17.0 25% 18.9 27.6 97% 29 650.8 22.9 1.2
2233 4.0 xvdb1 272.5 42.0 11.2 0% 3.1 11.5 520.3 27.5 14.0 18% 7.4 11.7 78% 30 792.8 10.4 0.9
2234@@ -55,7 +53,6 @@
2235 22.0 xvdb1 234.7 40.5 9.3 0% 2.5 10.7 455.4 9.2 4.1 4% 2.1 4.3 69% 0 690.1 5.5 1.0
2236 23.0 xvdb1 217.1 42.4 9.0 0% 1.8 8.4 218.1 14.0 3.0 11% 1.0 4.0 46% 0 435.1 5.1 1.0
2237 24.0 xvdb1 74.2 41.9 3.0 0% 3.6 49.1 164.4 5.7 0.9 0% 6.0 36.6 77% 35 238.6 68.9 3.2
2238- #ts device rd_s rd_avkb rd_mb_s rd_mrg rd_cnc rd_rt wr_s wr_avkb wr_mb_s wr_mrg wr_cnc wr_rt busy in_prg io_s qtime stime
2239 25.0 xvdb1 114.0 39.9 4.4 0% 6.0 52.5 243.0 23.7 5.6 5% 17.2 67.4 93% 11 357.0 32.4 2.5
2240 26.0 xvdb1 225.5 42.3 9.3 0% 2.1 9.3 329.8 8.5 2.7 6% 1.3 3.6 73% 8 555.3 6.5 1.3
2241 27.0 xvdb1 227.8 42.7 9.5 0% 3.8 16.6 161.9 14.5 2.3 3% 1.1 6.5 53% 0 389.7 7.6 1.3
2242
2243=== modified file 't/pt-diskstats/pt-diskstats.t'
2244--- t/pt-diskstats/pt-diskstats.t 2012-08-10 18:36:34 +0000
2245+++ t/pt-diskstats/pt-diskstats.t 2013-08-13 03:46:05 +0000
2246@@ -10,8 +10,7 @@
2247 use warnings FATAL => 'all';
2248 use English qw(-no_match_vars);
2249 use Test::More;
2250-
2251-use File::Temp ();
2252+use File::Temp qw();
2253
2254 use PerconaTest;
2255 require "$trunk/bin/pt-diskstats";
2256@@ -28,46 +27,45 @@
2257 # of this file about *DATA. Please don't close it.
2258 my $called_seek_on_handle = 0;
2259 {
2260-$TestInteractive::first = 1;
2261-sub TestInteractive::TIEHANDLE {
2262- my ($class, @cmds) = @_;
2263- push @cmds, "q";
2264- return bless \@cmds, $class;
2265-}
2266-
2267-sub TestInteractive::FILENO {
2268- return fileno(*DATA);
2269-}
2270-
2271-sub TestInteractive::READLINE {
2272- my ($self) = @_;
2273- my $cmd = shift @$self;
2274- return unless $cmd;
2275- print $cmd if $cmd =~ /\n/ && !-t STDOUT;
2276- if ($cmd =~ /^TS/) {
2277- if ( $TestInteractive::first ) {
2278- $TestInteractive::first = 0;
2279- }
2280- else {
2281- splice @$self, 1, 0, (undef) x 50;
2282- }
2283- }
2284- return $cmd;
2285-}
2286-
2287-sub TestInteractive::EOF {
2288- my ($self) = @_;
2289- return @$self ? undef : 1;
2290-}
2291-
2292-sub TestInteractive::CLOSE { 1 }
2293-
2294-sub TestInteractive::TELL {}
2295-
2296-sub TestInteractive::SEEK {
2297- $called_seek_on_handle++;
2298-}
2299-
2300+ $TestInteractive::first = 1;
2301+ sub TestInteractive::TIEHANDLE {
2302+ my ($class, @cmds) = @_;
2303+ push @cmds, "q";
2304+ return bless \@cmds, $class;
2305+ }
2306+
2307+ sub TestInteractive::FILENO {
2308+ return fileno(*DATA);
2309+ }
2310+
2311+ sub TestInteractive::READLINE {
2312+ my ($self) = @_;
2313+ my $cmd = shift @$self;
2314+ return unless $cmd;
2315+ print $cmd if $cmd =~ /\n/ && !-t STDOUT;
2316+ if ($cmd =~ /^TS/) {
2317+ if ( $TestInteractive::first ) {
2318+ $TestInteractive::first = 0;
2319+ }
2320+ else {
2321+ splice @$self, 1, 0, (undef) x 50;
2322+ }
2323+ }
2324+ return $cmd;
2325+ }
2326+
2327+ sub TestInteractive::EOF {
2328+ my ($self) = @_;
2329+ return @$self ? undef : 1;
2330+ }
2331+
2332+ sub TestInteractive::CLOSE { 1 }
2333+
2334+ sub TestInteractive::TELL {}
2335+
2336+ sub TestInteractive::SEEK {
2337+ $called_seek_on_handle++;
2338+ }
2339 }
2340
2341 sub test_diskstats_file {
2342@@ -88,6 +86,7 @@
2343 );
2344 die "$file does not exist" unless -f $file;
2345 foreach my $groupby ( qw(all disk sample) ) {
2346+ my $expect_file = "${groupby}_int_$args{file}";
2347 ok(
2348 no_diff(
2349 sub {
2350@@ -99,11 +98,10 @@
2351 '--group-by', $groupby,
2352 $file);
2353 },
2354- "t/pt-diskstats/expected/${groupby}_int_$args{file}",
2355- keep_output=>1,
2356+ "t/pt-diskstats/expected/$expect_file",
2357 ),
2358 "$args{file} --group-by $groupby, commands: [$print_cmds]"
2359- );
2360+ ) or diag($expect_file, $test_diff);
2361 }
2362 }
2363
2364@@ -133,14 +131,17 @@
2365 test_diskstats_file(
2366 file => "bug-1035311.txt",
2367 commands => [ "S", "/", 'xvdb1', "q" ],
2368- options => [],
2369+ options => [ '--headers', ''],
2370 );
2371
2372 # ###########################################################################
2373 # --save-samples and --iterations
2374 # ###########################################################################
2375
2376-my ($fh, $tempfile) = File::Temp::tempfile( "pt-diskstats.test.$PID.XXXXXX", OPEN => 0);
2377+my (undef, $tempfile) = File::Temp::tempfile(
2378+ "/tmp/pt-diskstats.test.XXXXXX",
2379+ OPEN => 0,
2380+);
2381
2382 my $iterations = 2;
2383 my $out = output( sub {
2384@@ -155,19 +156,17 @@
2385
2386 open my $samples_fh, "<", $tempfile
2387 or die "Cannot open $tempfile: $OS_ERROR";
2388-
2389 my $count;
2390 while (my $line = <$samples_fh>) {
2391 $count++ if $line =~ /^TS/;
2392 }
2393-
2394+close $samples_fh or diag($EVAL_ERROR);
2395+unlink $tempfile or diag($EVAL_ERROR);
2396 ok(
2397 ($count == $iterations) || ($count == $iterations+1),
2398 "--save-samples and --iterations work"
2399 );
2400
2401-1 while unlink $tempfile;
2402-
2403 # ###########################################################################
2404 # Done.
2405 # ###########################################################################
2406
2407=== modified file 't/pt-mext/pt-mext.t'
2408--- t/pt-mext/pt-mext.t 2013-04-03 23:42:10 +0000
2409+++ t/pt-mext/pt-mext.t 2013-08-13 03:46:05 +0000
2410@@ -26,6 +26,7 @@
2411 no_diff(
2412 "$cmd -- cat $sample/mext-001.txt",
2413 "t/pt-mext/samples/mext-001-result.txt",
2414+ post_pipe => "LANG=C sort -k1,1",
2415 ),
2416 "mext-001"
2417 ) or diag($test_diff);
2418@@ -34,6 +35,7 @@
2419 no_diff(
2420 "$cmd -r -- cat $sample/mext-002.txt",
2421 "t/pt-mext/samples/mext-002-result.txt",
2422+ post_pipe => "LANG=C sort -k1,1",
2423 ),
2424 "mext-002 -r"
2425 ) or diag($test_diff);
2426
2427=== modified file 't/pt-stalk/pt-stalk.t'
2428--- t/pt-stalk/pt-stalk.t 2013-04-08 13:13:56 +0000
2429+++ t/pt-stalk/pt-stalk.t 2013-08-13 03:46:05 +0000
2430@@ -79,7 +79,6 @@
2431 # As of v2.1.9 when --verbose was added, non-matching checks are not
2432 # printed by default. So we use the --plugin to tell us when the tool
2433 # has completed a cycle.
2434-
2435 $retval = system("$trunk/bin/pt-stalk --daemonize --pid $pid_file --log $log_file --dest $dest --plugin $trunk/t/pt-stalk/samples/plugin002.sh -- --defaults-file=$cnf");
2436
2437 is(

Subscribers

People subscribed via source and target branches