Merge lp:~percona-toolkit-dev/percona-toolkit/release-2.2.10 into lp:percona-toolkit/2.2
- release-2.2.10
- Merge into 2.2
Proposed by
Tomislav Plavcic
Status: | Merged |
---|---|
Merged at revision: | 609 |
Proposed branch: | lp:~percona-toolkit-dev/percona-toolkit/release-2.2.10 |
Merge into: | lp:percona-toolkit/2.2 |
Diff against target: |
1855 lines (+521/-273) 57 files modified
Changelog (+9/-1) Makefile.PL (+1/-1) bin/pt-align (+1/-1) 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 (+1/-1) bin/pt-find (+2/-2) bin/pt-fingerprint (+1/-1) bin/pt-fk-error-logger (+2/-2) bin/pt-heartbeat (+2/-2) bin/pt-index-usage (+25/-11) bin/pt-ioprofile (+1/-1) bin/pt-kill (+2/-2) bin/pt-mext (+3/-2) bin/pt-mysql-summary (+3/-2) bin/pt-online-schema-change (+45/-37) bin/pt-pmp (+1/-1) bin/pt-query-digest (+14/-8) bin/pt-show-grants (+1/-1) bin/pt-sift (+1/-1) bin/pt-slave-delay (+2/-2) bin/pt-slave-find (+1/-1) bin/pt-slave-restart (+2/-2) bin/pt-stalk (+1/-1) bin/pt-summary (+3/-2) bin/pt-table-checksum (+43/-19) bin/pt-table-sync (+2/-2) bin/pt-table-usage (+42/-17) bin/pt-upgrade (+25/-11) bin/pt-variable-advisor (+2/-2) bin/pt-visual-explain (+1/-1) config/deb/changelog (+11/-0) config/sphinx-build/conf.py (+1/-1) docs/percona-toolkit.pod (+1/-1) docs/release_notes.rst (+29/-0) lib/MySQLStatusWaiter.pm (+3/-2) lib/Percona/Toolkit.pm (+1/-1) lib/RowChecksum.pm (+22/-13) lib/SlowLogParser.pm (+14/-6) lib/bash/parse_options.sh (+2/-1) t/lib/MySQLStatusWaiter.t (+18/-14) t/lib/SlowLogParser.t (+64/-0) t/lib/samples/slowlogs/slow060.txt (+10/-0) t/lib/samples/slowlogs/slow061.txt (+10/-0) t/pt-online-schema-change/bug-1315130.t (+0/-78) t/pt-online-schema-change/bugs.t (+64/-0) t/pt-online-schema-change/samples/bug-1340728.sql (+10/-0) t/pt-online-schema-change/samples/bug-1340728_cleanup.sql (+2/-0) t/pt-query-digest/since_until.t (+3/-3) t/pt-table-checksum/basics.t (+3/-2) t/pt-table-checksum/samples/default-results-5.5.txt (+1/-1) t/pt-table-checksum/samples/default-results-5.6.txt (+1/-1) t/pt-table-checksum/samples/static-chunk-size-results-5.5.txt (+1/-1) t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt (+1/-1) |
To merge this branch: | bzr merge lp:~percona-toolkit-dev/percona-toolkit/release-2.2.10 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Nichter | Pending | ||
Review via email: mp+230115@code.launchpad.net |
Commit message
Description of the change
Release branch for Percona Toolkit version 2.2.10
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Changelog' | |||
2 | --- Changelog 2014-07-08 12:06:12 +0000 | |||
3 | +++ Changelog 2014-08-08 14:10:17 +0000 | |||
4 | @@ -1,8 +1,16 @@ | |||
5 | 1 | Changelog for Percona Toolkit | 1 | Changelog for Percona Toolkit |
6 | 2 | 2 | ||
7 | 3 | v2.2.10 released 2014-08-06 | ||
8 | 4 | |||
9 | 5 | * Fixed bug 1287253: pt-table-checksum deadlock | ||
10 | 6 | * Fixed bug 1299387: 5.6 slow query log Thead_id becomes Id | ||
11 | 7 | * Fixed bug 1311654: pt-table-checksum + PXC inconsistent results upon --resume | ||
12 | 8 | * Fixed bug 1340728: pt-online-schema-change doesn't work with HASH indexes | ||
13 | 9 | * Fixed bug 1253872: pt-table-checksum max load 20% rounds down | ||
14 | 10 | * Fixed bug 1340364: some shell tools output error when queried for --version | ||
15 | 11 | |||
16 | 3 | v2.2.9 released 2014-07-08 | 12 | v2.2.9 released 2014-07-08 |
17 | 4 | 13 | ||
18 | 5 | |||
19 | 6 | * Fixed bug 1258135: pt-deadlock-logger introduces a noise to MySQL | 14 | * Fixed bug 1258135: pt-deadlock-logger introduces a noise to MySQL |
20 | 7 | * Fixed bug 1329422: pt-online-schema-change foreign-keys-method=none breaks constraints | 15 | * Fixed bug 1329422: pt-online-schema-change foreign-keys-method=none breaks constraints |
21 | 8 | * Fixed bug 1315130: pt-online-schema-change not properly detecting foreign keys | 16 | * Fixed bug 1315130: pt-online-schema-change not properly detecting foreign keys |
22 | 9 | 17 | ||
23 | === modified file 'Makefile.PL' | |||
24 | --- Makefile.PL 2014-07-08 12:06:12 +0000 | |||
25 | +++ Makefile.PL 2014-08-08 14:10:17 +0000 | |||
26 | @@ -2,7 +2,7 @@ | |||
27 | 2 | 2 | ||
28 | 3 | WriteMakefile( | 3 | WriteMakefile( |
29 | 4 | NAME => 'percona-toolkit', | 4 | NAME => 'percona-toolkit', |
31 | 5 | VERSION => '2.2.9', | 5 | VERSION => '2.2.10', |
32 | 6 | EXE_FILES => [ <bin/*> ], | 6 | EXE_FILES => [ <bin/*> ], |
33 | 7 | MAN1PODS => { | 7 | MAN1PODS => { |
34 | 8 | 'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p', | 8 | 'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p', |
35 | 9 | 9 | ||
36 | === modified file 'bin/pt-align' | |||
37 | --- bin/pt-align 2014-07-04 17:16:08 +0000 | |||
38 | +++ bin/pt-align 2014-08-08 14:10:17 +0000 | |||
39 | @@ -1323,6 +1323,6 @@ | |||
40 | 1323 | 1323 | ||
41 | 1324 | =head1 VERSION | 1324 | =head1 VERSION |
42 | 1325 | 1325 | ||
44 | 1326 | pt-align 2.2.9 | 1326 | pt-align 2.2.10 |
45 | 1327 | 1327 | ||
46 | 1328 | =cut | 1328 | =cut |
47 | 1329 | 1329 | ||
48 | === modified file 'bin/pt-archiver' | |||
49 | --- bin/pt-archiver 2014-07-04 17:16:08 +0000 | |||
50 | +++ bin/pt-archiver 2014-08-08 14:10:17 +0000 | |||
51 | @@ -43,7 +43,7 @@ | |||
52 | 43 | { | 43 | { |
53 | 44 | package Percona::Toolkit; | 44 | package Percona::Toolkit; |
54 | 45 | 45 | ||
56 | 46 | our $VERSION = '2.2.9'; | 46 | our $VERSION = '2.2.10'; |
57 | 47 | 47 | ||
58 | 48 | use strict; | 48 | use strict; |
59 | 49 | use warnings FATAL => 'all'; | 49 | use warnings FATAL => 'all'; |
60 | @@ -7892,6 +7892,6 @@ | |||
61 | 7892 | 7892 | ||
62 | 7893 | =head1 VERSION | 7893 | =head1 VERSION |
63 | 7894 | 7894 | ||
65 | 7895 | pt-archiver 2.2.9 | 7895 | pt-archiver 2.2.10 |
66 | 7896 | 7896 | ||
67 | 7897 | =cut | 7897 | =cut |
68 | 7898 | 7898 | ||
69 | === modified file 'bin/pt-config-diff' | |||
70 | --- bin/pt-config-diff 2014-07-04 17:16:08 +0000 | |||
71 | +++ bin/pt-config-diff 2014-08-08 14:10:17 +0000 | |||
72 | @@ -43,7 +43,7 @@ | |||
73 | 43 | { | 43 | { |
74 | 44 | package Percona::Toolkit; | 44 | package Percona::Toolkit; |
75 | 45 | 45 | ||
77 | 46 | our $VERSION = '2.2.9'; | 46 | our $VERSION = '2.2.10'; |
78 | 47 | 47 | ||
79 | 48 | use strict; | 48 | use strict; |
80 | 49 | use warnings FATAL => 'all'; | 49 | use warnings FATAL => 'all'; |
81 | @@ -5733,6 +5733,6 @@ | |||
82 | 5733 | 5733 | ||
83 | 5734 | =head1 VERSION | 5734 | =head1 VERSION |
84 | 5735 | 5735 | ||
86 | 5736 | pt-config-diff 2.2.9 | 5736 | pt-config-diff 2.2.10 |
87 | 5737 | 5737 | ||
88 | 5738 | =cut | 5738 | =cut |
89 | 5739 | 5739 | ||
90 | === modified file 'bin/pt-deadlock-logger' | |||
91 | --- bin/pt-deadlock-logger 2014-07-04 17:16:08 +0000 | |||
92 | +++ bin/pt-deadlock-logger 2014-08-08 14:10:17 +0000 | |||
93 | @@ -42,7 +42,7 @@ | |||
94 | 42 | { | 42 | { |
95 | 43 | package Percona::Toolkit; | 43 | package Percona::Toolkit; |
96 | 44 | 44 | ||
98 | 45 | our $VERSION = '2.2.9'; | 45 | our $VERSION = '2.2.10'; |
99 | 46 | 46 | ||
100 | 47 | use strict; | 47 | use strict; |
101 | 48 | use warnings FATAL => 'all'; | 48 | use warnings FATAL => 'all'; |
102 | @@ -5523,6 +5523,6 @@ | |||
103 | 5523 | 5523 | ||
104 | 5524 | =head1 VERSION | 5524 | =head1 VERSION |
105 | 5525 | 5525 | ||
107 | 5526 | pt-deadlock-logger 2.2.9 | 5526 | pt-deadlock-logger 2.2.10 |
108 | 5527 | 5527 | ||
109 | 5528 | =cut | 5528 | =cut |
110 | 5529 | 5529 | ||
111 | === modified file 'bin/pt-diskstats' | |||
112 | --- bin/pt-diskstats 2014-07-04 17:16:08 +0000 | |||
113 | +++ bin/pt-diskstats 2014-08-08 14:10:17 +0000 | |||
114 | @@ -38,7 +38,7 @@ | |||
115 | 38 | { | 38 | { |
116 | 39 | package Percona::Toolkit; | 39 | package Percona::Toolkit; |
117 | 40 | 40 | ||
119 | 41 | our $VERSION = '2.2.9'; | 41 | our $VERSION = '2.2.10'; |
120 | 42 | 42 | ||
121 | 43 | use strict; | 43 | use strict; |
122 | 44 | use warnings FATAL => 'all'; | 44 | use warnings FATAL => 'all'; |
123 | @@ -5579,6 +5579,6 @@ | |||
124 | 5579 | 5579 | ||
125 | 5580 | =head1 VERSION | 5580 | =head1 VERSION |
126 | 5581 | 5581 | ||
128 | 5582 | pt-diskstats 2.2.9 | 5582 | pt-diskstats 2.2.10 |
129 | 5583 | 5583 | ||
130 | 5584 | =cut | 5584 | =cut |
131 | 5585 | 5585 | ||
132 | === modified file 'bin/pt-duplicate-key-checker' | |||
133 | --- bin/pt-duplicate-key-checker 2014-07-04 17:16:08 +0000 | |||
134 | +++ bin/pt-duplicate-key-checker 2014-08-08 14:10:17 +0000 | |||
135 | @@ -39,7 +39,7 @@ | |||
136 | 39 | { | 39 | { |
137 | 40 | package Percona::Toolkit; | 40 | package Percona::Toolkit; |
138 | 41 | 41 | ||
140 | 42 | our $VERSION = '2.2.9'; | 42 | our $VERSION = '2.2.10'; |
141 | 43 | 43 | ||
142 | 44 | use strict; | 44 | use strict; |
143 | 45 | use warnings FATAL => 'all'; | 45 | use warnings FATAL => 'all'; |
144 | @@ -5600,6 +5600,6 @@ | |||
145 | 5600 | 5600 | ||
146 | 5601 | =head1 VERSION | 5601 | =head1 VERSION |
147 | 5602 | 5602 | ||
149 | 5603 | pt-duplicate-key-checker 2.2.9 | 5603 | pt-duplicate-key-checker 2.2.10 |
150 | 5604 | 5604 | ||
151 | 5605 | =cut | 5605 | =cut |
152 | 5606 | 5606 | ||
153 | === modified file 'bin/pt-fifo-split' | |||
154 | --- bin/pt-fifo-split 2014-07-04 17:16:08 +0000 | |||
155 | +++ bin/pt-fifo-split 2014-08-08 14:10:17 +0000 | |||
156 | @@ -1612,6 +1612,6 @@ | |||
157 | 1612 | 1612 | ||
158 | 1613 | =head1 VERSION | 1613 | =head1 VERSION |
159 | 1614 | 1614 | ||
161 | 1615 | pt-fifo-split 2.2.9 | 1615 | pt-fifo-split 2.2.10 |
162 | 1616 | 1616 | ||
163 | 1617 | =cut | 1617 | =cut |
164 | 1618 | 1618 | ||
165 | === modified file 'bin/pt-find' | |||
166 | --- bin/pt-find 2014-07-04 17:16:08 +0000 | |||
167 | +++ bin/pt-find 2014-08-08 14:10:17 +0000 | |||
168 | @@ -35,7 +35,7 @@ | |||
169 | 35 | { | 35 | { |
170 | 36 | package Percona::Toolkit; | 36 | package Percona::Toolkit; |
171 | 37 | 37 | ||
173 | 38 | our $VERSION = '2.2.9'; | 38 | our $VERSION = '2.2.10'; |
174 | 39 | 39 | ||
175 | 40 | use strict; | 40 | use strict; |
176 | 41 | use warnings FATAL => 'all'; | 41 | use warnings FATAL => 'all'; |
177 | @@ -4984,6 +4984,6 @@ | |||
178 | 4984 | 4984 | ||
179 | 4985 | =head1 VERSION | 4985 | =head1 VERSION |
180 | 4986 | 4986 | ||
182 | 4987 | pt-find 2.2.9 | 4987 | pt-find 2.2.10 |
183 | 4988 | 4988 | ||
184 | 4989 | =cut | 4989 | =cut |
185 | 4990 | 4990 | ||
186 | === modified file 'bin/pt-fingerprint' | |||
187 | --- bin/pt-fingerprint 2014-07-04 17:16:08 +0000 | |||
188 | +++ bin/pt-fingerprint 2014-08-08 14:10:17 +0000 | |||
189 | @@ -2203,6 +2203,6 @@ | |||
190 | 2203 | 2203 | ||
191 | 2204 | =head1 VERSION | 2204 | =head1 VERSION |
192 | 2205 | 2205 | ||
194 | 2206 | pt-fingerprint 2.2.9 | 2206 | pt-fingerprint 2.2.10 |
195 | 2207 | 2207 | ||
196 | 2208 | =cut | 2208 | =cut |
197 | 2209 | 2209 | ||
198 | === modified file 'bin/pt-fk-error-logger' | |||
199 | --- bin/pt-fk-error-logger 2014-07-04 17:16:08 +0000 | |||
200 | +++ bin/pt-fk-error-logger 2014-08-08 14:10:17 +0000 | |||
201 | @@ -37,7 +37,7 @@ | |||
202 | 37 | { | 37 | { |
203 | 38 | package Percona::Toolkit; | 38 | package Percona::Toolkit; |
204 | 39 | 39 | ||
206 | 40 | our $VERSION = '2.2.9'; | 40 | our $VERSION = '2.2.10'; |
207 | 41 | 41 | ||
208 | 42 | use strict; | 42 | use strict; |
209 | 43 | use warnings FATAL => 'all'; | 43 | use warnings FATAL => 'all'; |
210 | @@ -4509,6 +4509,6 @@ | |||
211 | 4509 | 4509 | ||
212 | 4510 | =head1 VERSION | 4510 | =head1 VERSION |
213 | 4511 | 4511 | ||
215 | 4512 | pt-fk-error-logger 2.2.9 | 4512 | pt-fk-error-logger 2.2.10 |
216 | 4513 | 4513 | ||
217 | 4514 | =cut | 4514 | =cut |
218 | 4515 | 4515 | ||
219 | === modified file 'bin/pt-heartbeat' | |||
220 | --- bin/pt-heartbeat 2014-07-04 17:16:08 +0000 | |||
221 | +++ bin/pt-heartbeat 2014-08-08 14:10:17 +0000 | |||
222 | @@ -38,7 +38,7 @@ | |||
223 | 38 | { | 38 | { |
224 | 39 | package Percona::Toolkit; | 39 | package Percona::Toolkit; |
225 | 40 | 40 | ||
227 | 41 | our $VERSION = '2.2.9'; | 41 | our $VERSION = '2.2.10'; |
228 | 42 | 42 | ||
229 | 43 | use strict; | 43 | use strict; |
230 | 44 | use warnings FATAL => 'all'; | 44 | use warnings FATAL => 'all'; |
231 | @@ -6192,6 +6192,6 @@ | |||
232 | 6192 | 6192 | ||
233 | 6193 | =head1 VERSION | 6193 | =head1 VERSION |
234 | 6194 | 6194 | ||
236 | 6195 | pt-heartbeat 2.2.9 | 6195 | pt-heartbeat 2.2.10 |
237 | 6196 | 6196 | ||
238 | 6197 | =cut | 6197 | =cut |
239 | 6198 | 6198 | ||
240 | === modified file 'bin/pt-index-usage' | |||
241 | --- bin/pt-index-usage 2014-07-04 17:16:08 +0000 | |||
242 | +++ bin/pt-index-usage 2014-08-08 14:10:17 +0000 | |||
243 | @@ -45,7 +45,7 @@ | |||
244 | 45 | { | 45 | { |
245 | 46 | package Percona::Toolkit; | 46 | package Percona::Toolkit; |
246 | 47 | 47 | ||
248 | 48 | our $VERSION = '2.2.9'; | 48 | our $VERSION = '2.2.10'; |
249 | 49 | 49 | ||
250 | 50 | use strict; | 50 | use strict; |
251 | 51 | use warnings FATAL => 'all'; | 51 | use warnings FATAL => 'all'; |
252 | @@ -2772,12 +2772,13 @@ | |||
253 | 2772 | my ( $class ) = @_; | 2772 | my ( $class ) = @_; |
254 | 2773 | my $self = { | 2773 | my $self = { |
255 | 2774 | pending => [], | 2774 | pending => [], |
256 | 2775 | last_event_offset => undef, | ||
257 | 2775 | }; | 2776 | }; |
258 | 2776 | return bless $self, $class; | 2777 | return bless $self, $class; |
259 | 2777 | } | 2778 | } |
260 | 2778 | 2779 | ||
261 | 2779 | my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/; | 2780 | my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/; |
263 | 2780 | my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]/; | 2781 | my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]\s*(?:Id:\s*(\d+))?/; |
264 | 2781 | my $slow_log_hd_line = qr{ | 2782 | my $slow_log_hd_line = qr{ |
265 | 2782 | ^(?: | 2783 | ^(?: |
266 | 2783 | T[cC][pP]\s[pP]ort:\s+\d+ # case differs on windows/unix | 2784 | T[cC][pP]\s[pP]ort:\s+\d+ # case differs on windows/unix |
267 | @@ -2808,6 +2809,7 @@ | |||
268 | 2808 | or defined($stmt = $next_event->()) | 2809 | or defined($stmt = $next_event->()) |
269 | 2809 | ) { | 2810 | ) { |
270 | 2810 | my @properties = ('cmd', 'Query', 'pos_in_log', $pos_in_log); | 2811 | my @properties = ('cmd', 'Query', 'pos_in_log', $pos_in_log); |
271 | 2812 | $self->{last_event_offset} = $pos_in_log; | ||
272 | 2811 | $pos_in_log = $tell->(); | 2813 | $pos_in_log = $tell->(); |
273 | 2812 | 2814 | ||
274 | 2813 | if ( $stmt =~ s/$slow_log_hd_line//go ){ # Throw away header lines in log | 2815 | if ( $stmt =~ s/$slow_log_hd_line//go ){ # Throw away header lines in log |
275 | @@ -2840,19 +2842,25 @@ | |||
276 | 2840 | push @properties, 'ts', $time; | 2842 | push @properties, 'ts', $time; |
277 | 2841 | ++$got_ts; | 2843 | ++$got_ts; |
278 | 2842 | if ( !$got_uh | 2844 | if ( !$got_uh |
280 | 2843 | && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o ) | 2845 | && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o ) |
281 | 2844 | ) { | 2846 | ) { |
282 | 2845 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); | 2847 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); |
283 | 2846 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; | 2848 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; |
285 | 2847 | ++$got_uh; | 2849 | if ( $thread_id ) { |
286 | 2850 | push @properties, 'Thread_id', $thread_id; | ||
287 | 2851 | } | ||
288 | 2852 | ++$got_uh; | ||
289 | 2848 | } | 2853 | } |
290 | 2849 | } | 2854 | } |
291 | 2850 | 2855 | ||
292 | 2851 | elsif ( !$got_uh | 2856 | elsif ( !$got_uh |
294 | 2852 | && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o ) | 2857 | && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o ) |
295 | 2853 | ) { | 2858 | ) { |
298 | 2854 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); | 2859 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); |
299 | 2855 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; | 2860 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; |
300 | 2861 | if ( $thread_id ) { | ||
301 | 2862 | push @properties, 'Thread_id', $thread_id; | ||
302 | 2863 | } | ||
303 | 2856 | ++$got_uh; | 2864 | ++$got_uh; |
304 | 2857 | } | 2865 | } |
305 | 2858 | 2866 | ||
306 | @@ -2933,9 +2941,15 @@ | |||
307 | 2933 | 2941 | ||
308 | 2934 | PTDEBUG && _d('Properties of event:', Dumper(\@properties)); | 2942 | PTDEBUG && _d('Properties of event:', Dumper(\@properties)); |
309 | 2935 | my $event = { @properties }; | 2943 | my $event = { @properties }; |
313 | 2936 | if ( $args{stats} ) { | 2944 | if ( !$event->{arg} ) { |
314 | 2937 | $args{stats}->{events_read}++; | 2945 | PTDEBUG && _d('Partial event, no arg'); |
315 | 2938 | $args{stats}->{events_parsed}++; | 2946 | } |
316 | 2947 | else { | ||
317 | 2948 | $self->{last_event_offset} = undef; | ||
318 | 2949 | if ( $args{stats} ) { | ||
319 | 2950 | $args{stats}->{events_read}++; | ||
320 | 2951 | $args{stats}->{events_parsed}++; | ||
321 | 2952 | } | ||
322 | 2939 | } | 2953 | } |
323 | 2940 | return $event; | 2954 | return $event; |
324 | 2941 | } # EVENT | 2955 | } # EVENT |
325 | @@ -7532,6 +7546,6 @@ | |||
326 | 7532 | 7546 | ||
327 | 7533 | =head1 VERSION | 7547 | =head1 VERSION |
328 | 7534 | 7548 | ||
330 | 7535 | pt-index-usage 2.2.9 | 7549 | pt-index-usage 2.2.10 |
331 | 7536 | 7550 | ||
332 | 7537 | =cut | 7551 | =cut |
333 | 7538 | 7552 | ||
334 | === modified file 'bin/pt-ioprofile' | |||
335 | --- bin/pt-ioprofile 2014-07-04 17:16:08 +0000 | |||
336 | +++ bin/pt-ioprofile 2014-08-08 14:10:17 +0000 | |||
337 | @@ -1119,7 +1119,7 @@ | |||
338 | 1119 | 1119 | ||
339 | 1120 | =head1 VERSION | 1120 | =head1 VERSION |
340 | 1121 | 1121 | ||
342 | 1122 | pt-ioprofile 2.2.9 | 1122 | pt-ioprofile 2.2.10 |
343 | 1123 | 1123 | ||
344 | 1124 | =cut | 1124 | =cut |
345 | 1125 | 1125 | ||
346 | 1126 | 1126 | ||
347 | === modified file 'bin/pt-kill' | |||
348 | --- bin/pt-kill 2014-07-04 17:16:08 +0000 | |||
349 | +++ bin/pt-kill 2014-08-08 14:10:17 +0000 | |||
350 | @@ -47,7 +47,7 @@ | |||
351 | 47 | { | 47 | { |
352 | 48 | package Percona::Toolkit; | 48 | package Percona::Toolkit; |
353 | 49 | 49 | ||
355 | 50 | our $VERSION = '2.2.9'; | 50 | our $VERSION = '2.2.10'; |
356 | 51 | 51 | ||
357 | 52 | use strict; | 52 | use strict; |
358 | 53 | use warnings FATAL => 'all'; | 53 | use warnings FATAL => 'all'; |
359 | @@ -8183,6 +8183,6 @@ | |||
360 | 8183 | 8183 | ||
361 | 8184 | =head1 VERSION | 8184 | =head1 VERSION |
362 | 8185 | 8185 | ||
364 | 8186 | pt-kill 2.2.9 | 8186 | pt-kill 2.2.10 |
365 | 8187 | 8187 | ||
366 | 8188 | =cut | 8188 | =cut |
367 | 8189 | 8189 | ||
368 | === modified file 'bin/pt-mext' | |||
369 | --- bin/pt-mext 2014-07-04 17:16:08 +0000 | |||
370 | +++ bin/pt-mext 2014-08-08 14:10:17 +0000 | |||
371 | @@ -127,9 +127,10 @@ | |||
372 | 127 | 127 | ||
373 | 128 | usage_or_errors() { | 128 | usage_or_errors() { |
374 | 129 | local file="$1" | 129 | local file="$1" |
375 | 130 | local version="" | ||
376 | 130 | 131 | ||
377 | 131 | if [ "$OPT_VERSION" ]; then | 132 | if [ "$OPT_VERSION" ]; then |
379 | 132 | local version=$(grep '^pt-[^ ]\+ [0-9]' "$file") | 133 | version=$(grep '^pt-[^ ]\+ [0-9]' "$file") |
380 | 133 | echo "$version" | 134 | echo "$version" |
381 | 134 | return 1 | 135 | return 1 |
382 | 135 | fi | 136 | fi |
383 | @@ -791,7 +792,7 @@ | |||
384 | 791 | 792 | ||
385 | 792 | =head1 VERSION | 793 | =head1 VERSION |
386 | 793 | 794 | ||
388 | 794 | pt-mext 2.2.9 | 795 | pt-mext 2.2.10 |
389 | 795 | 796 | ||
390 | 796 | =cut | 797 | =cut |
391 | 797 | 798 | ||
392 | 798 | 799 | ||
393 | === modified file 'bin/pt-mysql-summary' | |||
394 | --- bin/pt-mysql-summary 2014-07-04 17:16:08 +0000 | |||
395 | +++ bin/pt-mysql-summary 2014-08-08 14:10:17 +0000 | |||
396 | @@ -88,9 +88,10 @@ | |||
397 | 88 | 88 | ||
398 | 89 | usage_or_errors() { | 89 | usage_or_errors() { |
399 | 90 | local file="$1" | 90 | local file="$1" |
400 | 91 | local version="" | ||
401 | 91 | 92 | ||
402 | 92 | if [ "$OPT_VERSION" ]; then | 93 | if [ "$OPT_VERSION" ]; then |
404 | 93 | local version=$(grep '^pt-[^ ]\+ [0-9]' "$file") | 94 | version=$(grep '^pt-[^ ]\+ [0-9]' "$file") |
405 | 94 | echo "$version" | 95 | echo "$version" |
406 | 95 | return 1 | 96 | return 1 |
407 | 96 | fi | 97 | fi |
408 | @@ -3089,7 +3090,7 @@ | |||
409 | 3089 | 3090 | ||
410 | 3090 | =head1 VERSION | 3091 | =head1 VERSION |
411 | 3091 | 3092 | ||
413 | 3092 | pt-mysql-summary 2.2.9 | 3093 | pt-mysql-summary 2.2.10 |
414 | 3093 | 3094 | ||
415 | 3094 | =cut | 3095 | =cut |
416 | 3095 | 3096 | ||
417 | 3096 | 3097 | ||
418 | === modified file 'bin/pt-online-schema-change' | |||
419 | --- bin/pt-online-schema-change 2014-07-04 17:16:08 +0000 | |||
420 | +++ bin/pt-online-schema-change 2014-08-08 14:10:17 +0000 | |||
421 | @@ -54,7 +54,7 @@ | |||
422 | 54 | { | 54 | { |
423 | 55 | package Percona::Toolkit; | 55 | package Percona::Toolkit; |
424 | 56 | 56 | ||
426 | 57 | our $VERSION = '2.2.9'; | 57 | our $VERSION = '2.2.10'; |
427 | 58 | 58 | ||
428 | 59 | use strict; | 59 | use strict; |
429 | 60 | use warnings FATAL => 'all'; | 60 | use warnings FATAL => 'all'; |
430 | @@ -4785,6 +4785,7 @@ | |||
431 | 4785 | 4785 | ||
432 | 4786 | use strict; | 4786 | use strict; |
433 | 4787 | use warnings FATAL => 'all'; | 4787 | use warnings FATAL => 'all'; |
434 | 4788 | use POSIX qw( ceil ); | ||
435 | 4788 | use English qw(-no_match_vars); | 4789 | use English qw(-no_match_vars); |
436 | 4789 | use constant PTDEBUG => $ENV{PTDEBUG} || 0; | 4790 | use constant PTDEBUG => $ENV{PTDEBUG} || 0; |
437 | 4790 | 4791 | ||
438 | @@ -4950,8 +4951,8 @@ | |||
439 | 4950 | } | 4951 | } |
440 | 4951 | else { | 4952 | else { |
441 | 4952 | PTDEBUG && _d('Initial', $var, 'value:', $init_val); | 4953 | PTDEBUG && _d('Initial', $var, 'value:', $init_val); |
444 | 4953 | $val = int(($init_val * $threshold_factor) + $init_val); | 4954 | $val = ($init_val * $threshold_factor) + $init_val; |
445 | 4954 | $vars->{$var} = $val; | 4955 | $vars->{$var} = int(ceil($val)); |
446 | 4955 | } | 4956 | } |
447 | 4956 | PTDEBUG && _d('Wait if', $var, '>=', $val); | 4957 | PTDEBUG && _d('Wait if', $var, '>=', $val); |
448 | 4957 | } | 4958 | } |
449 | @@ -8908,28 +8909,31 @@ | |||
450 | 8908 | # boundary sql. This check applies to the next nibble. So if | 8909 | # boundary sql. This check applies to the next nibble. So if |
451 | 8909 | # the current nibble number is 5, then nibble 5 is already done | 8910 | # the current nibble number is 5, then nibble 5 is already done |
452 | 8910 | # and we're checking nibble number 6. | 8911 | # and we're checking nibble number 6. |
475 | 8911 | my $expl = explain_statement( | 8912 | # Skip if --nocheck-plan See: https://bugs.launchpad.net/percona-toolkit/+bug/1340728 |
476 | 8912 | tbl => $tbl, | 8913 | if ( $o->get('check-plan') ) { |
477 | 8913 | sth => $sth->{explain_upper_boundary}, | 8914 | my $expl = explain_statement( |
478 | 8914 | vals => [ @{$boundary->{lower}}, $nibble_iter->limit() ], | 8915 | tbl => $tbl, |
479 | 8915 | ); | 8916 | sth => $sth->{explain_upper_boundary}, |
480 | 8916 | if (lc($expl->{key} || '') ne lc($nibble_iter->nibble_index() || '')) { | 8917 | vals => [ @{$boundary->{lower}}, $nibble_iter->limit() ], |
481 | 8917 | my $msg | 8918 | ); |
482 | 8918 | = "Aborting copying table $tbl->{name} at chunk " | 8919 | if ( lc($expl->{key} || '') ne lc($nibble_iter->nibble_index() || '') ) { |
483 | 8919 | . ($nibble_iter->nibble_number() + 1) | 8920 | my $msg |
484 | 8920 | . " because it is not safe to ascend. Chunking should " | 8921 | = "Aborting copying table $tbl->{name} at chunk " |
485 | 8921 | . "use the " | 8922 | . ($nibble_iter->nibble_number() + 1) |
486 | 8922 | . ($nibble_iter->nibble_index() || '?') | 8923 | . " because it is not safe to ascend. Chunking should " |
487 | 8923 | . " index, but MySQL EXPLAIN reports that " | 8924 | . "use the " |
488 | 8924 | . ($expl->{key} ? "the $expl->{key}" : "no") | 8925 | . ($nibble_iter->nibble_index() || '?') |
489 | 8925 | . " index will be used for " | 8926 | . " index, but MySQL EXPLAIN reports that " |
490 | 8926 | . $sth->{upper_boundary}->{Statement} | 8927 | . ($expl->{key} ? "the $expl->{key}" : "no") |
491 | 8927 | . " with values " | 8928 | . " index will be used for " |
492 | 8928 | . join(", ", map { defined $_ ? $_ : "NULL" } | 8929 | . $sth->{upper_boundary}->{Statement} |
493 | 8929 | (@{$boundary->{lower}}, $nibble_iter->limit())) | 8930 | . " with values " |
494 | 8930 | . "\n"; | 8931 | . join(", ", map { defined $_ ? $_ : "NULL" } |
495 | 8931 | die ts($msg); | 8932 | (@{$boundary->{lower}}, $nibble_iter->limit())) |
496 | 8932 | } | 8933 | . "\n"; |
497 | 8934 | die ts($msg); | ||
498 | 8935 | } | ||
499 | 8936 | } | ||
500 | 8933 | 8937 | ||
501 | 8934 | # Once nibbling begins for a table, control does not return to this | 8938 | # Once nibbling begins for a table, control does not return to this |
502 | 8935 | # tool until nibbling is done because, as noted above, all work is | 8939 | # tool until nibbling is done because, as noted above, all work is |
503 | @@ -9531,15 +9535,17 @@ | |||
504 | 9531 | vals => [ @{$boundary->{lower}}, @{$boundary->{upper}} ], | 9535 | vals => [ @{$boundary->{lower}}, @{$boundary->{upper}} ], |
505 | 9532 | ); | 9536 | ); |
506 | 9533 | 9537 | ||
516 | 9534 | # Ensure that MySQL is using the chunk index if the table is being chunked. | 9538 | # Ensure that MySQL is using the chunk index if the table is being chunked. |
517 | 9535 | if ( !$nibble_iter->one_nibble() | 9539 | # Skip if --nocheck-plan See: https://bugs.launchpad.net/percona-toolkit/+bug/1340728 |
518 | 9536 | && lc($expl->{key} || '') ne lc($nibble_iter->nibble_index() || '') ) | 9540 | if ( !$nibble_iter->one_nibble() |
519 | 9537 | { | 9541 | && lc($expl->{key} || '') ne lc($nibble_iter->nibble_index() || '') |
520 | 9538 | die ts("Error copying rows at chunk " . $nibble_iter->nibble_number() | 9542 | && $o->get('check-plan') ) |
521 | 9539 | . " of $tbl->{db}.$tbl->{tbl} because MySQL chose " | 9543 | { |
522 | 9540 | . ($expl->{key} ? "the $expl->{key}" : "no") . " index " | 9544 | die ts("Error copying rows at chunk " . $nibble_iter->nibble_number() |
523 | 9541 | . " instead of the " . $nibble_iter->nibble_index() . "index.\n"); | 9545 | . " of $tbl->{db}.$tbl->{tbl} because MySQL chose " |
524 | 9542 | } | 9546 | . ($expl->{key} ? "the $expl->{key}" : "no") . " index " |
525 | 9547 | . " instead of the " . $nibble_iter->nibble_index() . "index.\n"); | ||
526 | 9548 | } | ||
527 | 9543 | 9549 | ||
528 | 9544 | # Ensure that the chunk isn't too large if there's a --chunk-size-limit. | 9550 | # Ensure that the chunk isn't too large if there's a --chunk-size-limit. |
529 | 9545 | # If single-chunking the table, this has already been checked, so it | 9551 | # If single-chunking the table, this has already been checked, so it |
530 | @@ -9564,11 +9570,13 @@ | |||
531 | 9564 | } | 9570 | } |
532 | 9565 | } | 9571 | } |
533 | 9566 | 9572 | ||
535 | 9567 | # Ensure that MySQL is still using the entire index. | 9573 | # Ensure that MySQL is still using the entire index. |
536 | 9568 | # https://bugs.launchpad.net/percona-toolkit/+bug/1010232 | 9574 | # https://bugs.launchpad.net/percona-toolkit/+bug/1010232 |
537 | 9575 | # Skip if --nocheck-plan See: https://bugs.launchpad.net/percona-toolkit/+bug/1340728 | ||
538 | 9569 | if ( !$nibble_iter->one_nibble() | 9576 | if ( !$nibble_iter->one_nibble() |
539 | 9570 | && $tbl->{key_len} | 9577 | && $tbl->{key_len} |
541 | 9571 | && ($expl->{key_len} || 0) < $tbl->{key_len} ) | 9578 | && ($expl->{key_len} || 0) < $tbl->{key_len} |
542 | 9579 | && $o->get('check-plan') ) | ||
543 | 9572 | { | 9580 | { |
544 | 9573 | die ts("Error copying rows at chunk " . $nibble_iter->nibble_number() | 9581 | die ts("Error copying rows at chunk " . $nibble_iter->nibble_number() |
545 | 9574 | . " of $tbl->{db}.$tbl->{tbl} because MySQL used " | 9582 | . " of $tbl->{db}.$tbl->{tbl} because MySQL used " |
546 | @@ -11555,6 +11563,6 @@ | |||
547 | 11555 | 11563 | ||
548 | 11556 | =head1 VERSION | 11564 | =head1 VERSION |
549 | 11557 | 11565 | ||
551 | 11558 | pt-online-schema-change 2.2.9 | 11566 | pt-online-schema-change 2.2.10 |
552 | 11559 | 11567 | ||
553 | 11560 | =cut | 11568 | =cut |
554 | 11561 | 11569 | ||
555 | === modified file 'bin/pt-pmp' | |||
556 | --- bin/pt-pmp 2014-07-04 17:16:08 +0000 | |||
557 | +++ bin/pt-pmp 2014-08-08 14:10:17 +0000 | |||
558 | @@ -889,7 +889,7 @@ | |||
559 | 889 | 889 | ||
560 | 890 | =head1 VERSION | 890 | =head1 VERSION |
561 | 891 | 891 | ||
563 | 892 | pt-pmp 2.2.9 | 892 | pt-pmp 2.2.10 |
564 | 893 | 893 | ||
565 | 894 | =cut | 894 | =cut |
566 | 895 | 895 | ||
567 | 896 | 896 | ||
568 | === modified file 'bin/pt-query-digest' | |||
569 | --- bin/pt-query-digest 2014-07-04 17:16:08 +0000 | |||
570 | +++ bin/pt-query-digest 2014-08-08 14:10:17 +0000 | |||
571 | @@ -64,7 +64,7 @@ | |||
572 | 64 | { | 64 | { |
573 | 65 | package Percona::Toolkit; | 65 | package Percona::Toolkit; |
574 | 66 | 66 | ||
576 | 67 | our $VERSION = '2.2.9'; | 67 | our $VERSION = '2.2.10'; |
577 | 68 | 68 | ||
578 | 69 | use strict; | 69 | use strict; |
579 | 70 | use warnings FATAL => 'all'; | 70 | use warnings FATAL => 'all'; |
580 | @@ -4972,7 +4972,7 @@ | |||
581 | 4972 | } | 4972 | } |
582 | 4973 | 4973 | ||
583 | 4974 | my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/; | 4974 | my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/; |
585 | 4975 | my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]/; | 4975 | my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]\s*(?:Id:\s*(\d+))?/; |
586 | 4976 | my $slow_log_hd_line = qr{ | 4976 | my $slow_log_hd_line = qr{ |
587 | 4977 | ^(?: | 4977 | ^(?: |
588 | 4978 | T[cC][pP]\s[pP]ort:\s+\d+ # case differs on windows/unix | 4978 | T[cC][pP]\s[pP]ort:\s+\d+ # case differs on windows/unix |
589 | @@ -5036,19 +5036,25 @@ | |||
590 | 5036 | push @properties, 'ts', $time; | 5036 | push @properties, 'ts', $time; |
591 | 5037 | ++$got_ts; | 5037 | ++$got_ts; |
592 | 5038 | if ( !$got_uh | 5038 | if ( !$got_uh |
594 | 5039 | && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o ) | 5039 | && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o ) |
595 | 5040 | ) { | 5040 | ) { |
596 | 5041 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); | 5041 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); |
597 | 5042 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; | 5042 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; |
599 | 5043 | ++$got_uh; | 5043 | if ( $thread_id ) { |
600 | 5044 | push @properties, 'Thread_id', $thread_id; | ||
601 | 5045 | } | ||
602 | 5046 | ++$got_uh; | ||
603 | 5044 | } | 5047 | } |
604 | 5045 | } | 5048 | } |
605 | 5046 | 5049 | ||
606 | 5047 | elsif ( !$got_uh | 5050 | elsif ( !$got_uh |
608 | 5048 | && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o ) | 5051 | && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o ) |
609 | 5049 | ) { | 5052 | ) { |
612 | 5050 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); | 5053 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); |
613 | 5051 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; | 5054 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; |
614 | 5055 | if ( $thread_id ) { | ||
615 | 5056 | push @properties, 'Thread_id', $thread_id; | ||
616 | 5057 | } | ||
617 | 5052 | ++$got_uh; | 5058 | ++$got_uh; |
618 | 5053 | } | 5059 | } |
619 | 5054 | 5060 | ||
620 | @@ -16587,6 +16593,6 @@ | |||
621 | 16587 | 16593 | ||
622 | 16588 | =head1 VERSION | 16594 | =head1 VERSION |
623 | 16589 | 16595 | ||
625 | 16590 | pt-query-digest 2.2.9 | 16596 | pt-query-digest 2.2.10 |
626 | 16591 | 16597 | ||
627 | 16592 | =cut | 16598 | =cut |
628 | 16593 | 16599 | ||
629 | === modified file 'bin/pt-show-grants' | |||
630 | --- bin/pt-show-grants 2014-07-04 17:16:08 +0000 | |||
631 | +++ bin/pt-show-grants 2014-08-08 14:10:17 +0000 | |||
632 | @@ -2406,6 +2406,6 @@ | |||
633 | 2406 | 2406 | ||
634 | 2407 | =head1 VERSION | 2407 | =head1 VERSION |
635 | 2408 | 2408 | ||
637 | 2409 | pt-show-grants 2.2.9 | 2409 | pt-show-grants 2.2.10 |
638 | 2410 | 2410 | ||
639 | 2411 | =cut | 2411 | =cut |
640 | 2412 | 2412 | ||
641 | === modified file 'bin/pt-sift' | |||
642 | --- bin/pt-sift 2014-07-04 17:16:08 +0000 | |||
643 | +++ bin/pt-sift 2014-08-08 14:10:17 +0000 | |||
644 | @@ -1237,7 +1237,7 @@ | |||
645 | 1237 | 1237 | ||
646 | 1238 | =head1 VERSION | 1238 | =head1 VERSION |
647 | 1239 | 1239 | ||
649 | 1240 | pt-sift 2.2.9 | 1240 | pt-sift 2.2.10 |
650 | 1241 | 1241 | ||
651 | 1242 | =cut | 1242 | =cut |
652 | 1243 | 1243 | ||
653 | 1244 | 1244 | ||
654 | === modified file 'bin/pt-slave-delay' | |||
655 | --- bin/pt-slave-delay 2014-07-04 17:16:08 +0000 | |||
656 | +++ bin/pt-slave-delay 2014-08-08 14:10:17 +0000 | |||
657 | @@ -40,7 +40,7 @@ | |||
658 | 40 | { | 40 | { |
659 | 41 | package Percona::Toolkit; | 41 | package Percona::Toolkit; |
660 | 42 | 42 | ||
662 | 43 | our $VERSION = '2.2.9'; | 43 | our $VERSION = '2.2.10'; |
663 | 44 | 44 | ||
664 | 45 | use strict; | 45 | use strict; |
665 | 46 | use warnings FATAL => 'all'; | 46 | use warnings FATAL => 'all'; |
666 | @@ -4869,6 +4869,6 @@ | |||
667 | 4869 | 4869 | ||
668 | 4870 | =head1 VERSION | 4870 | =head1 VERSION |
669 | 4871 | 4871 | ||
671 | 4872 | pt-slave-delay 2.2.9 | 4872 | pt-slave-delay 2.2.10 |
672 | 4873 | 4873 | ||
673 | 4874 | =cut | 4874 | =cut |
674 | 4875 | 4875 | ||
675 | === modified file 'bin/pt-slave-find' | |||
676 | --- bin/pt-slave-find 2014-07-04 17:16:08 +0000 | |||
677 | +++ bin/pt-slave-find 2014-08-08 14:10:17 +0000 | |||
678 | @@ -4334,6 +4334,6 @@ | |||
679 | 4334 | 4334 | ||
680 | 4335 | =head1 VERSION | 4335 | =head1 VERSION |
681 | 4336 | 4336 | ||
683 | 4337 | pt-slave-find 2.2.9 | 4337 | pt-slave-find 2.2.10 |
684 | 4338 | 4338 | ||
685 | 4339 | =cut | 4339 | =cut |
686 | 4340 | 4340 | ||
687 | === modified file 'bin/pt-slave-restart' | |||
688 | --- bin/pt-slave-restart 2014-07-04 17:16:08 +0000 | |||
689 | +++ bin/pt-slave-restart 2014-08-08 14:10:17 +0000 | |||
690 | @@ -41,7 +41,7 @@ | |||
691 | 41 | { | 41 | { |
692 | 42 | package Percona::Toolkit; | 42 | package Percona::Toolkit; |
693 | 43 | 43 | ||
695 | 44 | our $VERSION = '2.2.9'; | 44 | our $VERSION = '2.2.10'; |
696 | 45 | 45 | ||
697 | 46 | use strict; | 46 | use strict; |
698 | 47 | use warnings FATAL => 'all'; | 47 | use warnings FATAL => 'all'; |
699 | @@ -5937,6 +5937,6 @@ | |||
700 | 5937 | 5937 | ||
701 | 5938 | =head1 VERSION | 5938 | =head1 VERSION |
702 | 5939 | 5939 | ||
704 | 5940 | pt-slave-restart 2.2.9 | 5940 | pt-slave-restart 2.2.10 |
705 | 5941 | 5941 | ||
706 | 5942 | =cut | 5942 | =cut |
707 | 5943 | 5943 | ||
708 | === modified file 'bin/pt-stalk' | |||
709 | --- bin/pt-stalk 2014-07-04 17:16:08 +0000 | |||
710 | +++ bin/pt-stalk 2014-08-08 14:10:17 +0000 | |||
711 | @@ -2211,7 +2211,7 @@ | |||
712 | 2211 | 2211 | ||
713 | 2212 | =head1 VERSION | 2212 | =head1 VERSION |
714 | 2213 | 2213 | ||
716 | 2214 | pt-stalk 2.2.9 | 2214 | pt-stalk 2.2.10 |
717 | 2215 | 2215 | ||
718 | 2216 | =cut | 2216 | =cut |
719 | 2217 | 2217 | ||
720 | 2218 | 2218 | ||
721 | === modified file 'bin/pt-summary' | |||
722 | --- bin/pt-summary 2014-07-04 17:16:08 +0000 | |||
723 | +++ bin/pt-summary 2014-08-08 14:10:17 +0000 | |||
724 | @@ -95,9 +95,10 @@ | |||
725 | 95 | 95 | ||
726 | 96 | usage_or_errors() { | 96 | usage_or_errors() { |
727 | 97 | local file="$1" | 97 | local file="$1" |
728 | 98 | local version="" | ||
729 | 98 | 99 | ||
730 | 99 | if [ "$OPT_VERSION" ]; then | 100 | if [ "$OPT_VERSION" ]; then |
732 | 100 | local version=$(grep '^pt-[^ ]\+ [0-9]' "$file") | 101 | version=$(grep '^pt-[^ ]\+ [0-9]' "$file") |
733 | 101 | echo "$version" | 102 | echo "$version" |
734 | 102 | return 1 | 103 | return 1 |
735 | 103 | fi | 104 | fi |
736 | @@ -2690,7 +2691,7 @@ | |||
737 | 2690 | 2691 | ||
738 | 2691 | =head1 VERSION | 2692 | =head1 VERSION |
739 | 2692 | 2693 | ||
741 | 2693 | pt-summary 2.2.9 | 2694 | pt-summary 2.2.10 |
742 | 2694 | 2695 | ||
743 | 2695 | =cut | 2696 | =cut |
744 | 2696 | 2697 | ||
745 | 2697 | 2698 | ||
746 | === modified file 'bin/pt-table-checksum' | |||
747 | --- bin/pt-table-checksum 2014-07-04 17:16:08 +0000 | |||
748 | +++ bin/pt-table-checksum 2014-08-08 14:10:17 +0000 | |||
749 | @@ -57,7 +57,7 @@ | |||
750 | 57 | { | 57 | { |
751 | 58 | package Percona::Toolkit; | 58 | package Percona::Toolkit; |
752 | 59 | 59 | ||
754 | 60 | our $VERSION = '2.2.9'; | 60 | our $VERSION = '2.2.10'; |
755 | 61 | 61 | ||
756 | 62 | use strict; | 62 | use strict; |
757 | 63 | use warnings FATAL => 'all'; | 63 | use warnings FATAL => 'all'; |
758 | @@ -5977,19 +5977,28 @@ | |||
759 | 5977 | } | 5977 | } |
760 | 5978 | my ($dbh, $repl_table) = @args{@required_args}; | 5978 | my ($dbh, $repl_table) = @args{@required_args}; |
761 | 5979 | 5979 | ||
775 | 5980 | my $sql | 5980 | |
776 | 5981 | = "SELECT CONCAT(db, '.', tbl) AS `table`, " | 5981 | my $tries = $self->{'OptionParser'}->get('replicate-check-retries') || 1; |
777 | 5982 | . "chunk, chunk_index, lower_boundary, upper_boundary, " | 5982 | my $diffs; |
778 | 5983 | . "COALESCE(this_cnt-master_cnt, 0) AS cnt_diff, " | 5983 | while ($tries--) { |
779 | 5984 | . "COALESCE(" | 5984 | my $sql |
780 | 5985 | . "this_crc <> master_crc OR ISNULL(master_crc) <> ISNULL(this_crc), 0" | 5985 | = "SELECT CONCAT(db, '.', tbl) AS `table`, " |
781 | 5986 | . ") AS crc_diff, this_cnt, master_cnt, this_crc, master_crc " | 5986 | . "chunk, chunk_index, lower_boundary, upper_boundary, " |
782 | 5987 | . "FROM $repl_table " | 5987 | . "COALESCE(this_cnt-master_cnt, 0) AS cnt_diff, " |
783 | 5988 | . "WHERE (master_cnt <> this_cnt OR master_crc <> this_crc " | 5988 | . "COALESCE(" |
784 | 5989 | . "OR ISNULL(master_crc) <> ISNULL(this_crc))" | 5989 | . "this_crc <> master_crc OR ISNULL(master_crc) <> ISNULL(this_crc), 0" |
785 | 5990 | . ($args{where} ? " AND ($args{where})" : ""); | 5990 | . ") AS crc_diff, this_cnt, master_cnt, this_crc, master_crc " |
786 | 5991 | PTDEBUG && _d($sql); | 5991 | . "FROM $repl_table " |
787 | 5992 | my $diffs = $dbh->selectall_arrayref($sql, { Slice => {} }); | 5992 | . "WHERE (master_cnt <> this_cnt OR master_crc <> this_crc " |
788 | 5993 | . "OR ISNULL(master_crc) <> ISNULL(this_crc)) " | ||
789 | 5994 | . ($args{where} ? " AND ($args{where})" : ""); | ||
790 | 5995 | PTDEBUG && _d($sql); | ||
791 | 5996 | $diffs = $dbh->selectall_arrayref($sql, { Slice => {} }); | ||
792 | 5997 | if (!@$diffs || !$tries) { # if no differences are found OR we are out of tries left... | ||
793 | 5998 | last; # get out now | ||
794 | 5999 | } | ||
795 | 6000 | sleep 1; | ||
796 | 6001 | } | ||
797 | 5993 | return $diffs; | 6002 | return $diffs; |
798 | 5994 | } | 6003 | } |
799 | 5995 | 6004 | ||
800 | @@ -8347,6 +8356,7 @@ | |||
801 | 8347 | 8356 | ||
802 | 8348 | use strict; | 8357 | use strict; |
803 | 8349 | use warnings FATAL => 'all'; | 8358 | use warnings FATAL => 'all'; |
804 | 8359 | use POSIX qw( ceil ); | ||
805 | 8350 | use English qw(-no_match_vars); | 8360 | use English qw(-no_match_vars); |
806 | 8351 | use constant PTDEBUG => $ENV{PTDEBUG} || 0; | 8361 | use constant PTDEBUG => $ENV{PTDEBUG} || 0; |
807 | 8352 | 8362 | ||
808 | @@ -8512,8 +8522,8 @@ | |||
809 | 8512 | } | 8522 | } |
810 | 8513 | else { | 8523 | else { |
811 | 8514 | PTDEBUG && _d('Initial', $var, 'value:', $init_val); | 8524 | PTDEBUG && _d('Initial', $var, 'value:', $init_val); |
814 | 8515 | $val = int(($init_val * $threshold_factor) + $init_val); | 8525 | $val = ($init_val * $threshold_factor) + $init_val; |
815 | 8516 | $vars->{$var} = $val; | 8526 | $vars->{$var} = int(ceil($val)); |
816 | 8517 | } | 8527 | } |
817 | 8518 | PTDEBUG && _d('Wait if', $var, '>=', $val); | 8528 | PTDEBUG && _d('Wait if', $var, '>=', $val); |
818 | 8519 | } | 8529 | } |
819 | @@ -8964,6 +8974,7 @@ | |||
820 | 8964 | $print_header = 1; | 8974 | $print_header = 1; |
821 | 8965 | $exit_status = 0; | 8975 | $exit_status = 0; |
822 | 8966 | 8976 | ||
823 | 8977 | |||
824 | 8967 | # ######################################################################## | 8978 | # ######################################################################## |
825 | 8968 | # Get configuration information. | 8979 | # Get configuration information. |
826 | 8969 | # ######################################################################## | 8980 | # ######################################################################## |
827 | @@ -10072,6 +10083,7 @@ | |||
828 | 10072 | # Should be done automatically, but I like to be explicit. | 10083 | # Should be done automatically, but I like to be explicit. |
829 | 10073 | $fetch_sth->finish(); | 10084 | $fetch_sth->finish(); |
830 | 10074 | $update_sth->finish(); | 10085 | $update_sth->finish(); |
831 | 10086 | $delete_sth->finish(); | ||
832 | 10075 | 10087 | ||
833 | 10076 | # Update rate, chunk size, and progress if the nibble actually | 10088 | # Update rate, chunk size, and progress if the nibble actually |
834 | 10077 | # selected some rows. | 10089 | # selected some rows. |
835 | @@ -10382,6 +10394,7 @@ | |||
836 | 10382 | return $msg ? "$ts $msg" : $ts; | 10394 | return $msg ? "$ts $msg" : $ts; |
837 | 10383 | } | 10395 | } |
838 | 10384 | 10396 | ||
839 | 10397 | |||
840 | 10385 | sub nibble_is_safe { | 10398 | sub nibble_is_safe { |
841 | 10386 | my (%args) = @_; | 10399 | my (%args) = @_; |
842 | 10387 | my @required_args = qw(Cxn tbl NibbleIterator OptionParser); | 10400 | my @required_args = qw(Cxn tbl NibbleIterator OptionParser); |
843 | @@ -10561,6 +10574,7 @@ | |||
844 | 10561 | 10574 | ||
845 | 10562 | if ( $error =~ m/Lock wait timeout exceeded/ | 10575 | if ( $error =~ m/Lock wait timeout exceeded/ |
846 | 10563 | || $error =~ m/Query execution was interrupted/ | 10576 | || $error =~ m/Query execution was interrupted/ |
847 | 10577 | || $error =~ m/Deadlock found/ | ||
848 | 10564 | ) { | 10578 | ) { |
849 | 10565 | # These errors/warnings can be retried, so don't print | 10579 | # These errors/warnings can be retried, so don't print |
850 | 10566 | # a warning yet; do that in final_fail. | 10580 | # a warning yet; do that in final_fail. |
851 | @@ -10584,8 +10598,9 @@ | |||
852 | 10584 | my (%args) = @_; | 10598 | my (%args) = @_; |
853 | 10585 | my $error = $args{error}; | 10599 | my $error = $args{error}; |
854 | 10586 | 10600 | ||
857 | 10587 | if ( $error =~ /Lock wait timeout exceeded/ | 10601 | if ( $error =~ m/Lock wait timeout exceeded/ |
858 | 10588 | || $error =~ /Query execution was interrupted/ | 10602 | || $error =~ m/Query execution was interrupted/ |
859 | 10603 | || $error =~ m/Deadlock found/ | ||
860 | 10589 | ) { | 10604 | ) { |
861 | 10590 | # These errors/warnings are not fatal but only cause this | 10605 | # These errors/warnings are not fatal but only cause this |
862 | 10591 | # nibble to be skipped. | 10606 | # nibble to be skipped. |
863 | @@ -12287,6 +12302,15 @@ | |||
864 | 12287 | if you run pt-table-checksum quietly in a cron job, for example, and later want | 12302 | if you run pt-table-checksum quietly in a cron job, for example, and later want |
865 | 12288 | a report on the results of the cron job, perhaps to implement a Nagios check. | 12303 | a report on the results of the cron job, perhaps to implement a Nagios check. |
866 | 12289 | 12304 | ||
867 | 12305 | =item --replicate-check-retries | ||
868 | 12306 | |||
869 | 12307 | type: int; default: 1 | ||
870 | 12308 | |||
871 | 12309 | Retry checksum comparison this many times when a difference is encountered. | ||
872 | 12310 | Only when a difference persists after this number of checks is it considered valid. | ||
873 | 12311 | Using this option with a value of 2 or more alleviates spurious differences that | ||
874 | 12312 | arise when using the --resume option. | ||
875 | 12313 | |||
876 | 12290 | =item --replicate-database | 12314 | =item --replicate-database |
877 | 12291 | 12315 | ||
878 | 12292 | type: string | 12316 | type: string |
879 | @@ -12674,6 +12698,6 @@ | |||
880 | 12674 | 12698 | ||
881 | 12675 | =head1 VERSION | 12699 | =head1 VERSION |
882 | 12676 | 12700 | ||
884 | 12677 | pt-table-checksum 2.2.9 | 12701 | pt-table-checksum 2.2.10 |
885 | 12678 | 12702 | ||
886 | 12679 | =cut | 12703 | =cut |
887 | 12680 | 12704 | ||
888 | === modified file 'bin/pt-table-sync' | |||
889 | --- bin/pt-table-sync 2014-07-04 17:16:08 +0000 | |||
890 | +++ bin/pt-table-sync 2014-08-08 14:10:17 +0000 | |||
891 | @@ -55,7 +55,7 @@ | |||
892 | 55 | { | 55 | { |
893 | 56 | package Percona::Toolkit; | 56 | package Percona::Toolkit; |
894 | 57 | 57 | ||
896 | 58 | our $VERSION = '2.2.9'; | 58 | our $VERSION = '2.2.10'; |
897 | 59 | 59 | ||
898 | 60 | use strict; | 60 | use strict; |
899 | 61 | use warnings FATAL => 'all'; | 61 | use warnings FATAL => 'all'; |
900 | @@ -12768,6 +12768,6 @@ | |||
901 | 12768 | 12768 | ||
902 | 12769 | =head1 VERSION | 12769 | =head1 VERSION |
903 | 12770 | 12770 | ||
905 | 12771 | pt-table-sync 2.2.9 | 12771 | pt-table-sync 2.2.10 |
906 | 12772 | 12772 | ||
907 | 12773 | =cut | 12773 | =cut |
908 | 12774 | 12774 | ||
909 | === modified file 'bin/pt-table-usage' | |||
910 | --- bin/pt-table-usage 2014-07-04 17:16:08 +0000 | |||
911 | +++ bin/pt-table-usage 2014-08-08 14:10:17 +0000 | |||
912 | @@ -1556,12 +1556,13 @@ | |||
913 | 1556 | my ( $class ) = @_; | 1556 | my ( $class ) = @_; |
914 | 1557 | my $self = { | 1557 | my $self = { |
915 | 1558 | pending => [], | 1558 | pending => [], |
916 | 1559 | last_event_offset => undef, | ||
917 | 1559 | }; | 1560 | }; |
918 | 1560 | return bless $self, $class; | 1561 | return bless $self, $class; |
919 | 1561 | } | 1562 | } |
920 | 1562 | 1563 | ||
921 | 1563 | my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/; | 1564 | my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/; |
923 | 1564 | my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]/; | 1565 | my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]\s*(?:Id:\s*(\d+))?/; |
924 | 1565 | my $slow_log_hd_line = qr{ | 1566 | my $slow_log_hd_line = qr{ |
925 | 1566 | ^(?: | 1567 | ^(?: |
926 | 1567 | T[cC][pP]\s[pP]ort:\s+\d+ # case differs on windows/unix | 1568 | T[cC][pP]\s[pP]ort:\s+\d+ # case differs on windows/unix |
927 | @@ -1592,6 +1593,7 @@ | |||
928 | 1592 | or defined($stmt = $next_event->()) | 1593 | or defined($stmt = $next_event->()) |
929 | 1593 | ) { | 1594 | ) { |
930 | 1594 | my @properties = ('cmd', 'Query', 'pos_in_log', $pos_in_log); | 1595 | my @properties = ('cmd', 'Query', 'pos_in_log', $pos_in_log); |
931 | 1596 | $self->{last_event_offset} = $pos_in_log; | ||
932 | 1595 | $pos_in_log = $tell->(); | 1597 | $pos_in_log = $tell->(); |
933 | 1596 | 1598 | ||
934 | 1597 | if ( $stmt =~ s/$slow_log_hd_line//go ){ # Throw away header lines in log | 1599 | if ( $stmt =~ s/$slow_log_hd_line//go ){ # Throw away header lines in log |
935 | @@ -1624,19 +1626,25 @@ | |||
936 | 1624 | push @properties, 'ts', $time; | 1626 | push @properties, 'ts', $time; |
937 | 1625 | ++$got_ts; | 1627 | ++$got_ts; |
938 | 1626 | if ( !$got_uh | 1628 | if ( !$got_uh |
940 | 1627 | && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o ) | 1629 | && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o ) |
941 | 1628 | ) { | 1630 | ) { |
942 | 1629 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); | 1631 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); |
943 | 1630 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; | 1632 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; |
945 | 1631 | ++$got_uh; | 1633 | if ( $thread_id ) { |
946 | 1634 | push @properties, 'Thread_id', $thread_id; | ||
947 | 1635 | } | ||
948 | 1636 | ++$got_uh; | ||
949 | 1632 | } | 1637 | } |
950 | 1633 | } | 1638 | } |
951 | 1634 | 1639 | ||
952 | 1635 | elsif ( !$got_uh | 1640 | elsif ( !$got_uh |
954 | 1636 | && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o ) | 1641 | && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o ) |
955 | 1637 | ) { | 1642 | ) { |
958 | 1638 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); | 1643 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); |
959 | 1639 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; | 1644 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; |
960 | 1645 | if ( $thread_id ) { | ||
961 | 1646 | push @properties, 'Thread_id', $thread_id; | ||
962 | 1647 | } | ||
963 | 1640 | ++$got_uh; | 1648 | ++$got_uh; |
964 | 1641 | } | 1649 | } |
965 | 1642 | 1650 | ||
966 | @@ -1676,14 +1684,25 @@ | |||
967 | 1676 | 1684 | ||
968 | 1677 | if ( !$found_arg && $pos == $len ) { | 1685 | if ( !$found_arg && $pos == $len ) { |
969 | 1678 | PTDEBUG && _d("Did not find arg, looking for special cases"); | 1686 | PTDEBUG && _d("Did not find arg, looking for special cases"); |
971 | 1679 | local $INPUT_RECORD_SEPARATOR = ";\n"; | 1687 | local $INPUT_RECORD_SEPARATOR = ";\n"; # get next line |
972 | 1680 | if ( defined(my $l = $next_event->()) ) { | 1688 | if ( defined(my $l = $next_event->()) ) { |
979 | 1681 | chomp $l; | 1689 | if ( $l =~ /^\s*[A-Z][a-z_]+: / ) { |
980 | 1682 | $l =~ s/^\s+//; | 1690 | PTDEBUG && _d("Found NULL query before", $l); |
981 | 1683 | PTDEBUG && _d("Found admin statement", $l); | 1691 | local $INPUT_RECORD_SEPARATOR = ";\n#"; |
982 | 1684 | push @properties, 'cmd', 'Admin', 'arg', $l; | 1692 | my $rest_of_event = $next_event->(); |
983 | 1685 | push @properties, 'bytes', length($properties[-1]); | 1693 | push @{$self->{pending}}, $l . $rest_of_event; |
984 | 1686 | $found_arg++; | 1694 | push @properties, 'cmd', 'Query', 'arg', '/* No query */'; |
985 | 1695 | push @properties, 'bytes', 0; | ||
986 | 1696 | $found_arg++; | ||
987 | 1697 | } | ||
988 | 1698 | else { | ||
989 | 1699 | chomp $l; | ||
990 | 1700 | $l =~ s/^\s+//; | ||
991 | 1701 | PTDEBUG && _d("Found admin statement", $l); | ||
992 | 1702 | push @properties, 'cmd', 'Admin', 'arg', $l; | ||
993 | 1703 | push @properties, 'bytes', length($properties[-1]); | ||
994 | 1704 | $found_arg++; | ||
995 | 1705 | } | ||
996 | 1687 | } | 1706 | } |
997 | 1688 | else { | 1707 | else { |
998 | 1689 | PTDEBUG && _d("I can't figure out what to do with this line"); | 1708 | PTDEBUG && _d("I can't figure out what to do with this line"); |
999 | @@ -1706,9 +1725,15 @@ | |||
1000 | 1706 | 1725 | ||
1001 | 1707 | PTDEBUG && _d('Properties of event:', Dumper(\@properties)); | 1726 | PTDEBUG && _d('Properties of event:', Dumper(\@properties)); |
1002 | 1708 | my $event = { @properties }; | 1727 | my $event = { @properties }; |
1006 | 1709 | if ( $args{stats} ) { | 1728 | if ( !$event->{arg} ) { |
1007 | 1710 | $args{stats}->{events_read}++; | 1729 | PTDEBUG && _d('Partial event, no arg'); |
1008 | 1711 | $args{stats}->{events_parsed}++; | 1730 | } |
1009 | 1731 | else { | ||
1010 | 1732 | $self->{last_event_offset} = undef; | ||
1011 | 1733 | if ( $args{stats} ) { | ||
1012 | 1734 | $args{stats}->{events_read}++; | ||
1013 | 1735 | $args{stats}->{events_parsed}++; | ||
1014 | 1736 | } | ||
1015 | 1712 | } | 1737 | } |
1016 | 1713 | return $event; | 1738 | return $event; |
1017 | 1714 | } # EVENT | 1739 | } # EVENT |
1018 | @@ -7536,6 +7561,6 @@ | |||
1019 | 7536 | 7561 | ||
1020 | 7537 | =head1 VERSION | 7562 | =head1 VERSION |
1021 | 7538 | 7563 | ||
1023 | 7539 | pt-table-usage 2.2.9 | 7564 | pt-table-usage 2.2.10 |
1024 | 7540 | 7565 | ||
1025 | 7541 | =cut | 7566 | =cut |
1026 | 7542 | 7567 | ||
1027 | === modified file 'bin/pt-upgrade' | |||
1028 | --- bin/pt-upgrade 2014-07-04 17:16:08 +0000 | |||
1029 | +++ bin/pt-upgrade 2014-08-08 14:10:17 +0000 | |||
1030 | @@ -61,7 +61,7 @@ | |||
1031 | 61 | { | 61 | { |
1032 | 62 | package Percona::Toolkit; | 62 | package Percona::Toolkit; |
1033 | 63 | 63 | ||
1035 | 64 | our $VERSION = '2.2.9'; | 64 | our $VERSION = '2.2.10'; |
1036 | 65 | 65 | ||
1037 | 66 | use strict; | 66 | use strict; |
1038 | 67 | use warnings FATAL => 'all'; | 67 | use warnings FATAL => 'all'; |
1039 | @@ -6537,12 +6537,13 @@ | |||
1040 | 6537 | my ( $class ) = @_; | 6537 | my ( $class ) = @_; |
1041 | 6538 | my $self = { | 6538 | my $self = { |
1042 | 6539 | pending => [], | 6539 | pending => [], |
1043 | 6540 | last_event_offset => undef, | ||
1044 | 6540 | }; | 6541 | }; |
1045 | 6541 | return bless $self, $class; | 6542 | return bless $self, $class; |
1046 | 6542 | } | 6543 | } |
1047 | 6543 | 6544 | ||
1048 | 6544 | my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/; | 6545 | my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/; |
1050 | 6545 | my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]/; | 6546 | my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]\s*(?:Id:\s*(\d+))?/; |
1051 | 6546 | my $slow_log_hd_line = qr{ | 6547 | my $slow_log_hd_line = qr{ |
1052 | 6547 | ^(?: | 6548 | ^(?: |
1053 | 6548 | T[cC][pP]\s[pP]ort:\s+\d+ # case differs on windows/unix | 6549 | T[cC][pP]\s[pP]ort:\s+\d+ # case differs on windows/unix |
1054 | @@ -6573,6 +6574,7 @@ | |||
1055 | 6573 | or defined($stmt = $next_event->()) | 6574 | or defined($stmt = $next_event->()) |
1056 | 6574 | ) { | 6575 | ) { |
1057 | 6575 | my @properties = ('cmd', 'Query', 'pos_in_log', $pos_in_log); | 6576 | my @properties = ('cmd', 'Query', 'pos_in_log', $pos_in_log); |
1058 | 6577 | $self->{last_event_offset} = $pos_in_log; | ||
1059 | 6576 | $pos_in_log = $tell->(); | 6578 | $pos_in_log = $tell->(); |
1060 | 6577 | 6579 | ||
1061 | 6578 | if ( $stmt =~ s/$slow_log_hd_line//go ){ # Throw away header lines in log | 6580 | if ( $stmt =~ s/$slow_log_hd_line//go ){ # Throw away header lines in log |
1062 | @@ -6605,19 +6607,25 @@ | |||
1063 | 6605 | push @properties, 'ts', $time; | 6607 | push @properties, 'ts', $time; |
1064 | 6606 | ++$got_ts; | 6608 | ++$got_ts; |
1065 | 6607 | if ( !$got_uh | 6609 | if ( !$got_uh |
1067 | 6608 | && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o ) | 6610 | && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o ) |
1068 | 6609 | ) { | 6611 | ) { |
1069 | 6610 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); | 6612 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); |
1070 | 6611 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; | 6613 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; |
1072 | 6612 | ++$got_uh; | 6614 | if ( $thread_id ) { |
1073 | 6615 | push @properties, 'Thread_id', $thread_id; | ||
1074 | 6616 | } | ||
1075 | 6617 | ++$got_uh; | ||
1076 | 6613 | } | 6618 | } |
1077 | 6614 | } | 6619 | } |
1078 | 6615 | 6620 | ||
1079 | 6616 | elsif ( !$got_uh | 6621 | elsif ( !$got_uh |
1081 | 6617 | && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o ) | 6622 | && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o ) |
1082 | 6618 | ) { | 6623 | ) { |
1085 | 6619 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); | 6624 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); |
1086 | 6620 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; | 6625 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; |
1087 | 6626 | if ( $thread_id ) { | ||
1088 | 6627 | push @properties, 'Thread_id', $thread_id; | ||
1089 | 6628 | } | ||
1090 | 6621 | ++$got_uh; | 6629 | ++$got_uh; |
1091 | 6622 | } | 6630 | } |
1092 | 6623 | 6631 | ||
1093 | @@ -6698,9 +6706,15 @@ | |||
1094 | 6698 | 6706 | ||
1095 | 6699 | PTDEBUG && _d('Properties of event:', Dumper(\@properties)); | 6707 | PTDEBUG && _d('Properties of event:', Dumper(\@properties)); |
1096 | 6700 | my $event = { @properties }; | 6708 | my $event = { @properties }; |
1100 | 6701 | if ( $args{stats} ) { | 6709 | if ( !$event->{arg} ) { |
1101 | 6702 | $args{stats}->{events_read}++; | 6710 | PTDEBUG && _d('Partial event, no arg'); |
1102 | 6703 | $args{stats}->{events_parsed}++; | 6711 | } |
1103 | 6712 | else { | ||
1104 | 6713 | $self->{last_event_offset} = undef; | ||
1105 | 6714 | if ( $args{stats} ) { | ||
1106 | 6715 | $args{stats}->{events_read}++; | ||
1107 | 6716 | $args{stats}->{events_parsed}++; | ||
1108 | 6717 | } | ||
1109 | 6704 | } | 6718 | } |
1110 | 6705 | return $event; | 6719 | return $event; |
1111 | 6706 | } # EVENT | 6720 | } # EVENT |
1112 | @@ -11224,6 +11238,6 @@ | |||
1113 | 11224 | 11238 | ||
1114 | 11225 | =head1 VERSION | 11239 | =head1 VERSION |
1115 | 11226 | 11240 | ||
1117 | 11227 | pt-upgrade 2.2.9 | 11241 | pt-upgrade 2.2.10 |
1118 | 11228 | 11242 | ||
1119 | 11229 | =cut | 11243 | =cut |
1120 | 11230 | 11244 | ||
1121 | === modified file 'bin/pt-variable-advisor' | |||
1122 | --- bin/pt-variable-advisor 2014-07-04 17:16:08 +0000 | |||
1123 | +++ bin/pt-variable-advisor 2014-08-08 14:10:17 +0000 | |||
1124 | @@ -44,7 +44,7 @@ | |||
1125 | 44 | { | 44 | { |
1126 | 45 | package Percona::Toolkit; | 45 | package Percona::Toolkit; |
1127 | 46 | 46 | ||
1129 | 47 | our $VERSION = '2.2.9'; | 47 | our $VERSION = '2.2.10'; |
1130 | 48 | 48 | ||
1131 | 49 | use strict; | 49 | use strict; |
1132 | 50 | use warnings FATAL => 'all'; | 50 | use warnings FATAL => 'all'; |
1133 | @@ -6138,6 +6138,6 @@ | |||
1134 | 6138 | 6138 | ||
1135 | 6139 | =head1 VERSION | 6139 | =head1 VERSION |
1136 | 6140 | 6140 | ||
1138 | 6141 | pt-variable-advisor 2.2.9 | 6141 | pt-variable-advisor 2.2.10 |
1139 | 6142 | 6142 | ||
1140 | 6143 | =cut | 6143 | =cut |
1141 | 6144 | 6144 | ||
1142 | === modified file 'bin/pt-visual-explain' | |||
1143 | --- bin/pt-visual-explain 2014-07-04 17:16:08 +0000 | |||
1144 | +++ bin/pt-visual-explain 2014-08-08 14:10:17 +0000 | |||
1145 | @@ -3243,6 +3243,6 @@ | |||
1146 | 3243 | 3243 | ||
1147 | 3244 | =head1 VERSION | 3244 | =head1 VERSION |
1148 | 3245 | 3245 | ||
1150 | 3246 | pt-visual-explain 2.2.9 | 3246 | pt-visual-explain 2.2.10 |
1151 | 3247 | 3247 | ||
1152 | 3248 | =cut | 3248 | =cut |
1153 | 3249 | 3249 | ||
1154 | === modified file 'config/deb/changelog' | |||
1155 | --- config/deb/changelog 2014-07-08 12:06:12 +0000 | |||
1156 | +++ config/deb/changelog 2014-08-08 14:10:17 +0000 | |||
1157 | @@ -1,3 +1,14 @@ | |||
1158 | 1 | percona-toolkit (2.2.10) unstable; urgency=low | ||
1159 | 2 | |||
1160 | 3 | * Fixed bug 1287253: pt-table-checksum deadlock | ||
1161 | 4 | * Fixed bug 1299387: 5.6 slow query log Thead_id becomes Id | ||
1162 | 5 | * Fixed bug 1311654: pt-table-checksum + PXC inconsistent results upon --resume | ||
1163 | 6 | * Fixed bug 1340728: pt-online-schema-change doesn't work with HASH indexes | ||
1164 | 7 | * Fixed bug 1253872: pt-table-checksum max load 20% rounds down | ||
1165 | 8 | * Fixed bug 1340364: some shell tools output error when queried for --version | ||
1166 | 9 | |||
1167 | 10 | -- Percona Toolkit Developers <toolkit-dev@percona.com> Wed, 06 Aug 2014 19:53:53 +0000 | ||
1168 | 11 | |||
1169 | 1 | percona-toolkit (2.2.9) unstable; urgency=low | 12 | percona-toolkit (2.2.9) unstable; urgency=low |
1170 | 2 | 13 | ||
1171 | 3 | * Fixed bug 1258135: pt-deadlock-logger introduces a noise to MySQL | 14 | * Fixed bug 1258135: pt-deadlock-logger introduces a noise to MySQL |
1172 | 4 | 15 | ||
1173 | === modified file 'config/sphinx-build/conf.py' | |||
1174 | --- config/sphinx-build/conf.py 2014-07-08 12:06:12 +0000 | |||
1175 | +++ config/sphinx-build/conf.py 2014-08-08 14:10:17 +0000 | |||
1176 | @@ -50,7 +50,7 @@ | |||
1177 | 50 | # The short X.Y version. | 50 | # The short X.Y version. |
1178 | 51 | version = '2.2' | 51 | version = '2.2' |
1179 | 52 | # The full version, including alpha/beta/rc tags. | 52 | # The full version, including alpha/beta/rc tags. |
1181 | 53 | release = '2.2.9' | 53 | release = '2.2.10' |
1182 | 54 | 54 | ||
1183 | 55 | # The language for content autogenerated by Sphinx. Refer to documentation | 55 | # The language for content autogenerated by Sphinx. Refer to documentation |
1184 | 56 | # for a list of supported languages. | 56 | # for a list of supported languages. |
1185 | 57 | 57 | ||
1186 | === modified file 'docs/percona-toolkit.pod' | |||
1187 | --- docs/percona-toolkit.pod 2014-07-08 12:06:12 +0000 | |||
1188 | +++ docs/percona-toolkit.pod 2014-08-08 14:10:17 +0000 | |||
1189 | @@ -557,6 +557,6 @@ | |||
1190 | 557 | 557 | ||
1191 | 558 | =head1 VERSION | 558 | =head1 VERSION |
1192 | 559 | 559 | ||
1194 | 560 | Percona Toolkit v2.2.9 released 2014-07-08 | 560 | Percona Toolkit v2.2.10 released 2014-08-06 |
1195 | 561 | 561 | ||
1196 | 562 | =cut | 562 | =cut |
1197 | 563 | 563 | ||
1198 | === modified file 'docs/release_notes.rst' | |||
1199 | --- docs/release_notes.rst 2014-07-08 12:06:12 +0000 | |||
1200 | +++ docs/release_notes.rst 2014-08-08 14:10:17 +0000 | |||
1201 | @@ -1,6 +1,35 @@ | |||
1202 | 1 | Release Notes | 1 | Release Notes |
1203 | 2 | ************* | 2 | ************* |
1204 | 3 | 3 | ||
1205 | 4 | v2.2.10 released 2014-08-06 | ||
1206 | 5 | =========================== | ||
1207 | 6 | |||
1208 | 7 | Percona Toolkit 2.2.10 has been released. This release contains six bug fixes. | ||
1209 | 8 | |||
1210 | 9 | Bugs Fixed: | ||
1211 | 10 | |||
1212 | 11 | * Fixed bug 1287253: pt-table-checksum would exit with error if it would encounter deadlock when doing checksum. This was fixed by retrying the command in case of deadlock error. | ||
1213 | 12 | |||
1214 | 13 | * Fixed bug 1311654: When used with Percona XtraDB Cluster, pt-table-checksum could show incorrect result if --resume option was used. This was fixed by adding a new ``--replicate-check-retries`` command line parameter. If you are having resume problems you can now set ``--replicate-check-retries`` N , where N is the number of times to retry a discrepant checksum (default = 1 , no retries). Setting a value of ``3`` is enough to completely eliminate spurious differences. | ||
1215 | 14 | |||
1216 | 15 | * Fixed bug 1299387: pt-query-digest didn't work correctly do to a changed logging format when field ``Thread_id`` has been renamed to ``Id``. Fixed by implementing support for the new format. | ||
1217 | 16 | |||
1218 | 17 | * Fixed bug 1340728: in some cases, where the index was of type "hash" , pt-online-schema-change would refuse to run because MySQL reported it would not use an index for the select. This check should have been able to be skipped using --nocheck-plan option, but it wasn't. ``--nocheck-plan`` now ignores the chosen index correctly. | ||
1219 | 18 | |||
1220 | 19 | * Fixed bug 1253872: When running pt-table-checksum or pt-online-schema on a server that is unused, setting the 20% max load would fail due to tools rounding the value down. This has been fixed by rounding the value up. | ||
1221 | 20 | |||
1222 | 21 | * Fixed bug 1340364: Due to incompatibility of dash and bash syntax some shell tools were showing error when queried for version. | ||
1223 | 22 | |||
1224 | 23 | Changelog | ||
1225 | 24 | --------- | ||
1226 | 25 | |||
1227 | 26 | * Fixed bug 1287253: pt-table-checksum deadlock | ||
1228 | 27 | * Fixed bug 1299387: 5.6 slow query log Thead_id becomes Id | ||
1229 | 28 | * Fixed bug 1311654: pt-table-checksum + PXC inconsistent results upon --resume | ||
1230 | 29 | * Fixed bug 1340728: pt-online-schema-change doesn't work with HASH indexes | ||
1231 | 30 | * Fixed bug 1253872: pt-table-checksum max load 20% rounds down | ||
1232 | 31 | * Fixed bug 1340364: some shell tools output error when queried for --version | ||
1233 | 32 | |||
1234 | 4 | v2.2.9 released 2014-07-08 | 33 | v2.2.9 released 2014-07-08 |
1235 | 5 | ========================== | 34 | ========================== |
1236 | 6 | 35 | ||
1237 | 7 | 36 | ||
1238 | === modified file 'lib/MySQLStatusWaiter.pm' | |||
1239 | --- lib/MySQLStatusWaiter.pm 2013-01-03 00:19:16 +0000 | |||
1240 | +++ lib/MySQLStatusWaiter.pm 2014-08-08 14:10:17 +0000 | |||
1241 | @@ -24,6 +24,7 @@ | |||
1242 | 24 | 24 | ||
1243 | 25 | use strict; | 25 | use strict; |
1244 | 26 | use warnings FATAL => 'all'; | 26 | use warnings FATAL => 'all'; |
1245 | 27 | use POSIX qw( ceil ); | ||
1246 | 27 | use English qw(-no_match_vars); | 28 | use English qw(-no_match_vars); |
1247 | 28 | use constant PTDEBUG => $ENV{PTDEBUG} || 0; | 29 | use constant PTDEBUG => $ENV{PTDEBUG} || 0; |
1248 | 29 | 30 | ||
1249 | @@ -221,8 +222,8 @@ | |||
1250 | 221 | } | 222 | } |
1251 | 222 | else { | 223 | else { |
1252 | 223 | PTDEBUG && _d('Initial', $var, 'value:', $init_val); | 224 | PTDEBUG && _d('Initial', $var, 'value:', $init_val); |
1255 | 224 | $val = int(($init_val * $threshold_factor) + $init_val); | 225 | $val = ($init_val * $threshold_factor) + $init_val; |
1256 | 225 | $vars->{$var} = $val; | 226 | $vars->{$var} = int(ceil($val)); |
1257 | 226 | } | 227 | } |
1258 | 227 | PTDEBUG && _d('Wait if', $var, '>=', $val); | 228 | PTDEBUG && _d('Wait if', $var, '>=', $val); |
1259 | 228 | } | 229 | } |
1260 | 229 | 230 | ||
1261 | === modified file 'lib/Percona/Toolkit.pm' | |||
1262 | --- lib/Percona/Toolkit.pm 2014-07-04 16:13:38 +0000 | |||
1263 | +++ lib/Percona/Toolkit.pm 2014-08-08 14:10:17 +0000 | |||
1264 | @@ -18,7 +18,7 @@ | |||
1265 | 18 | # ########################################################################### | 18 | # ########################################################################### |
1266 | 19 | package Percona::Toolkit; | 19 | package Percona::Toolkit; |
1267 | 20 | 20 | ||
1269 | 21 | our $VERSION = '2.2.9'; | 21 | our $VERSION = '2.2.10'; |
1270 | 22 | 22 | ||
1271 | 23 | use strict; | 23 | use strict; |
1272 | 24 | use warnings FATAL => 'all'; | 24 | use warnings FATAL => 'all'; |
1273 | 25 | 25 | ||
1274 | === modified file 'lib/RowChecksum.pm' | |||
1275 | --- lib/RowChecksum.pm 2013-01-03 00:19:16 +0000 | |||
1276 | +++ lib/RowChecksum.pm 2014-08-08 14:10:17 +0000 | |||
1277 | @@ -459,19 +459,28 @@ | |||
1278 | 459 | } | 459 | } |
1279 | 460 | my ($dbh, $repl_table) = @args{@required_args}; | 460 | my ($dbh, $repl_table) = @args{@required_args}; |
1280 | 461 | 461 | ||
1294 | 462 | my $sql | 462 | |
1295 | 463 | = "SELECT CONCAT(db, '.', tbl) AS `table`, " | 463 | my $tries = $self->{'OptionParser'}->get('replicate-check-retries') || 1; |
1296 | 464 | . "chunk, chunk_index, lower_boundary, upper_boundary, " | 464 | my $diffs; |
1297 | 465 | . "COALESCE(this_cnt-master_cnt, 0) AS cnt_diff, " | 465 | while ($tries--) { |
1298 | 466 | . "COALESCE(" | 466 | my $sql |
1299 | 467 | . "this_crc <> master_crc OR ISNULL(master_crc) <> ISNULL(this_crc), 0" | 467 | = "SELECT CONCAT(db, '.', tbl) AS `table`, " |
1300 | 468 | . ") AS crc_diff, this_cnt, master_cnt, this_crc, master_crc " | 468 | . "chunk, chunk_index, lower_boundary, upper_boundary, " |
1301 | 469 | . "FROM $repl_table " | 469 | . "COALESCE(this_cnt-master_cnt, 0) AS cnt_diff, " |
1302 | 470 | . "WHERE (master_cnt <> this_cnt OR master_crc <> this_crc " | 470 | . "COALESCE(" |
1303 | 471 | . "OR ISNULL(master_crc) <> ISNULL(this_crc))" | 471 | . "this_crc <> master_crc OR ISNULL(master_crc) <> ISNULL(this_crc), 0" |
1304 | 472 | . ($args{where} ? " AND ($args{where})" : ""); | 472 | . ") AS crc_diff, this_cnt, master_cnt, this_crc, master_crc " |
1305 | 473 | PTDEBUG && _d($sql); | 473 | . "FROM $repl_table " |
1306 | 474 | my $diffs = $dbh->selectall_arrayref($sql, { Slice => {} }); | 474 | . "WHERE (master_cnt <> this_cnt OR master_crc <> this_crc " |
1307 | 475 | . "OR ISNULL(master_crc) <> ISNULL(this_crc)) " | ||
1308 | 476 | . ($args{where} ? " AND ($args{where})" : ""); | ||
1309 | 477 | PTDEBUG && _d($sql); | ||
1310 | 478 | $diffs = $dbh->selectall_arrayref($sql, { Slice => {} }); | ||
1311 | 479 | if (!@$diffs || !$tries) { # if no differences are found OR we are out of tries left... | ||
1312 | 480 | last; # get out now | ||
1313 | 481 | } | ||
1314 | 482 | sleep 1; | ||
1315 | 483 | } | ||
1316 | 475 | return $diffs; | 484 | return $diffs; |
1317 | 476 | } | 485 | } |
1318 | 477 | 486 | ||
1319 | 478 | 487 | ||
1320 | === modified file 'lib/SlowLogParser.pm' | |||
1321 | --- lib/SlowLogParser.pm 2013-05-08 03:19:37 +0000 | |||
1322 | +++ lib/SlowLogParser.pm 2014-08-08 14:10:17 +0000 | |||
1323 | @@ -42,7 +42,7 @@ | |||
1324 | 42 | } | 42 | } |
1325 | 43 | 43 | ||
1326 | 44 | my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/; | 44 | my $slow_log_ts_line = qr/^# Time: ([0-9: ]{15})/; |
1328 | 45 | my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]/; | 45 | my $slow_log_uh_line = qr/# User\@Host: ([^\[]+|\[[^[]+\]).*?@ (\S*) \[(.*)\]\s*(?:Id:\s*(\d+))?/; |
1329 | 46 | # These can appear in the log file when it's opened -- for example, when someone | 46 | # These can appear in the log file when it's opened -- for example, when someone |
1330 | 47 | # runs FLUSH LOGS or the server starts. | 47 | # runs FLUSH LOGS or the server starts. |
1331 | 48 | # /usr/sbin/mysqld, Version: 5.0.67-0ubuntu6-log ((Ubuntu)). started with: | 48 | # /usr/sbin/mysqld, Version: 5.0.67-0ubuntu6-log ((Ubuntu)). started with: |
1332 | @@ -159,21 +159,29 @@ | |||
1333 | 159 | ++$got_ts; | 159 | ++$got_ts; |
1334 | 160 | # The User@Host might be concatenated onto the end of the Time. | 160 | # The User@Host might be concatenated onto the end of the Time. |
1335 | 161 | if ( !$got_uh | 161 | if ( !$got_uh |
1337 | 162 | && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o ) | 162 | && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o ) |
1338 | 163 | ) { | 163 | ) { |
1339 | 164 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); | 164 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); |
1340 | 165 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; | 165 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; |
1342 | 166 | ++$got_uh; | 166 | # 5.6 has the thread id on the User@Host line |
1343 | 167 | if ( $thread_id ) { | ||
1344 | 168 | push @properties, 'Thread_id', $thread_id; | ||
1345 | 169 | } | ||
1346 | 170 | ++$got_uh; | ||
1347 | 167 | } | 171 | } |
1348 | 168 | } | 172 | } |
1349 | 169 | 173 | ||
1350 | 170 | # Maybe it's the user/host line of a slow query log | 174 | # Maybe it's the user/host line of a slow query log |
1351 | 171 | # # User@Host: root[root] @ localhost [] | 175 | # # User@Host: root[root] @ localhost [] |
1352 | 172 | elsif ( !$got_uh | 176 | elsif ( !$got_uh |
1354 | 173 | && ( my ( $user, $host, $ip ) = $line =~ m/$slow_log_uh_line/o ) | 177 | && ( my ( $user, $host, $ip, $thread_id ) = $line =~ m/$slow_log_uh_line/o ) |
1355 | 174 | ) { | 178 | ) { |
1358 | 175 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); | 179 | PTDEBUG && _d("Got user, host, ip", $user, $host, $ip); |
1359 | 176 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; | 180 | push @properties, 'user', $user, 'host', $host, 'ip', $ip; |
1360 | 181 | # 5.6 has the thread id on the User@Host line | ||
1361 | 182 | if ( $thread_id ) { | ||
1362 | 183 | push @properties, 'Thread_id', $thread_id; | ||
1363 | 184 | } | ||
1364 | 177 | ++$got_uh; | 185 | ++$got_uh; |
1365 | 178 | } | 186 | } |
1366 | 179 | 187 | ||
1367 | 180 | 188 | ||
1368 | === modified file 'lib/bash/parse_options.sh' | |||
1369 | --- lib/bash/parse_options.sh 2013-08-09 21:21:55 +0000 | |||
1370 | +++ lib/bash/parse_options.sh 2014-08-08 14:10:17 +0000 | |||
1371 | @@ -76,9 +76,10 @@ | |||
1372 | 76 | 76 | ||
1373 | 77 | usage_or_errors() { | 77 | usage_or_errors() { |
1374 | 78 | local file="$1" | 78 | local file="$1" |
1375 | 79 | local version="" | ||
1376 | 79 | 80 | ||
1377 | 80 | if [ "$OPT_VERSION" ]; then | 81 | if [ "$OPT_VERSION" ]; then |
1379 | 81 | local version=$(grep '^pt-[^ ]\+ [0-9]' "$file") | 82 | version=$(grep '^pt-[^ ]\+ [0-9]' "$file") |
1380 | 82 | echo "$version" | 83 | echo "$version" |
1381 | 83 | return 1 | 84 | return 1 |
1382 | 84 | fi | 85 | fi |
1383 | 85 | 86 | ||
1384 | === modified file 't/lib/MySQLStatusWaiter.t' | |||
1385 | --- t/lib/MySQLStatusWaiter.t 2012-05-25 21:27:23 +0000 | |||
1386 | +++ t/lib/MySQLStatusWaiter.t 2014-08-08 14:10:17 +0000 | |||
1387 | @@ -8,6 +8,7 @@ | |||
1388 | 8 | 8 | ||
1389 | 9 | use strict; | 9 | use strict; |
1390 | 10 | use warnings FATAL => 'all'; | 10 | use warnings FATAL => 'all'; |
1391 | 11 | use POSIX qw( ceil floor ); | ||
1392 | 11 | use English qw(-no_match_vars); | 12 | use English qw(-no_match_vars); |
1393 | 12 | use Test::More tests => 17; | 13 | use Test::More tests => 17; |
1394 | 13 | 14 | ||
1395 | @@ -19,6 +20,7 @@ | |||
1396 | 19 | my $slept = 0; | 20 | my $slept = 0; |
1397 | 20 | my @vals = (); | 21 | my @vals = (); |
1398 | 21 | 22 | ||
1399 | 23 | |||
1400 | 22 | sub oktorun { | 24 | sub oktorun { |
1401 | 23 | return $oktorun; | 25 | return $oktorun; |
1402 | 24 | } | 26 | } |
1403 | @@ -76,33 +78,35 @@ | |||
1404 | 76 | "Catch non-existent variable" | 78 | "Catch non-existent variable" |
1405 | 77 | ); | 79 | ); |
1406 | 78 | 80 | ||
1410 | 79 | # ############################################################################ | 81 | |
1411 | 80 | # Use initial vals + 20%. | 82 | # ############################################################################ |
1412 | 81 | # ############################################################################ | 83 | # Initial vals + 20% |
1413 | 84 | # ############################################################################ | ||
1414 | 85 | |||
1415 | 82 | @vals = ( | 86 | @vals = ( |
1416 | 83 | # initial check for existence | 87 | # initial check for existence |
1419 | 84 | { Threads_connected => 10, }, | 88 | { Threads_connected => 9, }, |
1420 | 85 | { Threads_running => 5, }, | 89 | { Threads_running => 4, }, |
1421 | 86 | 90 | ||
1422 | 87 | # first check, no wait | 91 | # first check, no wait |
1423 | 88 | { Threads_connected => 1, }, | 92 | { Threads_connected => 1, }, |
1424 | 89 | { Threads_running => 1, }, | 93 | { Threads_running => 1, }, |
1425 | 90 | 94 | ||
1426 | 91 | # second check, wait | 95 | # second check, wait |
1429 | 92 | { Threads_connected => 12, }, # too high | 96 | { Threads_connected => 11, }, # too high |
1430 | 93 | { Threads_running => 6, }, # too high | 97 | { Threads_running => 5, }, # too high |
1431 | 94 | 98 | ||
1432 | 95 | # third check, wait | 99 | # third check, wait |
1435 | 96 | { Threads_connected => 12, }, # too high | 100 | { Threads_connected => 11, }, # too high |
1436 | 97 | { Threads_running => 5, }, | 101 | { Threads_running => 4, }, |
1437 | 98 | 102 | ||
1438 | 99 | # fourth check, wait | 103 | # fourth check, wait |
1439 | 100 | { Threads_connected => 10, }, | 104 | { Threads_connected => 10, }, |
1441 | 101 | { Threads_running => 6, }, # too high | 105 | { Threads_running => 5, }, # too high |
1442 | 102 | 106 | ||
1443 | 103 | # fifth check, no wait | 107 | # fifth check, no wait |
1444 | 104 | { Threads_connected => 10, }, | 108 | { Threads_connected => 10, }, |
1446 | 105 | { Threads_running => 5, }, | 109 | { Threads_running => 4, }, |
1447 | 106 | ); | 110 | ); |
1448 | 107 | 111 | ||
1449 | 108 | $oktorun = 1; | 112 | $oktorun = 1; |
1450 | @@ -117,10 +121,10 @@ | |||
1451 | 117 | is_deeply( | 121 | is_deeply( |
1452 | 118 | $sw->max_values(), | 122 | $sw->max_values(), |
1453 | 119 | { | 123 | { |
1456 | 120 | Threads_connected => int(10 + (10 * 0.20)), | 124 | Threads_connected => ceil(9 + (9 * 0.20)), |
1457 | 121 | Threads_running => int(5 + (5 * 0.20)), | 125 | Threads_running => ceil(4 + (4 * 0.20)), |
1458 | 122 | }, | 126 | }, |
1460 | 123 | "Initial values +20%" | 127 | "Threshold = ceil(InitialValue * 1.2)" |
1461 | 124 | ); | 128 | ); |
1462 | 125 | 129 | ||
1463 | 126 | # first check | 130 | # first check |
1464 | 127 | 131 | ||
1465 | === modified file 't/lib/SlowLogParser.t' | |||
1466 | --- t/lib/SlowLogParser.t 2012-12-11 01:07:36 +0000 | |||
1467 | +++ t/lib/SlowLogParser.t 2014-08-08 14:10:17 +0000 | |||
1468 | @@ -1349,6 +1349,70 @@ | |||
1469 | 1349 | ], | 1349 | ], |
1470 | 1350 | ); | 1350 | ); |
1471 | 1351 | 1351 | ||
1472 | 1352 | |||
1473 | 1353 | # ############################################################################# | ||
1474 | 1354 | # pt-query-digest fails to parse Thread_id on 5.6 | ||
1475 | 1355 | # https://bugs.launchpad.net/percona-toolkit/+bug/1299387 | ||
1476 | 1356 | # ############################################################################# | ||
1477 | 1357 | |||
1478 | 1358 | # first test with a Percona 5.5 slow log (includes an explicit Thread_id line) | ||
1479 | 1359 | # (MySQL 5.5 doesn't include thread id) | ||
1480 | 1360 | test_log_parser( | ||
1481 | 1361 | parser => $p, | ||
1482 | 1362 | file => "$sample/slow060.txt", | ||
1483 | 1363 | result => [ | ||
1484 | 1364 | { | ||
1485 | 1365 | Thread_id => '1', # here's our item | ||
1486 | 1366 | Bytes_sent => '64', | ||
1487 | 1367 | Killed => '0', | ||
1488 | 1368 | Last_errno => '0', | ||
1489 | 1369 | Lock_time => '0.000000', | ||
1490 | 1370 | Query_time => '10.000373', | ||
1491 | 1371 | Rows_affected => '0', | ||
1492 | 1372 | Rows_examined => '0', | ||
1493 | 1373 | Rows_read => '0', | ||
1494 | 1374 | Rows_sent => '1', | ||
1495 | 1375 | arg => 'select sleep(10)', | ||
1496 | 1376 | bytes => 16, | ||
1497 | 1377 | cmd => 'Query', | ||
1498 | 1378 | host => 'localhost', | ||
1499 | 1379 | ip => '127.0.0.1', | ||
1500 | 1380 | pos_in_log => 0, | ||
1501 | 1381 | timestamp => '1405358212', | ||
1502 | 1382 | ts => '140714 14:16:52', | ||
1503 | 1383 | user => 'root' | ||
1504 | 1384 | }, | ||
1505 | 1385 | ], | ||
1506 | 1386 | ); | ||
1507 | 1387 | |||
1508 | 1388 | # now test with a Percona 5.6 slow log. Thread_id is now on the user@host line, and is called 'Id'. | ||
1509 | 1389 | # (this is in line with MySQL 5.6) | ||
1510 | 1390 | test_log_parser( | ||
1511 | 1391 | parser => $p, | ||
1512 | 1392 | file => "$sample/slow061.txt", | ||
1513 | 1393 | result => [ | ||
1514 | 1394 | { | ||
1515 | 1395 | Thread_id => 1, # here's our item | ||
1516 | 1396 | Bytes_sent => '64', | ||
1517 | 1397 | Lock_time => '0.000000', | ||
1518 | 1398 | Query_time => '11.013723', | ||
1519 | 1399 | Rows_affected => '0', | ||
1520 | 1400 | Rows_examined => '0', | ||
1521 | 1401 | Rows_sent => '1', | ||
1522 | 1402 | arg => 'select sleep(11)', | ||
1523 | 1403 | bytes => 16, | ||
1524 | 1404 | cmd => 'Query', | ||
1525 | 1405 | host => 'localhost', | ||
1526 | 1406 | ip => '127.0.0.1', | ||
1527 | 1407 | pos_in_log => 0, | ||
1528 | 1408 | timestamp => '1405360304', | ||
1529 | 1409 | ts => '140714 14:51:44', | ||
1530 | 1410 | user => 'root', | ||
1531 | 1411 | }, | ||
1532 | 1412 | ], | ||
1533 | 1413 | ); | ||
1534 | 1414 | |||
1535 | 1415 | |||
1536 | 1352 | # ############################################################################# | 1416 | # ############################################################################# |
1537 | 1353 | # Done. | 1417 | # Done. |
1538 | 1354 | # ############################################################################# | 1418 | # ############################################################################# |
1539 | 1355 | 1419 | ||
1540 | === added file 't/lib/samples/slowlogs/slow060.txt' | |||
1541 | --- t/lib/samples/slowlogs/slow060.txt 1970-01-01 00:00:00 +0000 | |||
1542 | +++ t/lib/samples/slowlogs/slow060.txt 2014-08-08 14:10:17 +0000 | |||
1543 | @@ -0,0 +1,10 @@ | |||
1544 | 1 | bin/mysqld, Version: 5.5.38-35.2-log (Percona Server (GPL), Release 35.2, Revision 674). started with: | ||
1545 | 2 | Tcp port: 3306 Unix socket: (null) | ||
1546 | 3 | Time Id Command Argument | ||
1547 | 4 | # Time: 140714 14:16:52 | ||
1548 | 5 | # User@Host: root[root] @ localhost [127.0.0.1] | ||
1549 | 6 | # Thread_id: 1 Schema: Last_errno: 0 Killed: 0 | ||
1550 | 7 | # Query_time: 10.000373 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0 Rows_affected: 0 Rows_read: 0 | ||
1551 | 8 | # Bytes_sent: 64 | ||
1552 | 9 | SET timestamp=1405358212; | ||
1553 | 10 | select sleep(10); | ||
1554 | 0 | 11 | ||
1555 | === added file 't/lib/samples/slowlogs/slow061.txt' | |||
1556 | --- t/lib/samples/slowlogs/slow061.txt 1970-01-01 00:00:00 +0000 | |||
1557 | +++ t/lib/samples/slowlogs/slow061.txt 2014-08-08 14:10:17 +0000 | |||
1558 | @@ -0,0 +1,10 @@ | |||
1559 | 1 | bin/mysqld, Version: 5.6.19-67.0-log (Percona Server (GPL), Release 67.0, Revision 618). started with: | ||
1560 | 2 | Tcp port: 3306 Unix socket: (null) | ||
1561 | 3 | Time Id Command Argument | ||
1562 | 4 | # Time: 140714 14:51:44 | ||
1563 | 5 | # User@Host: root[root] @ localhost [127.0.0.1] Id: 1 | ||
1564 | 6 | # Schema: Last_errno: 0 Killed: 0 | ||
1565 | 7 | # Query_time: 11.013723 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0 Rows_affected: 0 | ||
1566 | 8 | # Bytes_sent: 64 | ||
1567 | 9 | SET timestamp=1405360304; | ||
1568 | 10 | select sleep(11); | ||
1569 | 0 | 11 | ||
1570 | === removed file 't/pt-online-schema-change/bug-1315130.t' | |||
1571 | --- t/pt-online-schema-change/bug-1315130.t 2014-06-20 21:31:30 +0000 | |||
1572 | +++ t/pt-online-schema-change/bug-1315130.t 1970-01-01 00:00:00 +0000 | |||
1573 | @@ -1,78 +0,0 @@ | |||
1574 | 1 | #!/usr/bin/env perl | ||
1575 | 2 | |||
1576 | 3 | BEGIN { | ||
1577 | 4 | die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n" | ||
1578 | 5 | unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH}; | ||
1579 | 6 | unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib"; | ||
1580 | 7 | }; | ||
1581 | 8 | |||
1582 | 9 | use strict; | ||
1583 | 10 | use warnings FATAL => 'all'; | ||
1584 | 11 | use English qw(-no_match_vars); | ||
1585 | 12 | use Test::More; | ||
1586 | 13 | use Time::HiRes qw(sleep); | ||
1587 | 14 | |||
1588 | 15 | $ENV{PTTEST_FAKE_TS} = 1; | ||
1589 | 16 | $ENV{PERCONA_TOOLKIT_TEST_USE_DSN_NAMES} = 1; | ||
1590 | 17 | |||
1591 | 18 | use PerconaTest; | ||
1592 | 19 | use Sandbox; | ||
1593 | 20 | require "$trunk/bin/pt-online-schema-change"; | ||
1594 | 21 | require VersionParser; | ||
1595 | 22 | |||
1596 | 23 | use Data::Dumper; | ||
1597 | 24 | $Data::Dumper::Indent = 1; | ||
1598 | 25 | $Data::Dumper::Sortkeys = 1; | ||
1599 | 26 | $Data::Dumper::Quotekeys = 0; | ||
1600 | 27 | |||
1601 | 28 | my $dp = new DSNParser(opts=>$dsn_opts); | ||
1602 | 29 | my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); | ||
1603 | 30 | my $master_dbh = $sb->get_dbh_for('master'); | ||
1604 | 31 | my $slave_dbh = $sb->get_dbh_for('slave1'); | ||
1605 | 32 | |||
1606 | 33 | if ( !$master_dbh ) { | ||
1607 | 34 | plan skip_all => 'Cannot connect to sandbox master'; | ||
1608 | 35 | } | ||
1609 | 36 | elsif ( !$slave_dbh ) { | ||
1610 | 37 | plan skip_all => 'Cannot connect to sandbox slave'; | ||
1611 | 38 | } | ||
1612 | 39 | |||
1613 | 40 | my $q = new Quoter(); | ||
1614 | 41 | my $tp = new TableParser(Quoter => $q); | ||
1615 | 42 | my @args = qw(--set-vars innodb_lock_wait_timeout=3); | ||
1616 | 43 | my $output = ""; | ||
1617 | 44 | my $dsn = "h=127.1,P=12345,u=msandbox,p=msandbox"; | ||
1618 | 45 | my $exit = 0; | ||
1619 | 46 | my $sample = "t/pt-online-schema-change/samples"; | ||
1620 | 47 | my $rows; | ||
1621 | 48 | |||
1622 | 49 | |||
1623 | 50 | # ############################################################################# | ||
1624 | 51 | # Issue 1315130 | ||
1625 | 52 | # Failed to detect child tables in other schema, and falsely identified | ||
1626 | 53 | # child tables in own schema | ||
1627 | 54 | # ############################################################################# | ||
1628 | 55 | |||
1629 | 56 | $sb->load_file('master', "$sample/bug-1315130_cleanup.sql"); | ||
1630 | 57 | $sb->load_file('master', "$sample/bug-1315130.sql"); | ||
1631 | 58 | ($output, $exit) = full_output( | ||
1632 | 59 | sub { pt_online_schema_change::main(@args, "$dsn,D=bug_1315130_a,t=parent_table", | ||
1633 | 60 | '--dry-run', | ||
1634 | 61 | '--alter', "add column c varchar(16)", | ||
1635 | 62 | '--alter-foreign-keys-method', 'auto'), | ||
1636 | 63 | }, | ||
1637 | 64 | ); | ||
1638 | 65 | print STDERR "[$output]\n"; | ||
1639 | 66 | like( | ||
1640 | 67 | $output, | ||
1641 | 68 | qr/Child tables:\s*`bug_1315130_a`\.`child_table_in_same_schema` \(approx\. 1 rows\)\s*`bug_1315130_b`\.`child_table_in_second_schema` \(approx\. 1 rows\)[^`]*?Will/s, | ||
1642 | 69 | "Correctly identify child tables from other schemas and ignores tables from same schema referencig same named parent in other schema.", | ||
1643 | 70 | ); | ||
1644 | 71 | # clear databases with their foreign keys | ||
1645 | 72 | $sb->load_file('master', "$sample/bug-1315130_cleanup.sql"); | ||
1646 | 73 | |||
1647 | 74 | # Done. | ||
1648 | 75 | # ############################################################################# | ||
1649 | 76 | $sb->wipe_clean($master_dbh); | ||
1650 | 77 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); | ||
1651 | 78 | done_testing; | ||
1652 | 79 | 0 | ||
1653 | === modified file 't/pt-online-schema-change/bugs.t' | |||
1654 | --- t/pt-online-schema-change/bugs.t 2013-06-26 20:28:27 +0000 | |||
1655 | +++ t/pt-online-schema-change/bugs.t 2014-08-08 14:10:17 +0000 | |||
1656 | @@ -124,7 +124,11 @@ | |||
1657 | 124 | { | 124 | { |
1658 | 125 | my $o = new OptionParser(file => "$trunk/bin/pt-table-checksum"); | 125 | my $o = new OptionParser(file => "$trunk/bin/pt-table-checksum"); |
1659 | 126 | $o->get_specs(); | 126 | $o->get_specs(); |
1660 | 127 | |||
1661 | 128 | $o->set('check-plan', 1); # check-plan is true by default | ||
1662 | 129 | |||
1663 | 127 | no warnings; | 130 | no warnings; |
1664 | 131 | |||
1665 | 128 | local *pt_online_schema_change::explain_statement = sub { | 132 | local *pt_online_schema_change::explain_statement = sub { |
1666 | 129 | return { key => 'some_key' } | 133 | return { key => 'some_key' } |
1667 | 130 | }; | 134 | }; |
1668 | @@ -369,6 +373,66 @@ | |||
1669 | 369 | "Bug 1188264: warning about expected MySQL error 1265" | 373 | "Bug 1188264: warning about expected MySQL error 1265" |
1670 | 370 | ); | 374 | ); |
1671 | 371 | 375 | ||
1672 | 376 | |||
1673 | 377 | # ############################################################################# | ||
1674 | 378 | # Issue 1315130 | ||
1675 | 379 | # Failed to detect child tables in other schema, and falsely identified | ||
1676 | 380 | # child tables in own schema | ||
1677 | 381 | # ############################################################################# | ||
1678 | 382 | |||
1679 | 383 | $sb->load_file('master', "$sample/bug-1315130_cleanup.sql"); | ||
1680 | 384 | $sb->load_file('master', "$sample/bug-1315130.sql"); | ||
1681 | 385 | |||
1682 | 386 | $output = output( | ||
1683 | 387 | sub { pt_online_schema_change::main(@args, "$master_dsn,D=bug_1315130_a,t=parent_table", | ||
1684 | 388 | '--dry-run', | ||
1685 | 389 | '--alter', "add column c varchar(16)", | ||
1686 | 390 | '--alter-foreign-keys-method', 'auto'), | ||
1687 | 391 | }, | ||
1688 | 392 | ); | ||
1689 | 393 | |||
1690 | 394 | like( | ||
1691 | 395 | $output, | ||
1692 | 396 | qr/Child tables:\s*`bug_1315130_a`\.`child_table_in_same_schema` \(approx\. 1 rows\)\s*`bug_1315130_b`\.`child_table_in_second_schema` \(approx\. 1 rows\)[^`]*?Will/s, | ||
1693 | 397 | "Correctly identify child tables from other schemas and ignores tables from same schema referencig same named parent in other schema.", | ||
1694 | 398 | ); | ||
1695 | 399 | # clear databases with their foreign keys | ||
1696 | 400 | $sb->load_file('master', "$sample/bug-1315130_cleanup.sql"); | ||
1697 | 401 | |||
1698 | 402 | |||
1699 | 403 | # ############################################################################# | ||
1700 | 404 | # Issue 1340728 | ||
1701 | 405 | # fails when no index is returned in EXPLAIN, even though --nocheck-plan is set | ||
1702 | 406 | # (happens on HASH indexes) | ||
1703 | 407 | # ############################################################################# | ||
1704 | 408 | |||
1705 | 409 | $sb->load_file('master', "$sample/bug-1340728_cleanup.sql"); | ||
1706 | 410 | $sb->load_file('master', "$sample/bug-1340728.sql"); | ||
1707 | 411 | |||
1708 | 412 | # insert a few thousand rows (else test isn't valid) | ||
1709 | 413 | my $rows = 5000; | ||
1710 | 414 | for (my $i = 0; $i < $rows; $i++) { | ||
1711 | 415 | $master_dbh->do("INSERT INTO bug_1340728.test VALUES (NULL, 'xx')"); | ||
1712 | 416 | } | ||
1713 | 417 | |||
1714 | 418 | |||
1715 | 419 | $output = output( | ||
1716 | 420 | sub { pt_online_schema_change::main(@args, "$master_dsn,D=bug_1340728,t=test", | ||
1717 | 421 | '--execute', | ||
1718 | 422 | '--alter', "ADD COLUMN c INT", | ||
1719 | 423 | '--nocheck-plan', | ||
1720 | 424 | ), | ||
1721 | 425 | }, | ||
1722 | 426 | ); | ||
1723 | 427 | |||
1724 | 428 | like( | ||
1725 | 429 | $output, | ||
1726 | 430 | qr/Successfully altered/s, | ||
1727 | 431 | "--nocheck-plan ignores plans without index", | ||
1728 | 432 | ); | ||
1729 | 433 | # clear databases | ||
1730 | 434 | $sb->load_file('master', "$sample/bug-1340728_cleanup.sql"); | ||
1731 | 435 | |||
1732 | 372 | # ############################################################################# | 436 | # ############################################################################# |
1733 | 373 | # Done. | 437 | # Done. |
1734 | 374 | # ############################################################################# | 438 | # ############################################################################# |
1735 | 375 | 439 | ||
1736 | === added file 't/pt-online-schema-change/samples/bug-1340728.sql' | |||
1737 | --- t/pt-online-schema-change/samples/bug-1340728.sql 1970-01-01 00:00:00 +0000 | |||
1738 | +++ t/pt-online-schema-change/samples/bug-1340728.sql 2014-08-08 14:10:17 +0000 | |||
1739 | @@ -0,0 +1,10 @@ | |||
1740 | 1 | drop database if exists bug_1340728; | ||
1741 | 2 | create database bug_1340728; | ||
1742 | 3 | use bug_1340728; | ||
1743 | 4 | |||
1744 | 5 | CREATE TABLE `test` ( | ||
1745 | 6 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
1746 | 7 | `name` char(2) NOT NULL, | ||
1747 | 8 | PRIMARY KEY (`id`) USING HASH | ||
1748 | 9 | ) ENGINE=MEMORY DEFAULT CHARSET=latin1; | ||
1749 | 10 | |||
1750 | 0 | 11 | ||
1751 | === added file 't/pt-online-schema-change/samples/bug-1340728_cleanup.sql' | |||
1752 | --- t/pt-online-schema-change/samples/bug-1340728_cleanup.sql 1970-01-01 00:00:00 +0000 | |||
1753 | +++ t/pt-online-schema-change/samples/bug-1340728_cleanup.sql 2014-08-08 14:10:17 +0000 | |||
1754 | @@ -0,0 +1,2 @@ | |||
1755 | 1 | drop database if exists bug_1340728; | ||
1756 | 2 | |||
1757 | 0 | 3 | ||
1758 | === modified file 't/pt-query-digest/since_until.t' | |||
1759 | --- t/pt-query-digest/since_until.t 2013-03-05 16:59:33 +0000 | |||
1760 | +++ t/pt-query-digest/since_until.t 2014-08-08 14:10:17 +0000 | |||
1761 | @@ -52,16 +52,16 @@ | |||
1762 | 52 | '--since 090727' | 52 | '--since 090727' |
1763 | 53 | ); | 53 | ); |
1764 | 54 | 54 | ||
1766 | 55 | # This test will fail come July 2014. | 55 | # This test will fail come July 2015. |
1767 | 56 | ok( | 56 | ok( |
1768 | 57 | no_diff( | 57 | no_diff( |
1769 | 58 | sub { pt_query_digest::main(@args, | 58 | sub { pt_query_digest::main(@args, |
1771 | 59 | "$sample_in/slow033.txt", qw(--since 1825d), | 59 | "$sample_in/slow033.txt", qw(--since 2190d), |
1772 | 60 | )}, | 60 | )}, |
1773 | 61 | "t/pt-query-digest/samples/slow033-since-Nd.txt", | 61 | "t/pt-query-digest/samples/slow033-since-Nd.txt", |
1774 | 62 | stderr => 1, | 62 | stderr => 1, |
1775 | 63 | ), | 63 | ), |
1777 | 64 | '--since 1825d (5 years ago)' | 64 | '--since 2190d (6 years ago)' |
1778 | 65 | ); | 65 | ); |
1779 | 66 | 66 | ||
1780 | 67 | # --until | 67 | # --until |
1781 | 68 | 68 | ||
1782 | === modified file 't/pt-table-checksum/basics.t' | |||
1783 | --- t/pt-table-checksum/basics.t 2014-07-07 00:43:50 +0000 | |||
1784 | +++ t/pt-table-checksum/basics.t 2014-08-08 14:10:17 +0000 | |||
1785 | @@ -80,8 +80,8 @@ | |||
1786 | 80 | # other than to ensure that there's at least one for each table. | 80 | # other than to ensure that there's at least one for each table. |
1787 | 81 | $row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums"); | 81 | $row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums"); |
1788 | 82 | ok( | 82 | ok( |
1791 | 83 | $row->[0] > 30 && $row->[0] < 50, | 83 | $row->[0] > 30 && $row->[0] < 60, |
1792 | 84 | 'Between 30 and 50 chunks' | 84 | 'Between 30 and 60 chunks' |
1793 | 85 | ) or diag($row->[0]); | 85 | ) or diag($row->[0]); |
1794 | 86 | 86 | ||
1795 | 87 | # ############################################################################ | 87 | # ############################################################################ |
1796 | @@ -97,6 +97,7 @@ | |||
1797 | 97 | "Static chunk size (--chunk-time 0)" | 97 | "Static chunk size (--chunk-time 0)" |
1798 | 98 | ); | 98 | ); |
1799 | 99 | 99 | ||
1800 | 100 | |||
1801 | 100 | $row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums"); | 101 | $row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums"); |
1802 | 101 | ok( | 102 | ok( |
1803 | 102 | $row->[0] >= 85 && $row->[0] <= 90, | 103 | $row->[0] >= 85 && $row->[0] <= 90, |
1804 | 103 | 104 | ||
1805 | === modified file 't/pt-table-checksum/samples/default-results-5.5.txt' | |||
1806 | --- t/pt-table-checksum/samples/default-results-5.5.txt 2013-02-19 01:51:14 +0000 | |||
1807 | +++ t/pt-table-checksum/samples/default-results-5.5.txt 2014-08-08 14:10:17 +0000 | |||
1808 | @@ -21,7 +21,7 @@ | |||
1809 | 21 | 0 0 0 0 mysql.time_zone_transition | 21 | 0 0 0 0 mysql.time_zone_transition |
1810 | 22 | 0 0 0 0 mysql.time_zone_transition_type | 22 | 0 0 0 0 mysql.time_zone_transition_type |
1811 | 23 | 0 0 2 0 mysql.user | 23 | 0 0 2 0 mysql.user |
1813 | 24 | 0 0 38 0 percona_test.checksums | 24 | 0 0 22 0 percona_test.checksums |
1814 | 25 | 0 0 1 0 percona_test.load_data | 25 | 0 0 1 0 percona_test.load_data |
1815 | 26 | 0 0 1 0 percona_test.sentinel | 26 | 0 0 1 0 percona_test.sentinel |
1816 | 27 | 0 0 200 0 sakila.actor | 27 | 0 0 200 0 sakila.actor |
1817 | 28 | 28 | ||
1818 | === modified file 't/pt-table-checksum/samples/default-results-5.6.txt' | |||
1819 | --- t/pt-table-checksum/samples/default-results-5.6.txt 2013-02-19 01:51:44 +0000 | |||
1820 | +++ t/pt-table-checksum/samples/default-results-5.6.txt 2014-08-08 14:10:17 +0000 | |||
1821 | @@ -20,7 +20,7 @@ | |||
1822 | 20 | 0 0 0 0 mysql.time_zone_transition | 20 | 0 0 0 0 mysql.time_zone_transition |
1823 | 21 | 0 0 0 0 mysql.time_zone_transition_type | 21 | 0 0 0 0 mysql.time_zone_transition_type |
1824 | 22 | 0 0 2 0 mysql.user | 22 | 0 0 2 0 mysql.user |
1826 | 23 | 0 0 37 0 percona_test.checksums | 23 | 0 0 22 0 percona_test.checksums |
1827 | 24 | 0 0 1 0 percona_test.load_data | 24 | 0 0 1 0 percona_test.load_data |
1828 | 25 | 0 0 1 0 percona_test.sentinel | 25 | 0 0 1 0 percona_test.sentinel |
1829 | 26 | 0 0 200 0 sakila.actor | 26 | 0 0 200 0 sakila.actor |
1830 | 27 | 27 | ||
1831 | === modified file 't/pt-table-checksum/samples/static-chunk-size-results-5.5.txt' | |||
1832 | --- t/pt-table-checksum/samples/static-chunk-size-results-5.5.txt 2013-02-19 01:51:14 +0000 | |||
1833 | +++ t/pt-table-checksum/samples/static-chunk-size-results-5.5.txt 2014-08-08 14:10:17 +0000 | |||
1834 | @@ -21,7 +21,7 @@ | |||
1835 | 21 | 0 0 0 1 0 mysql.time_zone_transition | 21 | 0 0 0 1 0 mysql.time_zone_transition |
1836 | 22 | 0 0 0 1 0 mysql.time_zone_transition_type | 22 | 0 0 0 1 0 mysql.time_zone_transition_type |
1837 | 23 | 0 0 2 1 0 mysql.user | 23 | 0 0 2 1 0 mysql.user |
1839 | 24 | 0 0 38 1 0 percona_test.checksums | 24 | 0 0 22 1 0 percona_test.checksums |
1840 | 25 | 0 0 1 1 0 percona_test.load_data | 25 | 0 0 1 1 0 percona_test.load_data |
1841 | 26 | 0 0 1 1 0 percona_test.sentinel | 26 | 0 0 1 1 0 percona_test.sentinel |
1842 | 27 | 0 0 200 1 0 sakila.actor | 27 | 0 0 200 1 0 sakila.actor |
1843 | 28 | 28 | ||
1844 | === modified file 't/pt-table-checksum/samples/static-chunk-size-results-5.6.txt' | |||
1845 | --- t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt 2013-02-19 01:51:44 +0000 | |||
1846 | +++ t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt 2014-08-08 14:10:17 +0000 | |||
1847 | @@ -20,7 +20,7 @@ | |||
1848 | 20 | 0 0 0 1 0 mysql.time_zone_transition | 20 | 0 0 0 1 0 mysql.time_zone_transition |
1849 | 21 | 0 0 0 1 0 mysql.time_zone_transition_type | 21 | 0 0 0 1 0 mysql.time_zone_transition_type |
1850 | 22 | 0 0 2 1 0 mysql.user | 22 | 0 0 2 1 0 mysql.user |
1852 | 23 | 0 0 37 1 0 percona_test.checksums | 23 | 0 0 22 1 0 percona_test.checksums |
1853 | 24 | 0 0 1 1 0 percona_test.load_data | 24 | 0 0 1 1 0 percona_test.load_data |
1854 | 25 | 0 0 1 1 0 percona_test.sentinel | 25 | 0 0 1 1 0 percona_test.sentinel |
1855 | 26 | 0 0 200 1 0 sakila.actor | 26 | 0 0 200 1 0 sakila.actor |