Merge lp:~percona-toolkit-dev/percona-toolkit/release-2.2.6 into lp:percona-toolkit/2.2

Proposed by Daniel Nichter
Status: Merged
Approved by: Daniel Nichter
Approved revision: 618
Merged at revision: 593
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/release-2.2.6
Merge into: lp:percona-toolkit/2.2
Diff against target: 5993 lines (+2763/-980)
86 files modified
Changelog (+36/-12)
Makefile.PL (+1/-1)
bin/pt-agent (+294/-184)
bin/pt-align (+2/-2)
bin/pt-archiver (+3/-3)
bin/pt-config-diff (+3/-3)
bin/pt-deadlock-logger (+11/-11)
bin/pt-diskstats (+3/-3)
bin/pt-duplicate-key-checker (+574/-493)
bin/pt-fifo-split (+2/-2)
bin/pt-find (+3/-3)
bin/pt-fingerprint (+2/-2)
bin/pt-fk-error-logger (+3/-3)
bin/pt-heartbeat (+3/-3)
bin/pt-index-usage (+3/-3)
bin/pt-ioprofile (+2/-2)
bin/pt-kill (+3/-3)
bin/pt-mext (+2/-2)
bin/pt-mysql-summary (+26/-52)
bin/pt-online-schema-change (+58/-12)
bin/pt-pmp (+2/-2)
bin/pt-query-digest (+45/-4)
bin/pt-show-grants (+2/-2)
bin/pt-sift (+2/-2)
bin/pt-slave-delay (+3/-3)
bin/pt-slave-find (+2/-2)
bin/pt-slave-restart (+3/-3)
bin/pt-stalk (+25/-17)
bin/pt-summary (+2/-2)
bin/pt-table-checksum (+3/-3)
bin/pt-table-sync (+90/-4)
bin/pt-table-usage (+2/-2)
bin/pt-upgrade (+3/-3)
bin/pt-variable-advisor (+3/-4)
bin/pt-visual-explain (+2/-2)
config/deb/changelog (+26/-0)
config/sphinx-build/conf.py (+2/-2)
config/sphinx-build/percona-theme/layout.html (+5/-4)
docs/percona-toolkit.pod (+2/-8)
docs/release_notes.rst (+58/-0)
lib/Cxn.pm (+8/-1)
lib/DuplicateKeyFinder.pm (+26/-12)
lib/JSONReportFormatter.pm (+19/-0)
lib/KeySize.pm (+17/-1)
lib/Percona/Agent/Logger.pm (+2/-2)
lib/Percona/Toolkit.pm (+1/-1)
lib/PerconaTest.pm (+1/-0)
lib/QueryReportFormatter.pm (+6/-2)
lib/bash/collect.sh (+13/-11)
lib/bash/collect_mysql_info.sh (+6/-5)
lib/bash/report_mysql_info.sh (+12/-38)
lib/bash/safeguards.sh (+3/-4)
t/lib/Cxn.t (+54/-0)
t/lib/DuplicateKeyFinder.t (+61/-2)
t/lib/KeySize.t (+102/-4)
t/lib/bash/report_mysql_info.sh (+1/-0)
t/lib/bash/safeguards.sh (+8/-0)
t/lib/samples/bash/diskspace002.txt (+2/-0)
t/lib/samples/dupekeys/prefix_bug_1214114.sql (+7/-0)
t/lib/samples/dupekeys/simple_dupe_bug_1217013.sql (+7/-0)
t/lib/samples/slowlogs/slow059.txt (+40/-0)
t/pt-agent/samples/query-history/data001.json (+1/-0)
t/pt-agent/samples/query-history/data001.send (+1/-0)
t/pt-duplicate-key-checker/basics.t (+15/-4)
t/pt-duplicate-key-checker/clustered_keys.t (+15/-2)
t/pt-duplicate-key-checker/samples/bug-894140.txt (+1/-0)
t/pt-duplicate-key-checker/samples/fk_chosen_index_bug_1201443.sql (+21/-0)
t/pt-duplicate-key-checker/samples/simple_dupe_bug_1217013.txt (+21/-0)
t/pt-duplicate-key-checker/standard_options.t (+9/-4)
t/pt-mysql-summary/pt-mysql-summary.t (+2/-2)
t/pt-mysql-summary/samples/expected_output_temp003.txt (+1/-1)
t/pt-mysql-summary/samples/expected_output_temp004.txt (+1/-1)
t/pt-online-schema-change/ansi_quotes.t (+1/-1)
t/pt-online-schema-change/basics.t (+3/-1)
t/pt-online-schema-change/charset.t (+2/-2)
t/pt-online-schema-change/samples/stats-execute-5.5.txt (+2/-0)
t/pt-query-digest/json.t (+16/-0)
t/pt-query-digest/samples/slow059_report01.txt (+127/-0)
t/pt-query-digest/samples/slow059_report02.txt (+680/-0)
t/pt-query-digest/slowlog_analyses.t (+14/-0)
t/pt-stalk/samples/config001.conf (+1/-1)
t/pt-table-sync/basics.t (+1/-1)
t/pt-table-sync/safety_checks.t (+88/-0)
t/pt-table-sync/samples/on_del_cas.sql (+19/-0)
util/build-packages (+4/-4)
util/new-copyright-year (+5/-5)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/release-2.2.6
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+199593@code.launchpad.net
To post a comment you must log in.
617. By Daniel Nichter

Fix pt-agent so services are not started until agent working MySQL connection. Remove service files and crontab entries on start. Don't say online logging is enabled when --no-log-api given. Remove/shorten some log messages. Use whoami if necessary for Agent.username.

618. By Daniel Nichter

Don't check for /etc/percona/agent/my.cnf on install because slave installs need it.

Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Changelog'
2--- Changelog 2013-10-20 03:45:04 +0000
3+++ Changelog 2013-12-20 00:06:23 +0000
4@@ -1,21 +1,45 @@
5 Changelog for Percona Toolkit
6
7+v2.2.6 released 2013-12-18
8+
9+ * Added pt-query-digest support for Percona Server slow log rate limiting
10+ * Added pt-agent --ping
11+ * Added pt-mysql-summary --all-databases
12+ * Added pt-stalk --sleep-collect
13+ * Added pt-table-sync --[no]check-child-tables
14+ * Fixed bug 1249150: PTDEBUG prints some info to STDOUT
15+ * Fixed bug 1248363: pt-agent requires restart after changing MySQL options
16+ * Fixed bug 1248778: pt-agent --install on PXC is not documented
17+ * Fixed bug 1250973: pt-agent --install doesn't check for previous install
18+ * Fixed bug 1250968: pt-agent --install suggest MySQL user isn't quoted
19+ * Fixed bug 1251004: pt-agent --install error about slave is confusing
20+ * Fixed bug 1251726: pt-agent --uninstall fails if agent is running
21+ * Fixed bug 1248785: pt-agent docs don't list privs required for its MySQL user
22+ * Fixed bug 1215016: pt-deadlock-logger docs use pt-fk-error-logger
23+ * Fixed bug 1201443: pt-duplicate-key-checker error when EXPLAIN key_len=0
24+ * Fixed bug 1217013: pt-duplicate-key-checker misses exact duplicate unique indexes
25+ * Fixed bug 1214685: pt-mysql-summary schema dump prompt can't be disabled
26+ * Fixed bug 1195628: pt-online-schema-change gets stuck looking for its own _new table
27+ * Fixed bug 1249149: pt-query-digest stats prints to STDOUT instead of STDERR
28+ * Fixed bug 1071979: pt-stak error parsing df with NFS
29+ * Fixed bug 1223458: pt-table-sync deletes child table rows
30+
31 v2.2.5 released 2013-10-16
32
33 * Added Query_time histogram bucket counts to pt-query-digest JSON output
34 * Added pt-online-schema-change --[no]drop-triggers option
35- * Fixed bug #1199589: pt-archiver deletes data despite --dry-run
36- * Fixed bug #944051: pt-table-checksum has ambiguous exit status
37- * Fixed bug #1209436: pt-kill --log-dsn may not work on Perl 5.8
38- * Fixed bug #1210537: pt-table-checksum --recursion-method=cluster crashes if no nodes are found
39- * Fixed bug #1215608: pt-online-schema-change new table suffix is hard-coded
40- * Fixed bug #1229861: pt-table-sync quotes float values, can't sync
41- * Fixed bug #821692: pt-query-digest doesn't distill LOAD DATA correctly
42- * Fixed bug #984053: pt-query-digest doesn't distill INSERT/REPLACE without INTO correctly
43- * Fixed bug #1206728: pt-deadlock-logger 2.2 requires DSN on command line
44- * Fixed bug #1226721: pt-agent on CentOS 5 fails to send data
45- * Fixed bug #821690: pt-query-digest doesn't distill IF EXISTS correctly
46- * Fixed bug #1206677: pt-agent docs reference clodu.percona.com
47+ * Fixed bug 1206677: pt-agent docs reference clodu.percona.com
48+ * Fixed bug 1226721: pt-agent on CentOS 5 fails to send data
49+ * Fixed bug 1199589: pt-archiver deletes data despite --dry-run
50+ * Fixed bug 1206728: pt-deadlock-logger 2.2 requires DSN on command line
51+ * Fixed bug 1209436: pt-kill --log-dsn may not work on Perl 5.8
52+ * Fixed bug 1215608: pt-online-schema-change new table suffix is hard-coded
53+ * Fixed bug 821692: pt-query-digest doesn't distill LOAD DATA correctly
54+ * Fixed bug 984053: pt-query-digest doesn't distill INSERT/REPLACE without INTO correctly
55+ * Fixed bug 821690: pt-query-digest doesn't distill IF EXISTS correctly
56+ * Fixed bug 1210537: pt-table-checksum --recursion-method=cluster crashes if no nodes are found
57+ * Fixed bug 944051: pt-table-checksum has ambiguous exit status
58+ * Fixed bug 1229861: pt-table-sync quotes float values, can't sync
59
60 v2.2.4 released 2013-07-18
61
62
63=== modified file 'Makefile.PL'
64--- Makefile.PL 2013-10-20 03:45:04 +0000
65+++ Makefile.PL 2013-12-20 00:06:23 +0000
66@@ -2,7 +2,7 @@
67
68 WriteMakefile(
69 NAME => 'percona-toolkit',
70- VERSION => '2.2.5',
71+ VERSION => '2.2.6',
72 EXE_FILES => [ <bin/*> ],
73 MAN1PODS => {
74 'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p',
75
76=== modified file 'bin/pt-agent'
77--- bin/pt-agent 2013-11-08 01:47:46 +0000
78+++ bin/pt-agent 2013-12-20 00:06:23 +0000
79@@ -52,7 +52,7 @@
80 {
81 package Percona::Toolkit;
82
83-our $VERSION = '2.2.5';
84+our $VERSION = '2.2.6';
85
86 use strict;
87 use warnings FATAL => 'all';
88@@ -3691,7 +3691,7 @@
89
90 sub connect {
91 my ( $self, %opts ) = @_;
92- my $dsn = $self->{dsn};
93+ my $dsn = $opts{dsn} || $self->{dsn};
94 my $dp = $self->{DSNParser};
95
96 my $dbh = $self->{dbh};
97@@ -3710,6 +3710,13 @@
98 }
99
100 $dbh = $self->set_dbh($dbh);
101+ if ( $opts{dsn} ) {
102+ $self->{dsn} = $dsn;
103+ $self->{dsn_name} = $dp->as_string($dsn, [qw(h P S)])
104+ || $dp->as_string($dsn, [qw(F)])
105+ || '';
106+
107+ }
108 PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name});
109 return $dbh;
110 }
111@@ -3873,6 +3880,8 @@
112 return $val if $val =~ m/^0x[0-9a-fA-F]+$/ # quote hex data
113 && !$args{is_char}; # unless is_char is true
114
115+ return $val if $args{is_float};
116+
117 $val =~ s/(['\\])/\\$1/g;
118 return "'$val'";
119 }
120@@ -5092,7 +5101,7 @@
121 sub debug {
122 my $self = shift;
123 return if $self->online_logging;
124- return $self->_log(0, 'DEBUG', 1, @_);
125+ return $self->_log(0, 'DEBUG', @_);
126 }
127
128 sub info {
129@@ -5128,7 +5137,7 @@
130 }
131
132 sub _log {
133- my ($self, $online, $level, $msg, $offline) = @_;
134+ my ($self, $online, $level, $msg) = @_;
135
136 my $ts = ts(time, 1); # 1=UTC
137 my $level_number = level_number($level);
138@@ -5520,6 +5529,30 @@
139 }
140
141 # ########################################################################
142+ # --ping and exit.
143+ # ########################################################################
144+ if ( $o->get('ping') ) {
145+ my ($client, $entry_links, $logger_client) = get_api_client(
146+ api_key => $api_key,
147+ tries => 1,
148+ interval => sub { return },
149+ );
150+ if ( !$client || !$entry_links ) {
151+ die "Failed to initialize the API client. The API may be down. Please try again.\n";
152+ }
153+ my $api_ok = ping_api(
154+ client => $client,
155+ );
156+ if ( $api_ok ) {
157+ print $client->{entry_link} . " is up.\n"
158+ }
159+ else {
160+ print $client->{entry_link} . " is down or not reachable.\n";
161+ }
162+ exit;
163+ }
164+
165+ # ########################################################################
166 # --run-service and exit.
167 # ########################################################################
168 if ( my $service = $o->get('run-service') ) {
169@@ -5693,7 +5726,9 @@
170 delete $state->{connecting_to_api};
171 last; # success
172 }
173- $interval->(); # failure, try again
174+ if (!defined $tries || $tries > 0) {
175+ $interval->(); # failure, try again
176+ }
177 }
178
179 # Create another client for Percona::Agent::Logger. If the primary
180@@ -5766,17 +5801,19 @@
181 # Optional args
182 my $_oktorun = $args{oktorun} || sub { return $oktorun };
183 my $actions = $args{actions};
184+ my $quiet = $args{quiet};
185
186 # Update these attribs every time the agent is initialized.
187 # Other optional attribs, like versions, are left to the caller.
188+ chomp(my $who = `whoami 2>/dev/null`);
189 chomp(my $hostname = `hostname`);
190 $agent->hostname($hostname);
191- $agent->username($ENV{USER} || $ENV{LOGNAME});
192+ $agent->username($ENV{USER} || $ENV{LOGNAME} || $who);
193
194 # Try to create/update the Agent.
195 my $success = 0;
196 while ( $_oktorun->() && $tries-- ) {
197- if ( !$state->{init_action}++ ) {
198+ if ( !$state->{init_action}++ && !$quiet ) {
199 $logger->info($action eq 'put' ? "Updating agent " . $agent->name
200 : "Creating new agent");
201 }
202@@ -5815,7 +5852,7 @@
203 }
204 }
205 elsif ( !$agent_uri ) {
206- $logger->info("No URI for Agent " . $agent->name);
207+ $logger->warning("No URI for Agent " . $agent->name);
208 }
209 else {
210 # The Agent URI will have been returned in the Location header
211@@ -5842,10 +5879,6 @@
212 delete $state->{init_action};
213 delete $state->{too_many_agents};
214
215- if ( $agent && $success ) {
216- $logger->info("Agent " . $agent->name . " (" . $agent->uuid . ") is ready");
217- }
218-
219 return $agent, $success;
220 }
221
222@@ -5929,7 +5962,7 @@
223 my $entry_links = $args{entry_links}; # for testing
224 my $logger_client = $args{logger_client}; # for testing
225
226- $logger->info('Starting agent');
227+ # $logger->info('Starting agent');
228
229 # Daemonize first so all output goes to the --log.
230 my $daemon = Daemon->new(
231@@ -6050,7 +6083,7 @@
232 # to /agent/{uuid}/log. This is done asynchronously by a thread so a
233 # simple info("Hello world!") to STDOUT won't block if the API isn't
234 # responding. -- Both client and log_link are required to enable this.
235- if ( $agent->links->{log} && $logger_client ) {
236+ if ( $logger->online_logging && $agent->links->{log} && $logger_client ) {
237 $logger->start_online_logging(
238 client => $logger_client,
239 log_link => $agent->links->{log},
240@@ -6063,6 +6096,28 @@
241 lib_dir => $lib_dir,
242 );
243
244+ # Remove old service files. New instance of agent shouldn't inherit
245+ # anything from previous runs, in case previous runs were bad.
246+ my $service_files = "$lib_dir/services/*";
247+ foreach my $service_file ( glob $service_files ) {
248+ if ( unlink $service_file ) {
249+ $logger->debug("Removed $service_file");
250+ }
251+ else {
252+ $logger->warning("Cannot remove $service_file: $OS_ERROR");
253+ }
254+ }
255+ eval {
256+ schedule_services(
257+ services => [],
258+ lib_dir => $lib_dir,
259+ quiet => 1,
260+ );
261+ };
262+ if ( $EVAL_ERROR ) {
263+ $logger->error("Error removing services from crontab: $EVAL_ERROR");
264+ }
265+
266 return {
267 agent => $agent,
268 client => $client,
269@@ -6100,8 +6155,10 @@
270 # #######################################################################
271 # Main agent loop
272 # #######################################################################
273+ $state->{need_mysql_version} = 1;
274 $state->{first_config} = 1;
275- my $first_config_interval = 60;
276+ $state->{ready} = 0;
277+ my $first_config_interval = 20;
278 $logger->info("Checking silently every $first_config_interval seconds"
279 . " for the first config");
280
281@@ -6110,38 +6167,6 @@
282 my $config;
283 my $services = {};
284 while ( $_oktorun->() ) {
285- check_if_mysql_restarted(
286- Cxn => $cxn,
287- );
288-
289- if ( $state->{need_mysql_version} ) {
290- my $versions = get_versions(
291- Cxn => $cxn,
292- );
293- if ( $versions->{MySQL} ) {
294- $agent->versions($versions);
295- my $updated_agent;
296- ($agent, $updated_agent) = init_agent(
297- agent => $agent,
298- action => 'put',
299- link => $agent->links->{self},
300- client => $client,
301- interval => sub { return; },
302- tries => 1, # optional
303- );
304- if ( $updated_agent ) {
305- $logger->info("Got MySQL versions");
306- save_agent(
307- agent => $agent,
308- lib_dir => $lib_dir,
309- );
310- }
311- else {
312- $state->{need_mysql_version} = 1;
313- }
314- }
315- }
316-
317 ($config, $lib_dir, $new_daemon, $success) = get_config(
318 link => $agent->links->{config},
319 agent => $agent,
320@@ -6157,8 +6182,8 @@
321 if ( $success && $config && $config->links->{services} ) {
322 if ( $state->{first_config} ) {
323 delete $state->{first_config};
324- $logger->info('Agent has been configured');
325 }
326+
327 if ( $new_daemon ) {
328 # NOTE: Daemon objects use DESTROY to auto-remove their pid file
329 # when they lose scope (i.e. ref count goes to zero). This
330@@ -6174,6 +6199,75 @@
331 $daemon = $new_daemon;
332 }
333
334+ # Connect to MySQL, then check stuff.
335+ my $o = new OptionParser();
336+ $o->get_specs();
337+ $o->get_opts();
338+ my $dp = $o->DSNParser();
339+ $dp->prop('set-vars', $o->set_vars());
340+ my $dsn = $dp->parse_options($o);
341+ eval {
342+ $cxn->connect(dsn => $dsn);
343+ };
344+ if ( $EVAL_ERROR ) {
345+ if ( !$state->{mysql_error}++ ) {
346+ $logger->warning("MySQL connection failure: $EVAL_ERROR");
347+ }
348+ else {
349+ $logger->debug("MySQL connection failure: $EVAL_ERROR");
350+ }
351+ $state->{have_mysql} = 0;
352+ $state->{need_mysql_version} = 1;
353+ }
354+ else {
355+ if ( !$state->{have_mysql} ) {
356+ $logger->info("MySQL OK");
357+ }
358+ $state->{have_mysql} = 1;
359+ check_if_mysql_restarted(
360+ dbh => $cxn->dbh,
361+ );
362+ if ( $state->{need_mysql_version} ) {
363+ $logger->debug("Need MySQL version");
364+ my $versions = get_versions(Cxn => $cxn);
365+ if ( $versions->{MySQL} ) {
366+ $agent->versions($versions);
367+ my $updated_agent;
368+ ($agent, $updated_agent) = init_agent(
369+ agent => $agent,
370+ action => 'put',
371+ link => $agent->links->{self},
372+ client => $client,
373+ tries => 1,
374+ interval => sub { return; },
375+ quiet => 1,
376+ );
377+ if ( $updated_agent ) {
378+ $logger->debug("Got MySQL version");
379+ save_agent(
380+ agent => $agent,
381+ lib_dir => $lib_dir,
382+ );
383+ if ( !$state->{ready} || $state->{mysql_error} ) {
384+ $logger->info('Agent OK');
385+ }
386+ delete $state->{need_mysql_version};
387+ delete $state->{mysql_error};
388+ $state->{ready} = 1;
389+ }
390+ }
391+ else {
392+ if ( !$state->{mysql_error}++ ) {
393+ $logger->warning("Failed to get MySQL version");
394+ }
395+ else {
396+ $logger->debug("Failed to get MySQL version");
397+ }
398+ }
399+ }
400+ $cxn->dbh->disconnect();
401+ }
402+
403 # Check the safeguards.
404 my ($disk_space, $disk_space_ok);
405 eval {
406@@ -6185,7 +6279,7 @@
407 );
408 };
409 if ( $EVAL_ERROR ) {
410- $logger->warning("Error checking disk space: $EVAL_ERROR");
411+ $logger->error("Error checking disk space: $EVAL_ERROR");
412 $disk_space_ok = 1;
413 }
414 if ( !$disk_space_ok ) {
415@@ -6203,8 +6297,7 @@
416 $logger->warning('Services will restart when disk space "
417 . "threshold checks pass');
418 }
419- else {
420- # Have config, safeguards are ok, now get/update the services.
421+ elsif ( $state->{ready} ) {
422 ($services, $success) = get_services(
423 link => $config->links->{services},
424 agent => $agent,
425@@ -6220,8 +6313,9 @@
426 # If configured, wait the given interval. Else, retry more
427 # quickly so we're ready to go soon after we're configured.
428 $interval->(
429- $config ? ($config->options->{'check-interval'}, 0)
430- : ($first_config_interval , 1) # 1=quiet
431+ !$state->{ready} ? (20, 1)
432+ : $config ? ($config->options->{'check-interval'}, 0)
433+ : ($first_config_interval , 1) # 1=quiet
434 );
435 }
436
437@@ -6315,6 +6409,8 @@
438 $config = $new_config;
439 $success = 1;
440 $logger->info('Config ' . $config->ts . ' applied');
441+
442+ $state->{need_mysql_version} = 1;
443 }
444 else {
445 $success = 1;
446@@ -6621,7 +6717,7 @@
447 exec_cmd => $args{exec_cmd}, # optional, for testing
448 );
449
450- $logger->info('Service changes applied');
451+ $logger->info('Services OK');
452 }
453 else {
454 $logger->debug('Services have not changed');
455@@ -6837,6 +6933,7 @@
456 PTDEBUG && _d('pt-agent crontab lines:', Dumper(\@pt_agent_lines));
457
458 my $new_crontab = join("\n", @other_lines, @pt_agent_lines) . "\n";
459+ $logger->debug("New crontab: " . ($new_crontab || ''));
460
461 return $new_crontab;
462 }
463@@ -7076,7 +7173,7 @@
464 }
465
466 # Start online logging, if possible.
467- if ( $agent_api && $client && $entry_links && $entry_links->{agents} ) {
468+ if ( $logger->online_logging && $agent_api && $client && $entry_links && $entry_links->{agents} ) {
469 $agent = eval {
470 $client->get(
471 link => $entry_links->{agents} . '/' . $agent->uuid,
472@@ -7366,15 +7463,7 @@
473 # if 1) the service spools data and 2) there is data.
474 my $file_size = (-s $tmp_data_file) || 0;
475 $logger->debug("$tmp_data_file size: " . ($file_size || 0) . " bytes");
476- if ( $file_size > $max_data ) {
477- $logger->error("Data file is larger than $max_data, the service "
478- . "may be malfunctioning, stopping service");
479- stop_service(
480- service => $service->name,
481- lib_dir => $lib_dir,
482- );
483- }
484- elsif ( $use_spool && $file_size ) {
485+ if ( $use_spool && $file_size ) {
486 # Save metadata about this sample _first_, because --send-data looks
487 # for the data file first, then for a corresponding .meta file. If
488 # we write the data file first, then we create a race condition: while
489@@ -7391,24 +7480,31 @@
490 );
491 $metadata->{run_time} = sprintf('%.6f', time - $start_time);
492 (my $meta_file = $data_file) =~ s/\.data/\.meta/;
493+ my $json_metadata = as_json($metadata, json => $json);
494 write_to_file(
495- data => as_json($metadata, json => $json),
496+ data => $json_metadata,
497 file => "$data_dir/$meta_file",
498 );
499
500- # Use system mv instead of Perl File::Copy::move() because it's
501- # unknown if the Perl version will do an optimized move, i.e.
502- # simply move the inode, _not_ copy the file. A system mv on
503- # the same filesystem is pretty much guaranteed to do an optimized,
504- # i.e. quasi-atomic, move.
505- my $cmd = "mv $tmp_data_file $data_dir";
506- $logger->debug($cmd);
507- system($cmd);
508- my $cmd_exit_status = $CHILD_ERROR >> 8;
509- if ( $cmd_exit_status != 0 ) {
510- $logger->error("Move failed: $cmd")
511- }
512- $exit_status |= $cmd_exit_status;
513+ if ( $file_size <= $max_data ) {
514+ # Use system mv instead of Perl File::Copy::move() because it's
515+ # unknown if the Perl version will do an optimized move, i.e.
516+ # simply move the inode, _not_ copy the file. A system mv on
517+ # the same filesystem is pretty much guaranteed to do an optimized,
518+ # i.e. quasi-atomic, move.
519+ my $cmd = "mv $tmp_data_file $data_dir";
520+ $logger->debug($cmd);
521+ system($cmd);
522+ my $cmd_exit_status = $CHILD_ERROR >> 8;
523+ if ( $cmd_exit_status != 0 ) {
524+ $logger->error("Move failed: $cmd")
525+ }
526+ $exit_status |= $cmd_exit_status;
527+ }
528+ else {
529+ $logger->error("Data file is larger than $max_data, skipping: "
530+ . ($json_metadata || ''));
531+ }
532 }
533
534 # Remove staged files. Anything to save should have been moved
535@@ -8294,7 +8390,7 @@
536 );
537 }
538 # Match the first digits, which should be the PID.
539- ($pid) =~ $ps_output =~ m/(\d+)/;
540+ ($pid) = $ps_output =~ m/(\d+)/;
541 }
542
543 if ( !$pid ) {
544@@ -8380,6 +8476,7 @@
545
546 my $agent_my_cnf = '/etc/percona/agent/my.cnf';
547 my $config_file = get_config_file();
548+ my $lib_dir = $o->get('lib');
549
550 my $step_result;
551 my $stepno = 0;
552@@ -8389,6 +8486,7 @@
553 "Verify the user is root",
554 "Check Perl module dependencies",
555 "Check for crontab",
556+ "Verify pt-agent is not installed",
557 "Verify the API key",
558 "Connect to MySQL",
559 "Check if MySQL is a slave",
560@@ -8458,7 +8556,25 @@
561 die "cron is not installed, or crontab is not in your PATH.\n";
562 }
563
564+ # Verify pt-agent is not installed
565+ $next_step->();
566+ my @install_files = ($config_file, "$lib_dir/agent");
567+ my @have_files;
568+ foreach my $file (@install_files) {
569+ push @have_files, $file if -f $file;
570+ }
571+ if ( scalar @have_files ) {
572+ print "FAIL\n";
573+ die "It looks like pt-agent is already installed because these files exist:\n"
574+ . join("\n", map { " $_" } @have_files)
575+ . "\nRun pt-agent --uninstall to remove these files. To upgrade pt-agent, "
576+ . "install the new version, run pt-agent --stop, then pt-agent --daemonize "
577+ . "to restart pt-agent with the new version.\n";
578+ }
579+
580 # Must have a valid API key.
581+ $next_step->();
582+ my $got_api_key = 0;
583 my $api_key = $o->get('api-key');
584 if ( !$api_key ) {
585 print "\n";
586@@ -8472,19 +8588,22 @@
587 $api_key = '';
588 }
589 }
590- $next_step->(repeat => 1); # repeat
591 }
592 else {
593 die "Please specify your --api-key.\n";
594 }
595+ $got_api_key = 1;
596 }
597+
598 my $client;
599 my $entry_links;
600 if ( $flags->{offline} ) {
601 $skip++;
602 }
603 else {
604- $next_step->();
605+ if ($got_api_key) {
606+ $next_step->(repeat => 1);
607+ }
608 eval {
609 ($client, $entry_links) = get_api_client(
610 api_key => $api_key,
611@@ -8546,30 +8665,13 @@
612 if ( $flags->{force_dangerous_slave_install} ) {
613 create_mysql_user($cxn, $agent_my_cnf);
614 }
615- elsif ( $interactive || -t STDIN ) {
616- print "\nMySQL is a slave and $agent_my_cnf does not exist. "
617- . "To install the agent, please enter the MySQL username and "
618- . "password to use. The MySQL user must have SUPER and USAGE "
619- . "privileges on all databases, for example: "
620- . "GRANT SUPER,USAGE ON *.* TO pt_agent'\@'localhost'. "
621- . "If the agent has been installed on the master, you can use "
622- . "the MySQL username and password in $agent_my_cnf on the "
623- . "master. CTRL-C to abort install.\n";
624- print "MySQL username: ";
625- my $user = <STDIN>;
626- chomp($user) if $user;
627- my $pass = OptionParser::prompt_noecho("MySQL password: ");
628- create_mysql_user($cxn, $agent_my_cnf, $user, $pass);
629- $next_step->(repeat => 1); # repeat
630- }
631 else {
632 die "Sorry, cannot install the agent because MySQL is a slave "
633 . "and $agent_my_cnf does not exist. It is not safe to "
634 . "write to a slave, so a MySQL user for the agent cannot "
635 . "be created. First install the agent on the master, then "
636 . "copy $agent_my_cnf from the master to this server. "
637- . "See --install-options for how to force a dangerous slave "
638- . "install.\n";
639+ . "See SLAVE INSTALL in the docs for more information.\n";
640 }
641 }
642 }
643@@ -8591,7 +8693,7 @@
644 # do it now in case there are problems.
645 $next_step->();
646 init_lib_dir(
647- lib_dir => $o->get('lib'),
648+ lib_dir => $lib_dir,
649 );
650 init_spool_dir(
651 spool_dir => $o->get('spool'),
652@@ -8972,33 +9074,7 @@
653 my (%args) = @_;
654 my $cxn = $args{Cxn};
655 my $tries = $args{tries} || 1;
656- my $interval = $args{interval} || sub { sleep 3; };
657-
658- my $have_mysql = 0;
659- if ( $cxn ) {
660- $logger->debug("Connecting to MySQL");
661- foreach my $tryno ( 1..$tries ) {
662- eval {
663- $cxn->connect();
664- };
665- if ( $EVAL_ERROR ) {
666- $logger->debug("Cannot connect to MySQL: $EVAL_ERROR");
667- }
668- else {
669- $have_mysql = 1;
670- delete $state->{need_mysql_version};
671- last; # success
672- }
673- if ( $tryno < $tries ) {
674- sleep $interval; # failure, try again
675- }
676- else {
677- $state->{need_mysql_version} = 1;
678- $logger->warning("Cannot get MySQL version, will try again later");
679- last; # failure
680- }
681- }
682- }
683+ my $interval = $args{interval} || sub { return; };
684
685 # This is currently the actual response from GET v.percona.com
686 my $fake_response = <<EOL;
687@@ -9007,6 +9083,10 @@
688 Perl;perl_version
689 DBD::mysql;perl_module_version
690 Percona::Toolkit;perl_module_version
691+JSON;perl_module_version
692+LWP;perl_module_version
693+IO::Socket::SSL;perl_module_version
694+DBD::mysql;perl_module_version
695 EOL
696
697 my $items = VersionCheck::parse_server_response(
698@@ -9017,12 +9097,39 @@
699 { name => 'system', id => 0, },
700 ];
701
702+ my $have_mysql = -1;
703+ if ( !$cxn->dbh || !$cxn->dbh->ping() ) {
704+ $logger->debug("Connecting to MySQL");
705+ eval {
706+ $cxn->connect();
707+ };
708+ if ( $EVAL_ERROR ) {
709+ $logger->debug("Cannot connect to MySQL: $EVAL_ERROR");
710+ $have_mysql = 0;
711+ }
712+ else {
713+ $have_mysql = 1;
714+ }
715+ }
716+
717 if ( $have_mysql ) {
718+ $logger->debug("Have MySQL connection");
719 my ($name, $id) = VersionCheck::get_instance_id(
720 { dbh => $cxn->dbh, dsn => $cxn->dsn },
721 );
722 push @$instances,
723 { name => $name, id => $id, dbh => $cxn->dbh, dsn => $cxn->dsn };
724+
725+ # Disconnect MySQL if we connected it.
726+ if ( $have_mysql == 1 ) {
727+ $logger->debug("Disconnecting MySQL");
728+ eval {
729+ $cxn->dbh->disconnect();
730+ };
731+ if ( $EVAL_ERROR ) {
732+ $logger->debug($EVAL_ERROR);
733+ }
734+ }
735 }
736
737 my $versions = VersionCheck::get_versions(
738@@ -9087,47 +9194,21 @@
739 sub check_if_mysql_restarted {
740 my (%args) = @_;
741 have_required_args(\%args, qw(
742- Cxn
743+ dbh
744 )) or die;
745- my $cxn = $args{Cxn};
746+ my $dbh = $args{dbh};
747
748 # Optional args
749 my $uptime = $args{uptime}; # for testing
750 my $margin = $args{margin} || 5;
751
752 if ( !$uptime ) {
753- $logger->debug("Connecting to MySQL");
754- my $t0 = time;
755- my $e;
756- my $tries = 2;
757- my $have_mysql = 0;
758- TRY:
759- foreach my $tryno ( 1..$tries ) {
760- eval {
761- $cxn->connect();
762- };
763- $e = $EVAL_ERROR;
764- if ( $e ) {
765- sleep 3 if $tryno < $tries; # failure, try again
766- }
767- else {
768- $have_mysql = 1;
769- last TRY; # success
770- }
771- }
772- if ( $have_mysql ) {
773- eval {
774- (undef, $uptime) = $cxn->dbh->selectrow_array("SHOW STATUS LIKE 'uptime'");
775- };
776- if ( $EVAL_ERROR ) {
777- $logger->warning("Cannot check if MySQL restarted because "
778- . "SHOW STATUS query failed: $EVAL_ERROR");
779- return;
780- }
781- }
782- else {
783- $logger->warning("Cannot check if MySQL restarted because "
784- . "connection to MySQL failed: $e");
785+ my $sql = "SHOW STATUS LIKE 'uptime'";
786+ eval {
787+ (undef, $uptime) = $dbh->selectrow_array($sql);
788+ };
789+ if ( $EVAL_ERROR ) {
790+ $logger->error("$sql: $EVAL_ERROR");
791 return;
792 }
793 }
794@@ -9149,6 +9230,7 @@
795 . "elapsed=$elapsed_time expected=$exepected_uptime "
796 . "+/- ${margin}s actual=$uptime");
797 $state->{mysql_restarted} = ts(time, 1); # 1=UTC
798+ $state->{need_mysql_version} = 1;
799 }
800 }
801
802@@ -9234,14 +9316,13 @@
803 pt-agent is the client-side agent for Percona Cloud Tools. It is not
804 a general command line tool like other tools in Percona Toolkit, it is
805 configured and controlled through the web at https://cloud.percona.com.
806-Please contact Percona or visit https://cloud.percona.com for more information.
807+Visit https://cloud.percona.com for more information and to sign up.
808
809 =head1 DESCRIPTION
810
811 pt-agent is the client-side agent for Percona Cloud Tools (PCT). It is
812 controlled and configured through the web app at https://cloud.percona.com.
813-An account with Percona is required to use pt-agent. Please contact Percona
814-or visit https://cloud.percona.com for more information.
815+Visit https://cloud.percona.com for more information and to sign up.
816
817 pt-agent, or "the agent", is a single, unique instance of the tool running
818 on a server. Two agents cannot run on the same server (see L<"--pid">).
819@@ -9249,9 +9330,9 @@
820 The agent is a daemon that runs as root. It should be started with
821 L<"--daemonize">. It connects periodically to Percona to update
822 its configuration and services, and it schedules L<"--run-service"> and
823-L<"--send-data"> instances of itself. Other than L<"INSTALLING"> and starting
824-the agent locally, all control and configuration is done through the web
825-at https://cloud.percona.com.
826+L<"--send-data"> instances of itself using cron. Other than L<"INSTALLING">
827+and starting the agent locally, all control and configuration is done through
828+the web at https://cloud.percona.com.
829
830 =head1 INSTALLING
831
832@@ -9270,6 +9351,44 @@
833
834 Please contact Percona if you need help installing the agent.
835
836+=head2 SLAVE INSTALL
837+
838+There are two ways to install pt-agent on a slave. The first and best way
839+is to install the agent on the master so that the L<"MYSQL USER"> is created
840+on the master and replicates to slaves. This is best because it avoids
841+writing to the slave. Then create the C</etc/percona/agent/> directory on
842+the slave and copy in to it C</etc/percona/agent/my.cnf> from the master.
843+Run L<"--install"> on the slave and pt-agent will automatically detect and
844+use the MySQL user and password in C</etc/percona/agent/my.cnf>. Repeat the
845+process for other slaves.
846+
847+The second way to install pt-agent on a slave is not safe because it writes
848+directly to the slave: specify L<"--install-options">
849+C<force_dangerous_slave_install> in addition to L<"--install">. As the
850+install option name implies, this is dangerous, but it forces pt-agent
851+to ignore that MySQL is a slave.
852+
853+=head2 Percona XtraDB Cluster (PXC) INSTALL
854+
855+Installing pt-agent on Percona XtraDB Cluster (PXC) nodes is the same as
856+installing it safely on slaves. First install the agent on any node. This
857+will create the L<"MYSQL USER"> that will replicate to all other nodes.
858+Then create the C</etc/percona/agent/> directory on another node and copy in
859+to it C</etc/percona/agent/my.cnf> from the first node where pt-agent was
860+installed. Run L<"--install"> on the node and pt-agent will automatically
861+detect and use the MySQL user and password in C</etc/percona/agent/my.cnf>.
862+Repeat the process for other nodes.
863+
864+=head1 MYSQL USER
865+
866+During L<"--install">, pt-agent creates the following MySQL user:
867+
868+ GRANT SUPER, USAGE ON *.* TO 'pt_agent'@'localhost' IDENTIFIED BY 'pass'
869+
870+C<pass> is a random string. MySQL options for the agent are stored in
871+C</etc/percona/agent/my.cnf>. The C<SUPER> privilege is required so that
872+the agent can set global MySQL variables like C<long_query_time>.
873+
874 =head1 EXIT STATUS
875
876 pt-agent exists zero if no errors or warnings occurred, else it exits non-zero.
877@@ -9438,6 +9557,10 @@
878 script overwrites the file with its own PID and starts; else, if the file
879 contains no PID, then the script dies.
880
881+=item --ping
882+
883+Ping the Percona Cloud Tools API and exit.
884+
885 =item --port
886
887 short form: -P; type: int
888@@ -9608,7 +9731,7 @@
889
890 =over
891
892-=item * An account with Percona
893+=item * A Percona Cloud Tools account (https://cloud.percona.com)
894
895 =item * Access to https://cloud-api.percona.com
896
897@@ -9659,20 +9782,7 @@
898 =head1 DOWNLOADING
899
900 Visit L<http://www.percona.com/software/percona-toolkit/> to download the
901-latest release of Percona Toolkit. Or, get the latest release from the
902-command line:
903-
904- wget percona.com/get/percona-toolkit.tar.gz
905-
906- wget percona.com/get/percona-toolkit.rpm
907-
908- wget percona.com/get/percona-toolkit.deb
909-
910-You can also get individual tools from the latest release:
911-
912- wget percona.com/get/TOOL
913-
914-Replace C<TOOL> with the name of any tool.
915+latest release of Percona Toolkit.
916
917 =head1 AUTHORS
918
919@@ -9689,7 +9799,7 @@
920
921 =head1 COPYRIGHT, LICENSE, AND WARRANTY
922
923-This program is copyright 2013 Percona Inc.
924+This program is copyright 2013 Percona LLC and/or its affiliates.
925
926 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
927 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
928@@ -9707,6 +9817,6 @@
929
930 =head1 VERSION
931
932-pt-agent 2.2.5
933+pt-agent 2.2.6
934
935 =cut
936
937=== modified file 'bin/pt-align'
938--- bin/pt-align 2013-11-08 01:47:46 +0000
939+++ bin/pt-align 2013-12-20 00:06:23 +0000
940@@ -1304,7 +1304,7 @@
941
942 =head1 COPYRIGHT, LICENSE, AND WARRANTY
943
944-This program is copyright 2011-2013 Percona Ireland Ltd,
945+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
946 2010-2011 Baron Schwartz.
947
948 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
949@@ -1323,6 +1323,6 @@
950
951 =head1 VERSION
952
953-pt-align 2.2.5
954+pt-align 2.2.6
955
956 =cut
957
958=== modified file 'bin/pt-archiver'
959--- bin/pt-archiver 2013-11-08 01:47:46 +0000
960+++ bin/pt-archiver 2013-12-20 00:06:23 +0000
961@@ -43,7 +43,7 @@
962 {
963 package Percona::Toolkit;
964
965-our $VERSION = '2.2.5';
966+our $VERSION = '2.2.6';
967
968 use strict;
969 use warnings FATAL => 'all';
970@@ -7890,7 +7890,7 @@
971
972 =head1 COPYRIGHT, LICENSE, AND WARRANTY
973
974-This program is copyright 2011-2013 Percona Ireland Ltd,
975+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
976 2007-2011 Baron Schwartz.
977
978 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
979@@ -7909,6 +7909,6 @@
980
981 =head1 VERSION
982
983-pt-archiver 2.2.5
984+pt-archiver 2.2.6
985
986 =cut
987
988=== modified file 'bin/pt-config-diff'
989--- bin/pt-config-diff 2013-11-08 01:47:46 +0000
990+++ bin/pt-config-diff 2013-12-20 00:06:23 +0000
991@@ -43,7 +43,7 @@
992 {
993 package Percona::Toolkit;
994
995-our $VERSION = '2.2.5';
996+our $VERSION = '2.2.6';
997
998 use strict;
999 use warnings FATAL => 'all';
1000@@ -5732,7 +5732,7 @@
1001
1002 =head1 COPYRIGHT, LICENSE, AND WARRANTY
1003
1004-This program is copyright 2011-2013 Percona Ireland Ltd.
1005+This program is copyright 2011-2013 Percona LLC and/or its affiliates.
1006
1007 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
1008 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
1009@@ -5750,6 +5750,6 @@
1010
1011 =head1 VERSION
1012
1013-pt-config-diff 2.2.5
1014+pt-config-diff 2.2.6
1015
1016 =cut
1017
1018=== modified file 'bin/pt-deadlock-logger'
1019--- bin/pt-deadlock-logger 2013-11-08 01:47:46 +0000
1020+++ bin/pt-deadlock-logger 2013-12-20 00:06:23 +0000
1021@@ -42,7 +42,7 @@
1022 {
1023 package Percona::Toolkit;
1024
1025-our $VERSION = '2.2.5';
1026+our $VERSION = '2.2.6';
1027
1028 use strict;
1029 use warnings FATAL => 'all';
1030@@ -4975,15 +4975,15 @@
1031
1032 Print deadlocks on host1:
1033
1034- pt-fk-error-logger h=host1
1035+ pt-deadlock-logger h=host1
1036
1037 Print deadlocks on host1 once then exit:
1038
1039- pt-fk-error-logger h=host1 --iterations 1
1040-
1041-Save deadlocks on host1 to percona_schema.fke on host2:
1042-
1043- pt-fk-error-logger h=host1 --dest h=host2,D=percona_schema,t=deadlocks
1044+ pt-deadlock-logger h=host1 --iterations 1
1045+
1046+Save deadlocks on host1 to percona_schema.deadlocks on host2:
1047+
1048+ pt-deadlock-logger h=host1 --dest h=host2,D=percona_schema,t=deadlocks
1049
1050 =head1 RISKS
1051
1052@@ -5020,7 +5020,7 @@
1053 =head1 OUTPUT
1054
1055 New deadlocks are printed to C<STDOUT>, unless L<"--quiet"> is specified.
1056-Errors and warnings are printed to C<STDERR>.
1057+Errors and warnings are printed to C<STDERR>.
1058
1059 See also L<"--columns"> and L<"--tab">.
1060
1061@@ -5029,7 +5029,7 @@
1062 InnoDB's output is hard to parse and sometimes there's no way to do it right.
1063
1064 Sometimes not all information (for example, username or IP address) is included
1065-in the deadlock information. In this case there's nothing for the script to put
1066+in the deadlock information. In this case there's nothing for the tool to put
1067 in those columns. It may also be the case that the deadlock output is so long
1068 (because there were a lot of locks) that the whole thing is truncated.
1069
1070@@ -5505,7 +5505,7 @@
1071
1072 =head1 COPYRIGHT, LICENSE, AND WARRANTY
1073
1074-This program is copyright 2011-2013 Percona Ireland Ltd,
1075+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
1076 2007-2011 Baron Schwartz.
1077
1078 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
1079@@ -5524,6 +5524,6 @@
1080
1081 =head1 VERSION
1082
1083-pt-deadlock-logger 2.2.5
1084+pt-deadlock-logger 2.2.6
1085
1086 =cut
1087
1088=== modified file 'bin/pt-diskstats'
1089--- bin/pt-diskstats 2013-11-08 01:47:46 +0000
1090+++ bin/pt-diskstats 2013-12-20 00:06:23 +0000
1091@@ -38,7 +38,7 @@
1092 {
1093 package Percona::Toolkit;
1094
1095-our $VERSION = '2.2.5';
1096+our $VERSION = '2.2.6';
1097
1098 use strict;
1099 use warnings FATAL => 'all';
1100@@ -5577,7 +5577,7 @@
1101
1102 =head1 COPYRIGHT, LICENSE, AND WARRANTY
1103
1104-This program is copyright 2011-2013 Percona Ireland Ltd,
1105+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
1106 2010-2011 Baron Schwartz.
1107
1108 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
1109@@ -5596,6 +5596,6 @@
1110
1111 =head1 VERSION
1112
1113-pt-diskstats 2.2.5
1114+pt-diskstats 2.2.6
1115
1116 =cut
1117
1118=== modified file 'bin/pt-duplicate-key-checker'
1119--- bin/pt-duplicate-key-checker 2013-11-08 01:47:46 +0000
1120+++ bin/pt-duplicate-key-checker 2013-12-20 00:06:23 +0000
1121@@ -23,7 +23,7 @@
1122 Daemon
1123 Schema
1124 SchemaIterator
1125- HTTPMicro
1126+ HTTP::Micro
1127 VersionCheck
1128 ));
1129 }
1130@@ -39,7 +39,7 @@
1131 {
1132 package Percona::Toolkit;
1133
1134-our $VERSION = '2.2.5';
1135+our $VERSION = '2.2.6';
1136
1137 use strict;
1138 use warnings FATAL => 'all';
1139@@ -133,6 +133,8 @@
1140 return $val if $val =~ m/^0x[0-9a-fA-F]+$/ # quote hex data
1141 && !$args{is_char}; # unless is_char is true
1142
1143+ return $val if $args{is_float};
1144+
1145 $val =~ s/(['\\])/\\$1/g;
1146 return "'$val'";
1147 }
1148@@ -2203,7 +2205,7 @@
1149 foreach my $col ( @cols ) {
1150 push @where_cols, "$col=1";
1151 }
1152- if ( scalar @cols == 1 ) {
1153+ if ( scalar(@cols) == 1 && !$args{only_eq} ) {
1154 push @where_cols, "$cols[0]<>1";
1155 }
1156 $sql .= join(' OR ', @where_cols);
1157@@ -2227,6 +2229,21 @@
1158 PTDEBUG && _d('MySQL chose key:', $chosen_key, 'len:', $key_len,
1159 'rows:', $rows);
1160
1161+ if ( $chosen_key && $key_len eq '0' ) {
1162+ if ( $args{recurse} ) {
1163+ $self->{error} = "key_len = 0 in EXPLAIN:\n"
1164+ . _explain_to_text($explain);
1165+ return;
1166+ }
1167+ else {
1168+ return $self->get_key_size(
1169+ %args,
1170+ only_eq => 1,
1171+ recurse => 1,
1172+ );
1173+ }
1174+ }
1175+
1176 my $key_size = 0;
1177 if ( $key_len && $rows ) {
1178 if ( $chosen_key =~ m/,/ && $key_len =~ m/,/ ) {
1179@@ -2370,7 +2387,6 @@
1180 push @dupes,
1181 $self->remove_prefix_duplicates(\@fulltext_keys, \@fulltext_keys, %args, exact_duplicates => 1);
1182
1183-
1184 my $clustered_key = $args{clustered_key} ? $keys{$args{clustered_key}}
1185 : undef;
1186 PTDEBUG && _d('clustered key:',
1187@@ -2505,10 +2521,10 @@
1188
1189 PTDEBUG && _d('Remove', $right_name);
1190 my $reason;
1191- if ( $right_keys->[$right_index]->{unconstrained} ) {
1192+ if ( my $type = $right_keys->[$right_index]->{unconstrained} ) {
1193 $reason .= "Uniqueness of $right_name ignored because "
1194 . $right_keys->[$right_index]->{constraining_key}->{name}
1195- . " is a stronger constraint\n";
1196+ . " is a $type constraint\n";
1197 }
1198 my $exact_dupe = $right_len_cols < $left_len_cols ? 0 : 1;
1199 $reason .= $right_name
1200@@ -2608,11 +2624,18 @@
1201 next unless $unique_key; # primary key may be undefined
1202 my $cols = $unique_key->{cols};
1203 if ( @$cols == 1 ) {
1204- PTDEBUG && _d($unique_key->{name},'defines unique column:',$cols->[0]);
1205 if ( !exists $unique_cols{$cols->[0]} ) {
1206+ PTDEBUG && _d($unique_key->{name}, 'defines unique column:',
1207+ $cols->[0]);
1208 $unique_cols{$cols->[0]} = $unique_key;
1209 $unique_key->{unique_col} = 1;
1210 }
1211+ else {
1212+ PTDEBUG && _d($unique_key->{name},
1213+ 'redundantly constrains unique column:', $cols->[0]);
1214+ $unique_key->{exact_dupe} = 1;
1215+ $unique_key->{constraining_key} = $unique_cols{$cols->[0]};
1216+ }
1217 }
1218 else {
1219 local $LIST_SEPARATOR = '-';
1220@@ -2646,13 +2669,19 @@
1221
1222 for my $i ( 0..(scalar @$unique_keys-1) ) {
1223 if ( exists $unconstrain{$unique_keys->[$i]->{name}} ) {
1224- PTDEBUG && _d('Unconstraining', $unique_keys->[$i]->{name});
1225- $unique_keys->[$i]->{unconstrained} = 1;
1226+ PTDEBUG && _d('Unconstraining weak', $unique_keys->[$i]->{name});
1227+ $unique_keys->[$i]->{unconstrained} = 'stronger';
1228 $unique_keys->[$i]->{constraining_key}
1229 = $unconstrain{$unique_keys->[$i]->{name}};
1230 push @unconstrained_keys, $unique_keys->[$i];
1231 delete $unique_keys->[$i];
1232 }
1233+ elsif ( $unique_keys->[$i]->{exact_dupe} ) {
1234+ PTDEBUG && _d('Unconstraining dupe', $unique_keys->[$i]->{name});
1235+ $unique_keys->[$i]->{unconstrained} = 'duplicate';
1236+ push @unconstrained_keys, $unique_keys->[$i];
1237+ delete $unique_keys->[$i];
1238+ }
1239 }
1240
1241 PTDEBUG && _d('No more keys');
1242@@ -2687,157 +2716,214 @@
1243 use strict;
1244 use warnings FATAL => 'all';
1245 use English qw(-no_match_vars);
1246+
1247 use constant PTDEBUG => $ENV{PTDEBUG} || 0;
1248
1249 use POSIX qw(setsid);
1250+use Fcntl qw(:DEFAULT);
1251
1252 sub new {
1253- my ( $class, %args ) = @_;
1254- foreach my $arg ( qw(o) ) {
1255- die "I need a $arg argument" unless $args{$arg};
1256- }
1257- my $o = $args{o};
1258+ my ($class, %args) = @_;
1259 my $self = {
1260- o => $o,
1261- log_file => $o->has('log') ? $o->get('log') : undef,
1262- PID_file => $o->has('pid') ? $o->get('pid') : undef,
1263+ log_file => $args{log_file},
1264+ pid_file => $args{pid_file},
1265+ daemonize => $args{daemonize},
1266+ force_log_file => $args{force_log_file},
1267+ parent_exit => $args{parent_exit},
1268+ pid_file_owner => 0,
1269 };
1270-
1271- check_PID_file(undef, $self->{PID_file});
1272-
1273- PTDEBUG && _d('Daemonized child will log to', $self->{log_file});
1274 return bless $self, $class;
1275 }
1276
1277-sub daemonize {
1278- my ( $self ) = @_;
1279-
1280- PTDEBUG && _d('About to fork and daemonize');
1281- defined (my $pid = fork()) or die "Cannot fork: $OS_ERROR";
1282- if ( $pid ) {
1283- PTDEBUG && _d('Parent PID', $PID, 'exiting after forking child PID',$pid);
1284- exit;
1285- }
1286-
1287- PTDEBUG && _d('Daemonizing child PID', $PID);
1288- $self->{PID_owner} = $PID;
1289- $self->{child} = 1;
1290-
1291- POSIX::setsid() or die "Cannot start a new session: $OS_ERROR";
1292- chdir '/' or die "Cannot chdir to /: $OS_ERROR";
1293-
1294- $self->_make_PID_file();
1295-
1296- $OUTPUT_AUTOFLUSH = 1;
1297-
1298- PTDEBUG && _d('Redirecting STDIN to /dev/null');
1299- close STDIN;
1300- open STDIN, '/dev/null'
1301- or die "Cannot reopen STDIN to /dev/null: $OS_ERROR";
1302-
1303- if ( $self->{log_file} ) {
1304- PTDEBUG && _d('Redirecting STDOUT and STDERR to', $self->{log_file});
1305- close STDOUT;
1306- open STDOUT, '>>', $self->{log_file}
1307- or die "Cannot open log file $self->{log_file}: $OS_ERROR";
1308-
1309- close STDERR;
1310- open STDERR, ">&STDOUT"
1311- or die "Cannot dupe STDERR to STDOUT: $OS_ERROR";
1312- }
1313- else {
1314- if ( -t STDOUT ) {
1315- PTDEBUG && _d('No log file and STDOUT is a terminal;',
1316- 'redirecting to /dev/null');
1317+sub run {
1318+ my ($self) = @_;
1319+
1320+ my $daemonize = $self->{daemonize};
1321+ my $pid_file = $self->{pid_file};
1322+ my $log_file = $self->{log_file};
1323+ my $force_log_file = $self->{force_log_file};
1324+ my $parent_exit = $self->{parent_exit};
1325+
1326+ PTDEBUG && _d('Starting daemon');
1327+
1328+ if ( $pid_file ) {
1329+ eval {
1330+ $self->_make_pid_file(
1331+ pid => $PID, # parent's pid
1332+ pid_file => $pid_file,
1333+ );
1334+ };
1335+ die "$EVAL_ERROR\n" if $EVAL_ERROR;
1336+ if ( !$daemonize ) {
1337+ $self->{pid_file_owner} = $PID; # parent's pid
1338+ }
1339+ }
1340+
1341+ if ( $daemonize ) {
1342+ defined (my $child_pid = fork()) or die "Cannot fork: $OS_ERROR";
1343+ if ( $child_pid ) {
1344+ PTDEBUG && _d('Forked child', $child_pid);
1345+ $parent_exit->($child_pid) if $parent_exit;
1346+ exit 0;
1347+ }
1348+
1349+ POSIX::setsid() or die "Cannot start a new session: $OS_ERROR";
1350+ chdir '/' or die "Cannot chdir to /: $OS_ERROR";
1351+
1352+ if ( $pid_file ) {
1353+ $self->_update_pid_file(
1354+ pid => $PID, # child's pid
1355+ pid_file => $pid_file,
1356+ );
1357+ $self->{pid_file_owner} = $PID;
1358+ }
1359+ }
1360+
1361+ if ( $daemonize || $force_log_file ) {
1362+ PTDEBUG && _d('Redirecting STDIN to /dev/null');
1363+ close STDIN;
1364+ open STDIN, '/dev/null'
1365+ or die "Cannot reopen STDIN to /dev/null: $OS_ERROR";
1366+ if ( $log_file ) {
1367+ PTDEBUG && _d('Redirecting STDOUT and STDERR to', $log_file);
1368 close STDOUT;
1369- open STDOUT, '>', '/dev/null'
1370- or die "Cannot reopen STDOUT to /dev/null: $OS_ERROR";
1371- }
1372- if ( -t STDERR ) {
1373- PTDEBUG && _d('No log file and STDERR is a terminal;',
1374- 'redirecting to /dev/null');
1375+ open STDOUT, '>>', $log_file
1376+ or die "Cannot open log file $log_file: $OS_ERROR";
1377+
1378 close STDERR;
1379- open STDERR, '>', '/dev/null'
1380- or die "Cannot reopen STDERR to /dev/null: $OS_ERROR";
1381- }
1382- }
1383-
1384- return;
1385-}
1386-
1387-sub check_PID_file {
1388- my ( $self, $file ) = @_;
1389- my $PID_file = $self ? $self->{PID_file} : $file;
1390- PTDEBUG && _d('Checking PID file', $PID_file);
1391- if ( $PID_file && -f $PID_file ) {
1392- my $pid;
1393- eval {
1394- chomp($pid = (slurp_file($PID_file) || ''));
1395- };
1396- if ( $EVAL_ERROR ) {
1397- die "The PID file $PID_file already exists but it cannot be read: "
1398- . $EVAL_ERROR;
1399- }
1400- PTDEBUG && _d('PID file exists; it contains PID', $pid);
1401- if ( $pid ) {
1402- my $pid_is_alive = kill 0, $pid;
1403+ open STDERR, ">&STDOUT"
1404+ or die "Cannot dupe STDERR to STDOUT: $OS_ERROR";
1405+ }
1406+ else {
1407+ if ( -t STDOUT ) {
1408+ PTDEBUG && _d('No log file and STDOUT is a terminal;',
1409+ 'redirecting to /dev/null');
1410+ close STDOUT;
1411+ open STDOUT, '>', '/dev/null'
1412+ or die "Cannot reopen STDOUT to /dev/null: $OS_ERROR";
1413+ }
1414+ if ( -t STDERR ) {
1415+ PTDEBUG && _d('No log file and STDERR is a terminal;',
1416+ 'redirecting to /dev/null');
1417+ close STDERR;
1418+ open STDERR, '>', '/dev/null'
1419+ or die "Cannot reopen STDERR to /dev/null: $OS_ERROR";
1420+ }
1421+ }
1422+
1423+ $OUTPUT_AUTOFLUSH = 1;
1424+ }
1425+
1426+ PTDEBUG && _d('Daemon running');
1427+ return;
1428+}
1429+
1430+sub _make_pid_file {
1431+ my ($self, %args) = @_;
1432+ my @required_args = qw(pid pid_file);
1433+ foreach my $arg ( @required_args ) {
1434+ die "I need a $arg argument" unless $args{$arg};
1435+ };
1436+ my $pid = $args{pid};
1437+ my $pid_file = $args{pid_file};
1438+
1439+ eval {
1440+ sysopen(PID_FH, $pid_file, O_RDWR|O_CREAT|O_EXCL) or die $OS_ERROR;
1441+ print PID_FH $PID, "\n";
1442+ close PID_FH;
1443+ };
1444+ if ( my $e = $EVAL_ERROR ) {
1445+ if ( $e =~ m/file exists/i ) {
1446+ my $old_pid = $self->_check_pid_file(
1447+ pid_file => $pid_file,
1448+ pid => $PID,
1449+ );
1450+ if ( $old_pid ) {
1451+ warn "Overwriting PID file $pid_file because PID $old_pid "
1452+ . "is not running.\n";
1453+ }
1454+ $self->_update_pid_file(
1455+ pid => $PID,
1456+ pid_file => $pid_file
1457+ );
1458+ }
1459+ else {
1460+ die "Error creating PID file $pid_file: $e\n";
1461+ }
1462+ }
1463+
1464+ return;
1465+}
1466+
1467+sub _check_pid_file {
1468+ my ($self, %args) = @_;
1469+ my @required_args = qw(pid_file pid);
1470+ foreach my $arg ( @required_args ) {
1471+ die "I need a $arg argument" unless $args{$arg};
1472+ };
1473+ my $pid_file = $args{pid_file};
1474+ my $pid = $args{pid};
1475+
1476+ PTDEBUG && _d('Checking if PID in', $pid_file, 'is running');
1477+
1478+ if ( ! -f $pid_file ) {
1479+ PTDEBUG && _d('PID file', $pid_file, 'does not exist');
1480+ return;
1481+ }
1482+
1483+ open my $fh, '<', $pid_file
1484+ or die "Error opening $pid_file: $OS_ERROR";
1485+ my $existing_pid = do { local $/; <$fh> };
1486+ chomp($existing_pid) if $existing_pid;
1487+ close $fh
1488+ or die "Error closing $pid_file: $OS_ERROR";
1489+
1490+ if ( $existing_pid ) {
1491+ if ( $existing_pid == $pid ) {
1492+ warn "The current PID $pid already holds the PID file $pid_file\n";
1493+ return;
1494+ }
1495+ else {
1496+ PTDEBUG && _d('Checking if PID', $existing_pid, 'is running');
1497+ my $pid_is_alive = kill 0, $existing_pid;
1498 if ( $pid_is_alive ) {
1499- die "The PID file $PID_file already exists "
1500- . " and the PID that it contains, $pid, is running";
1501- }
1502- else {
1503- warn "Overwriting PID file $PID_file because the PID that it "
1504- . "contains, $pid, is not running";
1505- }
1506- }
1507- else {
1508- die "The PID file $PID_file already exists but it does not "
1509- . "contain a PID";
1510+ die "PID file $pid_file exists and PID $existing_pid is running\n";
1511+ }
1512 }
1513 }
1514 else {
1515- PTDEBUG && _d('No PID file');
1516- }
1517- return;
1518-}
1519-
1520-sub make_PID_file {
1521- my ( $self ) = @_;
1522- if ( exists $self->{child} ) {
1523- die "Do not call Daemon::make_PID_file() for daemonized scripts";
1524- }
1525- $self->_make_PID_file();
1526- $self->{PID_owner} = $PID;
1527- return;
1528-}
1529-
1530-sub _make_PID_file {
1531- my ( $self ) = @_;
1532-
1533- my $PID_file = $self->{PID_file};
1534- if ( !$PID_file ) {
1535- PTDEBUG && _d('No PID file to create');
1536- return;
1537- }
1538-
1539- $self->check_PID_file();
1540-
1541- open my $PID_FH, '>', $PID_file
1542- or die "Cannot open PID file $PID_file: $OS_ERROR";
1543- print $PID_FH $PID
1544- or die "Cannot print to PID file $PID_file: $OS_ERROR";
1545- close $PID_FH
1546- or die "Cannot close PID file $PID_file: $OS_ERROR";
1547-
1548- PTDEBUG && _d('Created PID file:', $self->{PID_file});
1549- return;
1550-}
1551-
1552-sub _remove_PID_file {
1553- my ( $self ) = @_;
1554- if ( $self->{PID_file} && -f $self->{PID_file} ) {
1555- unlink $self->{PID_file}
1556- or warn "Cannot remove PID file $self->{PID_file}: $OS_ERROR";
1557+ die "PID file $pid_file exists but it is empty. Remove the file "
1558+ . "if the process is no longer running.\n";
1559+ }
1560+
1561+ return $existing_pid;
1562+}
1563+
1564+sub _update_pid_file {
1565+ my ($self, %args) = @_;
1566+ my @required_args = qw(pid pid_file);
1567+ foreach my $arg ( @required_args ) {
1568+ die "I need a $arg argument" unless $args{$arg};
1569+ };
1570+ my $pid = $args{pid};
1571+ my $pid_file = $args{pid_file};
1572+
1573+ open my $fh, '>', $pid_file
1574+ or die "Cannot open $pid_file: $OS_ERROR";
1575+ print { $fh } $pid, "\n"
1576+ or die "Cannot print to $pid_file: $OS_ERROR";
1577+ close $fh
1578+ or warn "Cannot close $pid_file: $OS_ERROR";
1579+
1580+ return;
1581+}
1582+
1583+sub remove_pid_file {
1584+ my ($self, $pid_file) = @_;
1585+ $pid_file ||= $self->{pid_file};
1586+ if ( $pid_file && -f $pid_file ) {
1587+ unlink $self->{pid_file}
1588+ or warn "Cannot remove PID file $pid_file: $OS_ERROR";
1589 PTDEBUG && _d('Removed PID file');
1590 }
1591 else {
1592@@ -2847,20 +2933,15 @@
1593 }
1594
1595 sub DESTROY {
1596- my ( $self ) = @_;
1597+ my ($self) = @_;
1598
1599- $self->_remove_PID_file() if ($self->{PID_owner} || 0) == $PID;
1600+ if ( $self->{pid_file_owner} == $PID ) {
1601+ $self->remove_pid_file();
1602+ }
1603
1604 return;
1605 }
1606
1607-sub slurp_file {
1608- my ($file) = @_;
1609- return unless $file;
1610- open my $fh, "<", $file or die "Cannot open $file: $OS_ERROR";
1611- return do { local $/; <$fh> };
1612-}
1613-
1614 sub _d {
1615 my ($package, undef, $line) = caller 0;
1616 @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
1617@@ -3543,25 +3624,23 @@
1618 # ###########################################################################
1619
1620 # ###########################################################################
1621-# HTTPMicro package
1622+# HTTP::Micro package
1623 # This package is a copy without comments from the original. The original
1624 # with comments and its test file can be found in the Bazaar repository at,
1625-# lib/HTTPMicro.pm
1626-# t/lib/HTTPMicro.t
1627+# lib/HTTP/Micro.pm
1628+# t/lib/HTTP/Micro.t
1629 # See https://launchpad.net/percona-toolkit for more information.
1630 # ###########################################################################
1631 {
1632-
1633-package HTTPMicro;
1634-BEGIN {
1635- $HTTPMicro::VERSION = '0.001';
1636-}
1637+package HTTP::Micro;
1638+
1639+our $VERSION = '0.01';
1640+
1641 use strict;
1642-use warnings;
1643-
1644+use warnings FATAL => 'all';
1645+use English qw(-no_match_vars);
1646 use Carp ();
1647
1648-
1649 my @attributes;
1650 BEGIN {
1651 @attributes = qw(agent timeout);
1652@@ -3632,7 +3711,7 @@
1653 headers => {},
1654 };
1655
1656- my $handle = HTTPMicro::Handle->new(timeout => $self->{timeout});
1657+ my $handle = HTTP::Micro::Handle->new(timeout => $self->{timeout});
1658
1659 $handle->connect($scheme, $host, $port);
1660
1661@@ -3697,320 +3776,325 @@
1662 return ($scheme, $host, $port, $path_query);
1663 }
1664
1665-package
1666- HTTPMicro::Handle; # hide from PAUSE/indexers
1667-use strict;
1668-use warnings;
1669-
1670-use Carp qw[croak];
1671-use Errno qw[EINTR EPIPE];
1672-use IO::Socket qw[SOCK_STREAM];
1673-
1674-sub BUFSIZE () { 32768 }
1675-
1676-my $Printable = sub {
1677- local $_ = shift;
1678- s/\r/\\r/g;
1679- s/\n/\\n/g;
1680- s/\t/\\t/g;
1681- s/([^\x20-\x7E])/sprintf('\\x%.2X', ord($1))/ge;
1682- $_;
1683-};
1684-
1685-sub new {
1686- my ($class, %args) = @_;
1687- return bless {
1688- rbuf => '',
1689- timeout => 60,
1690- max_line_size => 16384,
1691- %args
1692- }, $class;
1693-}
1694-
1695-my $ssl_verify_args = {
1696- check_cn => "when_only",
1697- wildcards_in_alt => "anywhere",
1698- wildcards_in_cn => "anywhere"
1699-};
1700-
1701-sub connect {
1702- @_ == 4 || croak(q/Usage: $handle->connect(scheme, host, port)/);
1703- my ($self, $scheme, $host, $port) = @_;
1704-
1705- if ( $scheme eq 'https' ) {
1706- eval "require IO::Socket::SSL"
1707- unless exists $INC{'IO/Socket/SSL.pm'};
1708- croak(qq/IO::Socket::SSL must be installed for https support\n/)
1709- unless $INC{'IO/Socket/SSL.pm'};
1710- }
1711- elsif ( $scheme ne 'http' ) {
1712- croak(qq/Unsupported URL scheme '$scheme'\n/);
1713- }
1714-
1715- $self->{fh} = 'IO::Socket::INET'->new(
1716- PeerHost => $host,
1717- PeerPort => $port,
1718- Proto => 'tcp',
1719- Type => SOCK_STREAM,
1720- Timeout => $self->{timeout}
1721- ) or croak(qq/Could not connect to '$host:$port': $@/);
1722-
1723- binmode($self->{fh})
1724- or croak(qq/Could not binmode() socket: '$!'/);
1725-
1726- if ( $scheme eq 'https') {
1727- IO::Socket::SSL->start_SSL($self->{fh});
1728- ref($self->{fh}) eq 'IO::Socket::SSL'
1729- or die(qq/SSL connection failed for $host\n/);
1730- if ( $self->{fh}->can("verify_hostname") ) {
1731- $self->{fh}->verify_hostname( $host, $ssl_verify_args );
1732- }
1733- else {
1734- my $fh = $self->{fh};
1735- _verify_hostname_of_cert($host, _peer_certificate($fh), $ssl_verify_args)
1736- or die(qq/SSL certificate not valid for $host\n/);
1737- }
1738- }
1739-
1740- $self->{host} = $host;
1741- $self->{port} = $port;
1742-
1743- return $self;
1744-}
1745-
1746-sub close {
1747- @_ == 1 || croak(q/Usage: $handle->close()/);
1748- my ($self) = @_;
1749- CORE::close($self->{fh})
1750- or croak(qq/Could not close socket: '$!'/);
1751-}
1752-
1753-sub write {
1754- @_ == 2 || croak(q/Usage: $handle->write(buf)/);
1755- my ($self, $buf) = @_;
1756-
1757- my $len = length $buf;
1758- my $off = 0;
1759-
1760- local $SIG{PIPE} = 'IGNORE';
1761-
1762- while () {
1763- $self->can_write
1764- or croak(q/Timed out while waiting for socket to become ready for writing/);
1765- my $r = syswrite($self->{fh}, $buf, $len, $off);
1766- if (defined $r) {
1767- $len -= $r;
1768- $off += $r;
1769- last unless $len > 0;
1770- }
1771- elsif ($! == EPIPE) {
1772- croak(qq/Socket closed by remote server: $!/);
1773- }
1774- elsif ($! != EINTR) {
1775- croak(qq/Could not write to socket: '$!'/);
1776- }
1777- }
1778- return $off;
1779-}
1780-
1781-sub read {
1782- @_ == 2 || @_ == 3 || croak(q/Usage: $handle->read(len)/);
1783- my ($self, $len) = @_;
1784-
1785- my $buf = '';
1786- my $got = length $self->{rbuf};
1787-
1788- if ($got) {
1789- my $take = ($got < $len) ? $got : $len;
1790- $buf = substr($self->{rbuf}, 0, $take, '');
1791- $len -= $take;
1792- }
1793-
1794- while ($len > 0) {
1795- $self->can_read
1796- or croak(q/Timed out while waiting for socket to become ready for reading/);
1797- my $r = sysread($self->{fh}, $buf, $len, length $buf);
1798- if (defined $r) {
1799- last unless $r;
1800- $len -= $r;
1801- }
1802- elsif ($! != EINTR) {
1803- croak(qq/Could not read from socket: '$!'/);
1804- }
1805- }
1806- if ($len) {
1807- croak(q/Unexpected end of stream/);
1808- }
1809- return $buf;
1810-}
1811-
1812-sub readline {
1813- @_ == 1 || croak(q/Usage: $handle->readline()/);
1814- my ($self) = @_;
1815-
1816- while () {
1817- if ($self->{rbuf} =~ s/\A ([^\x0D\x0A]* \x0D?\x0A)//x) {
1818- return $1;
1819- }
1820- $self->can_read
1821- or croak(q/Timed out while waiting for socket to become ready for reading/);
1822- my $r = sysread($self->{fh}, $self->{rbuf}, BUFSIZE, length $self->{rbuf});
1823- if (defined $r) {
1824- last unless $r;
1825- }
1826- elsif ($! != EINTR) {
1827- croak(qq/Could not read from socket: '$!'/);
1828- }
1829- }
1830- croak(q/Unexpected end of stream while looking for line/);
1831-}
1832-
1833-sub read_header_lines {
1834- @_ == 1 || @_ == 2 || croak(q/Usage: $handle->read_header_lines([headers])/);
1835- my ($self, $headers) = @_;
1836- $headers ||= {};
1837- my $lines = 0;
1838- my $val;
1839-
1840- while () {
1841- my $line = $self->readline;
1842-
1843- if ($line =~ /\A ([^\x00-\x1F\x7F:]+) : [\x09\x20]* ([^\x0D\x0A]*)/x) {
1844- my ($field_name) = lc $1;
1845- $val = \($headers->{$field_name} = $2);
1846- }
1847- elsif ($line =~ /\A [\x09\x20]+ ([^\x0D\x0A]*)/x) {
1848- $val
1849- or croak(q/Unexpected header continuation line/);
1850- next unless length $1;
1851- $$val .= ' ' if length $$val;
1852- $$val .= $1;
1853- }
1854- elsif ($line =~ /\A \x0D?\x0A \z/x) {
1855- last;
1856- }
1857- else {
1858- croak(q/Malformed header line: / . $Printable->($line));
1859- }
1860- }
1861- return $headers;
1862-}
1863-
1864-sub write_header_lines {
1865- (@_ == 2 && ref $_[1] eq 'HASH') || croak(q/Usage: $handle->write_header_lines(headers)/);
1866- my($self, $headers) = @_;
1867-
1868- my $buf = '';
1869- while (my ($k, $v) = each %$headers) {
1870- my $field_name = lc $k;
1871- $field_name =~ /\A [\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]+ \z/x
1872- or croak(q/Invalid HTTP header field name: / . $Printable->($field_name));
1873- $field_name =~ s/\b(\w)/\u$1/g;
1874- $buf .= "$field_name: $v\x0D\x0A";
1875- }
1876- $buf .= "\x0D\x0A";
1877- return $self->write($buf);
1878-}
1879-
1880-sub read_content_body {
1881- @_ == 3 || @_ == 4 || croak(q/Usage: $handle->read_content_body(callback, response, [read_length])/);
1882- my ($self, $cb, $response, $len) = @_;
1883- $len ||= $response->{headers}{'content-length'};
1884-
1885- croak("No content-length in the returned response, and this "
1886- . "UA doesn't implement chunking") unless defined $len;
1887-
1888- while ($len > 0) {
1889- my $read = ($len > BUFSIZE) ? BUFSIZE : $len;
1890- $cb->($self->read($read), $response);
1891- $len -= $read;
1892- }
1893-
1894- return;
1895-}
1896-
1897-sub write_content_body {
1898- @_ == 2 || croak(q/Usage: $handle->write_content_body(request)/);
1899- my ($self, $request) = @_;
1900- my ($len, $content_length) = (0, $request->{headers}{'content-length'});
1901-
1902- $len += $self->write($request->{content});
1903-
1904- $len == $content_length
1905- or croak(qq/Content-Length missmatch (got: $len expected: $content_length)/);
1906-
1907- return $len;
1908-}
1909-
1910-sub read_response_header {
1911- @_ == 1 || croak(q/Usage: $handle->read_response_header()/);
1912- my ($self) = @_;
1913-
1914- my $line = $self->readline;
1915-
1916- $line =~ /\A (HTTP\/(0*\d+\.0*\d+)) [\x09\x20]+ ([0-9]{3}) [\x09\x20]+ ([^\x0D\x0A]*) \x0D?\x0A/x
1917- or croak(q/Malformed Status-Line: / . $Printable->($line));
1918-
1919- my ($protocol, $version, $status, $reason) = ($1, $2, $3, $4);
1920-
1921- return {
1922- status => $status,
1923- reason => $reason,
1924- headers => $self->read_header_lines,
1925- protocol => $protocol,
1926- };
1927-}
1928-
1929-sub write_request_header {
1930- @_ == 4 || croak(q/Usage: $handle->write_request_header(method, request_uri, headers)/);
1931- my ($self, $method, $request_uri, $headers) = @_;
1932-
1933- return $self->write("$method $request_uri HTTP/1.1\x0D\x0A")
1934- + $self->write_header_lines($headers);
1935-}
1936-
1937-sub _do_timeout {
1938- my ($self, $type, $timeout) = @_;
1939- $timeout = $self->{timeout}
1940- unless defined $timeout && $timeout >= 0;
1941-
1942- my $fd = fileno $self->{fh};
1943- defined $fd && $fd >= 0
1944- or croak(q/select(2): 'Bad file descriptor'/);
1945-
1946- my $initial = time;
1947- my $pending = $timeout;
1948- my $nfound;
1949-
1950- vec(my $fdset = '', $fd, 1) = 1;
1951-
1952- while () {
1953- $nfound = ($type eq 'read')
1954- ? select($fdset, undef, undef, $pending)
1955- : select(undef, $fdset, undef, $pending) ;
1956- if ($nfound == -1) {
1957- $! == EINTR
1958- or croak(qq/select(2): '$!'/);
1959- redo if !$timeout || ($pending = $timeout - (time - $initial)) > 0;
1960- $nfound = 0;
1961- }
1962- last;
1963- }
1964- $! = 0;
1965- return $nfound;
1966-}
1967-
1968-sub can_read {
1969- @_ == 1 || @_ == 2 || croak(q/Usage: $handle->can_read([timeout])/);
1970- my $self = shift;
1971- return $self->_do_timeout('read', @_)
1972-}
1973-
1974-sub can_write {
1975- @_ == 1 || @_ == 2 || croak(q/Usage: $handle->can_write([timeout])/);
1976- my $self = shift;
1977- return $self->_do_timeout('write', @_)
1978-}
1979+} # HTTP::Micro
1980+
1981+{
1982+ package HTTP::Micro::Handle;
1983+
1984+ use strict;
1985+ use warnings FATAL => 'all';
1986+ use English qw(-no_match_vars);
1987+
1988+ use Carp qw(croak);
1989+ use Errno qw(EINTR EPIPE);
1990+ use IO::Socket qw(SOCK_STREAM);
1991+
1992+ sub BUFSIZE () { 32768 }
1993+
1994+ my $Printable = sub {
1995+ local $_ = shift;
1996+ s/\r/\\r/g;
1997+ s/\n/\\n/g;
1998+ s/\t/\\t/g;
1999+ s/([^\x20-\x7E])/sprintf('\\x%.2X', ord($1))/ge;
2000+ $_;
2001+ };
2002+
2003+ sub new {
2004+ my ($class, %args) = @_;
2005+ return bless {
2006+ rbuf => '',
2007+ timeout => 60,
2008+ max_line_size => 16384,
2009+ %args
2010+ }, $class;
2011+ }
2012+
2013+ my $ssl_verify_args = {
2014+ check_cn => "when_only",
2015+ wildcards_in_alt => "anywhere",
2016+ wildcards_in_cn => "anywhere"
2017+ };
2018+
2019+ sub connect {
2020+ @_ == 4 || croak(q/Usage: $handle->connect(scheme, host, port)/);
2021+ my ($self, $scheme, $host, $port) = @_;
2022+
2023+ if ( $scheme eq 'https' ) {
2024+ eval "require IO::Socket::SSL"
2025+ unless exists $INC{'IO/Socket/SSL.pm'};
2026+ croak(qq/IO::Socket::SSL must be installed for https support\n/)
2027+ unless $INC{'IO/Socket/SSL.pm'};
2028+ }
2029+ elsif ( $scheme ne 'http' ) {
2030+ croak(qq/Unsupported URL scheme '$scheme'\n/);
2031+ }
2032+
2033+ $self->{fh} = IO::Socket::INET->new(
2034+ PeerHost => $host,
2035+ PeerPort => $port,
2036+ Proto => 'tcp',
2037+ Type => SOCK_STREAM,
2038+ Timeout => $self->{timeout}
2039+ ) or croak(qq/Could not connect to '$host:$port': $@/);
2040+
2041+ binmode($self->{fh})
2042+ or croak(qq/Could not binmode() socket: '$!'/);
2043+
2044+ if ( $scheme eq 'https') {
2045+ IO::Socket::SSL->start_SSL($self->{fh});
2046+ ref($self->{fh}) eq 'IO::Socket::SSL'
2047+ or die(qq/SSL connection failed for $host\n/);
2048+ if ( $self->{fh}->can("verify_hostname") ) {
2049+ $self->{fh}->verify_hostname( $host, $ssl_verify_args );
2050+ }
2051+ else {
2052+ my $fh = $self->{fh};
2053+ _verify_hostname_of_cert($host, _peer_certificate($fh), $ssl_verify_args)
2054+ or die(qq/SSL certificate not valid for $host\n/);
2055+ }
2056+ }
2057+
2058+ $self->{host} = $host;
2059+ $self->{port} = $port;
2060+
2061+ return $self;
2062+ }
2063+
2064+ sub close {
2065+ @_ == 1 || croak(q/Usage: $handle->close()/);
2066+ my ($self) = @_;
2067+ CORE::close($self->{fh})
2068+ or croak(qq/Could not close socket: '$!'/);
2069+ }
2070+
2071+ sub write {
2072+ @_ == 2 || croak(q/Usage: $handle->write(buf)/);
2073+ my ($self, $buf) = @_;
2074+
2075+ my $len = length $buf;
2076+ my $off = 0;
2077+
2078+ local $SIG{PIPE} = 'IGNORE';
2079+
2080+ while () {
2081+ $self->can_write
2082+ or croak(q/Timed out while waiting for socket to become ready for writing/);
2083+ my $r = syswrite($self->{fh}, $buf, $len, $off);
2084+ if (defined $r) {
2085+ $len -= $r;
2086+ $off += $r;
2087+ last unless $len > 0;
2088+ }
2089+ elsif ($! == EPIPE) {
2090+ croak(qq/Socket closed by remote server: $!/);
2091+ }
2092+ elsif ($! != EINTR) {
2093+ croak(qq/Could not write to socket: '$!'/);
2094+ }
2095+ }
2096+ return $off;
2097+ }
2098+
2099+ sub read {
2100+ @_ == 2 || @_ == 3 || croak(q/Usage: $handle->read(len)/);
2101+ my ($self, $len) = @_;
2102+
2103+ my $buf = '';
2104+ my $got = length $self->{rbuf};
2105+
2106+ if ($got) {
2107+ my $take = ($got < $len) ? $got : $len;
2108+ $buf = substr($self->{rbuf}, 0, $take, '');
2109+ $len -= $take;
2110+ }
2111+
2112+ while ($len > 0) {
2113+ $self->can_read
2114+ or croak(q/Timed out while waiting for socket to become ready for reading/);
2115+ my $r = sysread($self->{fh}, $buf, $len, length $buf);
2116+ if (defined $r) {
2117+ last unless $r;
2118+ $len -= $r;
2119+ }
2120+ elsif ($! != EINTR) {
2121+ croak(qq/Could not read from socket: '$!'/);
2122+ }
2123+ }
2124+ if ($len) {
2125+ croak(q/Unexpected end of stream/);
2126+ }
2127+ return $buf;
2128+ }
2129+
2130+ sub readline {
2131+ @_ == 1 || croak(q/Usage: $handle->readline()/);
2132+ my ($self) = @_;
2133+
2134+ while () {
2135+ if ($self->{rbuf} =~ s/\A ([^\x0D\x0A]* \x0D?\x0A)//x) {
2136+ return $1;
2137+ }
2138+ $self->can_read
2139+ or croak(q/Timed out while waiting for socket to become ready for reading/);
2140+ my $r = sysread($self->{fh}, $self->{rbuf}, BUFSIZE, length $self->{rbuf});
2141+ if (defined $r) {
2142+ last unless $r;
2143+ }
2144+ elsif ($! != EINTR) {
2145+ croak(qq/Could not read from socket: '$!'/);
2146+ }
2147+ }
2148+ croak(q/Unexpected end of stream while looking for line/);
2149+ }
2150+
2151+ sub read_header_lines {
2152+ @_ == 1 || @_ == 2 || croak(q/Usage: $handle->read_header_lines([headers])/);
2153+ my ($self, $headers) = @_;
2154+ $headers ||= {};
2155+ my $lines = 0;
2156+ my $val;
2157+
2158+ while () {
2159+ my $line = $self->readline;
2160+
2161+ if ($line =~ /\A ([^\x00-\x1F\x7F:]+) : [\x09\x20]* ([^\x0D\x0A]*)/x) {
2162+ my ($field_name) = lc $1;
2163+ $val = \($headers->{$field_name} = $2);
2164+ }
2165+ elsif ($line =~ /\A [\x09\x20]+ ([^\x0D\x0A]*)/x) {
2166+ $val
2167+ or croak(q/Unexpected header continuation line/);
2168+ next unless length $1;
2169+ $$val .= ' ' if length $$val;
2170+ $$val .= $1;
2171+ }
2172+ elsif ($line =~ /\A \x0D?\x0A \z/x) {
2173+ last;
2174+ }
2175+ else {
2176+ croak(q/Malformed header line: / . $Printable->($line));
2177+ }
2178+ }
2179+ return $headers;
2180+ }
2181+
2182+ sub write_header_lines {
2183+ (@_ == 2 && ref $_[1] eq 'HASH') || croak(q/Usage: $handle->write_header_lines(headers)/);
2184+ my($self, $headers) = @_;
2185+
2186+ my $buf = '';
2187+ while (my ($k, $v) = each %$headers) {
2188+ my $field_name = lc $k;
2189+ $field_name =~ /\A [\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]+ \z/x
2190+ or croak(q/Invalid HTTP header field name: / . $Printable->($field_name));
2191+ $field_name =~ s/\b(\w)/\u$1/g;
2192+ $buf .= "$field_name: $v\x0D\x0A";
2193+ }
2194+ $buf .= "\x0D\x0A";
2195+ return $self->write($buf);
2196+ }
2197+
2198+ sub read_content_body {
2199+ @_ == 3 || @_ == 4 || croak(q/Usage: $handle->read_content_body(callback, response, [read_length])/);
2200+ my ($self, $cb, $response, $len) = @_;
2201+ $len ||= $response->{headers}{'content-length'};
2202+
2203+ croak("No content-length in the returned response, and this "
2204+ . "UA doesn't implement chunking") unless defined $len;
2205+
2206+ while ($len > 0) {
2207+ my $read = ($len > BUFSIZE) ? BUFSIZE : $len;
2208+ $cb->($self->read($read), $response);
2209+ $len -= $read;
2210+ }
2211+
2212+ return;
2213+ }
2214+
2215+ sub write_content_body {
2216+ @_ == 2 || croak(q/Usage: $handle->write_content_body(request)/);
2217+ my ($self, $request) = @_;
2218+ my ($len, $content_length) = (0, $request->{headers}{'content-length'});
2219+
2220+ $len += $self->write($request->{content});
2221+
2222+ $len == $content_length
2223+ or croak(qq/Content-Length missmatch (got: $len expected: $content_length)/);
2224+
2225+ return $len;
2226+ }
2227+
2228+ sub read_response_header {
2229+ @_ == 1 || croak(q/Usage: $handle->read_response_header()/);
2230+ my ($self) = @_;
2231+
2232+ my $line = $self->readline;
2233+
2234+ $line =~ /\A (HTTP\/(0*\d+\.0*\d+)) [\x09\x20]+ ([0-9]{3}) [\x09\x20]+ ([^\x0D\x0A]*) \x0D?\x0A/x
2235+ or croak(q/Malformed Status-Line: / . $Printable->($line));
2236+
2237+ my ($protocol, $version, $status, $reason) = ($1, $2, $3, $4);
2238+
2239+ return {
2240+ status => $status,
2241+ reason => $reason,
2242+ headers => $self->read_header_lines,
2243+ protocol => $protocol,
2244+ };
2245+ }
2246+
2247+ sub write_request_header {
2248+ @_ == 4 || croak(q/Usage: $handle->write_request_header(method, request_uri, headers)/);
2249+ my ($self, $method, $request_uri, $headers) = @_;
2250+
2251+ return $self->write("$method $request_uri HTTP/1.1\x0D\x0A")
2252+ + $self->write_header_lines($headers);
2253+ }
2254+
2255+ sub _do_timeout {
2256+ my ($self, $type, $timeout) = @_;
2257+ $timeout = $self->{timeout}
2258+ unless defined $timeout && $timeout >= 0;
2259+
2260+ my $fd = fileno $self->{fh};
2261+ defined $fd && $fd >= 0
2262+ or croak(q/select(2): 'Bad file descriptor'/);
2263+
2264+ my $initial = time;
2265+ my $pending = $timeout;
2266+ my $nfound;
2267+
2268+ vec(my $fdset = '', $fd, 1) = 1;
2269+
2270+ while () {
2271+ $nfound = ($type eq 'read')
2272+ ? select($fdset, undef, undef, $pending)
2273+ : select(undef, $fdset, undef, $pending) ;
2274+ if ($nfound == -1) {
2275+ $! == EINTR
2276+ or croak(qq/select(2): '$!'/);
2277+ redo if !$timeout || ($pending = $timeout - (time - $initial)) > 0;
2278+ $nfound = 0;
2279+ }
2280+ last;
2281+ }
2282+ $! = 0;
2283+ return $nfound;
2284+ }
2285+
2286+ sub can_read {
2287+ @_ == 1 || @_ == 2 || croak(q/Usage: $handle->can_read([timeout])/);
2288+ my $self = shift;
2289+ return $self->_do_timeout('read', @_)
2290+ }
2291+
2292+ sub can_write {
2293+ @_ == 1 || @_ == 2 || croak(q/Usage: $handle->can_write([timeout])/);
2294+ my $self = shift;
2295+ return $self->_do_timeout('write', @_)
2296+ }
2297+} # HTTP::Micro::Handle
2298
2299 my $prog = <<'EOP';
2300 BEGIN {
2301@@ -4031,6 +4115,7 @@
2302 }
2303 }
2304 {
2305+ use Carp qw(croak);
2306 my %dispatcher = (
2307 issuer => sub { Net::SSLeay::X509_NAME_oneline( Net::SSLeay::X509_get_issuer_name( shift )) },
2308 subject => sub { Net::SSLeay::X509_NAME_oneline( Net::SSLeay::X509_get_subject_name( shift )) },
2309@@ -4186,9 +4271,8 @@
2310 }
2311
2312 1;
2313-}
2314 # ###########################################################################
2315-# End HTTPMicro package
2316+# End HTTP::Micro package
2317 # ###########################################################################
2318
2319 # ###########################################################################
2320@@ -4222,7 +4306,7 @@
2321
2322 eval {
2323 require Percona::Toolkit;
2324- require HTTPMicro;
2325+ require HTTP::Micro;
2326 };
2327
2328 {
2329@@ -4453,7 +4537,7 @@
2330 my $url = $args{url};
2331 my $instances = $args{instances};
2332
2333- my $ua = $args{ua} || HTTPMicro->new( timeout => 3 );
2334+ my $ua = $args{ua} || HTTP::Micro->new( timeout => 3 );
2335
2336 my $response = $ua->request('GET', $url);
2337 PTDEBUG && _d('Server response:', Dumper($response));
2338@@ -4832,14 +4916,11 @@
2339 # ########################################################################
2340 # If --pid, check it first since we'll die if it already exits.
2341 # ########################################################################
2342- my $daemon;
2343- if ( $o->get('pid') ) {
2344- # We're not daemoninzing, it just handles PID stuff. Keep $daemon
2345- # in the the scope of main() because when it's destroyed it automatically
2346- # removes the PID file.
2347- $daemon = new Daemon(o=>$o);
2348- $daemon->make_PID_file();
2349- }
2350+ my $daemon = Daemon->new(
2351+ daemonize => 0,
2352+ pid_file => $o->get('pid'),
2353+ );
2354+ $daemon->run();
2355
2356 # #######################################################################
2357 # Connect to MySQL.
2358@@ -5521,7 +5602,7 @@
2359
2360 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2361
2362-This program is copyright 2011-2013 Percona Ireland Ltd,
2363+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
2364 2007-2011 Baron Schwartz.
2365
2366 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2367@@ -5540,6 +5621,6 @@
2368
2369 =head1 VERSION
2370
2371-pt-duplicate-key-checker 2.2.5
2372+pt-duplicate-key-checker 2.2.6
2373
2374 =cut
2375
2376=== modified file 'bin/pt-fifo-split'
2377--- bin/pt-fifo-split 2013-11-08 01:47:46 +0000
2378+++ bin/pt-fifo-split 2013-12-20 00:06:23 +0000
2379@@ -1593,7 +1593,7 @@
2380
2381 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2382
2383-This program is copyright 2011-2013 Percona Ireland Ltd,
2384+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
2385 2007-2011 Baron Schwartz.
2386
2387 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2388@@ -1612,6 +1612,6 @@
2389
2390 =head1 VERSION
2391
2392-pt-fifo-split 2.2.5
2393+pt-fifo-split 2.2.6
2394
2395 =cut
2396
2397=== modified file 'bin/pt-find'
2398--- bin/pt-find 2013-11-08 01:47:46 +0000
2399+++ bin/pt-find 2013-12-20 00:06:23 +0000
2400@@ -35,7 +35,7 @@
2401 {
2402 package Percona::Toolkit;
2403
2404-our $VERSION = '2.2.5';
2405+our $VERSION = '2.2.6';
2406
2407 use strict;
2408 use warnings FATAL => 'all';
2409@@ -4982,7 +4982,7 @@
2410
2411 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2412
2413-This program is copyright 2011-2013 Percona Ireland Ltd,
2414+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
2415 2007-2011 Baron Schwartz.
2416
2417 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2418@@ -5001,6 +5001,6 @@
2419
2420 =head1 VERSION
2421
2422-pt-find 2.2.5
2423+pt-find 2.2.6
2424
2425 =cut
2426
2427=== modified file 'bin/pt-fingerprint'
2428--- bin/pt-fingerprint 2013-11-08 01:47:46 +0000
2429+++ bin/pt-fingerprint 2013-12-20 00:06:23 +0000
2430@@ -2185,7 +2185,7 @@
2431
2432 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2433
2434-This program is copyright 2011-2013 Percona Ireland Ltd.
2435+This program is copyright 2011-2013 Percona LLC and/or its affiliates.
2436
2437 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2438 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
2439@@ -2203,6 +2203,6 @@
2440
2441 =head1 VERSION
2442
2443-pt-fingerprint 2.2.5
2444+pt-fingerprint 2.2.6
2445
2446 =cut
2447
2448=== modified file 'bin/pt-fk-error-logger'
2449--- bin/pt-fk-error-logger 2013-11-08 01:47:46 +0000
2450+++ bin/pt-fk-error-logger 2013-12-20 00:06:23 +0000
2451@@ -37,7 +37,7 @@
2452 {
2453 package Percona::Toolkit;
2454
2455-our $VERSION = '2.2.5';
2456+our $VERSION = '2.2.6';
2457
2458 use strict;
2459 use warnings FATAL => 'all';
2460@@ -4508,7 +4508,7 @@
2461
2462 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2463
2464-This program is copyright 2011-2013 Percona Ireland Ltd.
2465+This program is copyright 2011-2013 Percona LLC and/or its affiliates.
2466
2467 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2468 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
2469@@ -4526,6 +4526,6 @@
2470
2471 =head1 VERSION
2472
2473-pt-fk-error-logger 2.2.5
2474+pt-fk-error-logger 2.2.6
2475
2476 =cut
2477
2478=== modified file 'bin/pt-heartbeat'
2479--- bin/pt-heartbeat 2013-11-08 01:47:46 +0000
2480+++ bin/pt-heartbeat 2013-12-20 00:06:23 +0000
2481@@ -38,7 +38,7 @@
2482 {
2483 package Percona::Toolkit;
2484
2485-our $VERSION = '2.2.5';
2486+our $VERSION = '2.2.6';
2487
2488 use strict;
2489 use warnings FATAL => 'all';
2490@@ -6188,7 +6188,7 @@
2491
2492 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2493
2494-This program is copyright 2007-2013 Percona Ireland Ltd,
2495+This program is copyright 2007-2013 Percona LLC and/or its affiliates,
2496 2006 Proven Scaling LLC and Six Apart Ltd.
2497
2498 Feedback and improvements are welcome.
2499@@ -6209,6 +6209,6 @@
2500
2501 =head1 VERSION
2502
2503-pt-heartbeat 2.2.5
2504+pt-heartbeat 2.2.6
2505
2506 =cut
2507
2508=== modified file 'bin/pt-index-usage'
2509--- bin/pt-index-usage 2013-11-08 01:47:46 +0000
2510+++ bin/pt-index-usage 2013-12-20 00:06:23 +0000
2511@@ -45,7 +45,7 @@
2512 {
2513 package Percona::Toolkit;
2514
2515-our $VERSION = '2.2.5';
2516+our $VERSION = '2.2.6';
2517
2518 use strict;
2519 use warnings FATAL => 'all';
2520@@ -7517,7 +7517,7 @@
2521
2522 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2523
2524-This program is copyright 2011-2013 Percona Ireland Ltd,
2525+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
2526 2010-2011 Baron Schwartz.
2527
2528 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2529@@ -7536,6 +7536,6 @@
2530
2531 =head1 VERSION
2532
2533-pt-index-usage 2.2.5
2534+pt-index-usage 2.2.6
2535
2536 =cut
2537
2538=== modified file 'bin/pt-ioprofile'
2539--- bin/pt-ioprofile 2013-10-20 03:45:04 +0000
2540+++ bin/pt-ioprofile 2013-12-20 00:06:23 +0000
2541@@ -1100,7 +1100,7 @@
2542
2543 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2544
2545-This program is copyright 2011-2013 Percona Ireland Ltd,
2546+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
2547 2010-2011 Baron Schwartz.
2548
2549 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2550@@ -1119,7 +1119,7 @@
2551
2552 =head1 VERSION
2553
2554-pt-ioprofile 2.2.5
2555+pt-ioprofile 2.2.6
2556
2557 =cut
2558
2559
2560=== modified file 'bin/pt-kill'
2561--- bin/pt-kill 2013-11-08 01:47:46 +0000
2562+++ bin/pt-kill 2013-12-20 00:06:23 +0000
2563@@ -47,7 +47,7 @@
2564 {
2565 package Percona::Toolkit;
2566
2567-our $VERSION = '2.2.5';
2568+our $VERSION = '2.2.6';
2569
2570 use strict;
2571 use warnings FATAL => 'all';
2572@@ -8167,7 +8167,7 @@
2573
2574 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2575
2576-This program is copyright 2011-2013 Percona Ireland Ltd,
2577+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
2578 2009-2011 Baron Schwartz.
2579
2580 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2581@@ -8186,6 +8186,6 @@
2582
2583 =head1 VERSION
2584
2585-pt-kill 2.2.5
2586+pt-kill 2.2.6
2587
2588 =cut
2589
2590=== modified file 'bin/pt-mext'
2591--- bin/pt-mext 2013-10-20 03:45:04 +0000
2592+++ bin/pt-mext 2013-12-20 00:06:23 +0000
2593@@ -772,7 +772,7 @@
2594
2595 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2596
2597-This program is copyright 2011-2013 Percona Ireland Ltd,
2598+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
2599 2010 Baron Schwartz.
2600
2601 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2602@@ -791,7 +791,7 @@
2603
2604 =head1 VERSION
2605
2606-pt-mext 2.2.5
2607+pt-mext 2.2.6
2608
2609 =cut
2610
2611
2612=== modified file 'bin/pt-mysql-summary'
2613--- bin/pt-mysql-summary 2013-10-20 03:45:04 +0000
2614+++ bin/pt-mysql-summary 2013-12-20 00:06:23 +0000
2615@@ -963,7 +963,7 @@
2616 $CMD_MYSQLDUMP $EXT_ARGV --no-data --skip-comments \
2617 --skip-add-locks --skip-add-drop-table --compact \
2618 --skip-lock-all-tables --skip-lock-tables --skip-set-charset \
2619- ${args} --databases $( local IFS=,; echo ${dbtodump})
2620+ ${args} --databases $(local IFS=,; echo ${dbtodump})
2621 }
2622
2623 get_mysqldump_args () {
2624@@ -1036,9 +1036,10 @@
2625 echo "pt-summary-internal-Config_File_path $cnf_file" >> "$dir/mysql-variables"
2626 collect_internal_vars "$dir/mysqld-executables" >> "$dir/mysql-variables"
2627
2628- if [ -n "${OPT_DATABASES}" ]; then
2629- local trg_arg="$( get_mysqldump_args "$dir/mysql-variables" )"
2630- get_mysqldump_for "${trg_arg}" "${OPT_DATABASES}" > "$dir/mysqldump"
2631+ if [ "$OPT_DATABASES" -o "$OPT_ALL_DATABASES" ]; then
2632+ local trg_arg="$(get_mysqldump_args "$dir/mysql-variables")"
2633+ local dbs="${OPT_DATABASES:-""}"
2634+ get_mysqldump_for "${trg_arg}" "$dbs" > "$dir/mysqldump"
2635 fi
2636
2637 (
2638@@ -2243,37 +2244,16 @@
2639 fi
2640
2641 section "Schema"
2642- local reply="n"
2643- if [ "${OPT_DATABASES}" ] || [ "${OPT_READ_SAMPLES}" ] \
2644- || [ -e "$dir/mysqldump" -a -s "$dir/mysqldump" ]; then
2645- reply="y"
2646- elif [ -t 0 -a -t 1 ]; then
2647- echo -n "Would you like to mysqldump -d the schema and analyze it? y/n "
2648- read reply
2649- reply=${reply:-n}
2650- fi
2651- if echo "${reply:-n}" | grep -i '^y' > /dev/null ; then
2652- if [ -z "${OPT_DATABASES}" ] && [ -z "$OPT_READ_SAMPLES" ] \
2653- && [ ! -e "$dir/mysqldump" ]; then
2654- echo "There are ${num_dbs} databases. Would you like to dump all, or just one?"
2655- echo -n "Type the name of the database, or press Enter to dump all of them. "
2656- local dbtodump=""
2657- read dbtodump
2658- local trg_arg="$( get_mysqldump_args "$dir/mysql-variables" )"
2659- get_mysqldump_for "${trg_arg}" "${dbtodump}" > "$dir/mysqldump"
2660- fi
2661-
2662- if [ -e "$dir/mysqldump" -a -s "$dir/mysqldump" ] \
2663- && grep 'CREATE TABLE' "$dir/mysqldump" >/dev/null 2>&1; then
2664- format_overall_db_stats "$dir/mysqldump"
2665- elif [ ! -e "$dir/mysqldump" -a "$OPT_READ_SAMPLES" ]; then
2666- echo "Skipping schema analysis as the directory passed in" \
2667- "doesn't have a dump file"
2668- else
2669- echo "Skipping schema analysis due to apparent error in dump file"
2670- fi
2671+ if [ -s "$dir/mysqldump" ] \
2672+ && grep 'CREATE TABLE' "$dir/mysqldump" >/dev/null 2>&1; then
2673+ format_overall_db_stats "$dir/mysqldump"
2674+ elif [ ! -e "$dir/mysqldump" -a "$OPT_READ_SAMPLES" ]; then
2675+ echo "Skipping schema analysis because --read-samples $dir/mysqldump " \
2676+ "does not exist"
2677+ elif [ -z "$OPT_DATABASES" -a -z "$OPT_ALL_DATABASES" ]; then
2678+ echo "Specify --databases or --all-databases to dump and summarize schemas"
2679 else
2680- echo "Skipping schema analysis"
2681+ echo "Skipping schema analysis due to apparent error in dump file"
2682 fi
2683
2684 section "Noteworthy Technologies"
2685@@ -2731,9 +2711,6 @@
2686 are fuzzy-rounded.
2687
2688 # Schema #####################################################
2689- Would you like to mysqldump -d the schema and analyze it? y/n y
2690- There are 4 databases. Would you like to dump all, or just one?
2691- Type the name of the database, or press Enter to dump all of them.
2692
2693 Database Tables Views SPs Trigs Funcs FKs Partn
2694 mysql 24
2695@@ -2765,16 +2742,10 @@
2696 performance_schema 5 16 33
2697 sakila 1 15 1 3 4 3 19 42 26
2698
2699-If you select to dump the schema and analyze it, the tool will print the above
2700-section. This summarizes the number and type of objects in the database. It is
2701-generated by running C<mysqldump --no-data>, not by querying the
2702-INFORMATION_SCHEMA, which can freeze a busy server. You can use the
2703-L<"--databases"> option to specify which databases to examine. If you do not,
2704-and you run the tool interactively, it will prompt you as shown.
2705-
2706-You can choose not to dump the schema, to dump all of the databases, or to dump
2707-only a single named one, by specifying the appropriate options. In the example
2708-above, we are dumping all databases.
2709+If you specify L<"--databases"> or L<"--all-databases">, the tool will print
2710+the above section. This summarizes the number and type of objects in the
2711+databases. It is generated by running C<mysqldump --no-data>, not by querying
2712+the INFORMATION_SCHEMA, which can freeze a busy server.
2713
2714 The first sub-report in the section is the count of objects by type in each
2715 database: tables, views, and so on. The second one shows how many tables use
2716@@ -2949,6 +2920,10 @@
2717
2718 =over
2719
2720+=item --all-databases
2721+
2722+mysqldump and summarize all databases. See L<"--databases">.
2723+
2724 =item --config
2725
2726 type: string
2727@@ -2960,9 +2935,8 @@
2728
2729 type: string
2730
2731-Names of databases to summarize. If you want all of them, you can use the value
2732-C<--all-databases>; you can also pass in a comma-separated list of database
2733-names. If not provided, the program will ask you for manual input.
2734+mysqldump and summarize this comma-separated list of databases. Specify
2735+L<"--all-databases"> instead if you want to dump and summary all databases.
2736
2737 =item --defaults-file
2738
2739@@ -3096,7 +3070,7 @@
2740
2741 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2742
2743-This program is copyright 2011-2013 Percona Ireland Ltd,
2744+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
2745 2010-2011 Baron Schwartz.
2746
2747 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2748@@ -3115,7 +3089,7 @@
2749
2750 =head1 VERSION
2751
2752-pt-mysql-summary 2.2.5
2753+pt-mysql-summary 2.2.6
2754
2755 =cut
2756
2757
2758=== modified file 'bin/pt-online-schema-change'
2759--- bin/pt-online-schema-change 2013-11-08 01:47:46 +0000
2760+++ bin/pt-online-schema-change 2013-12-20 00:06:23 +0000
2761@@ -54,7 +54,7 @@
2762 {
2763 package Percona::Toolkit;
2764
2765-our $VERSION = '2.2.5';
2766+our $VERSION = '2.2.6';
2767
2768 use strict;
2769 use warnings FATAL => 'all';
2770@@ -8031,8 +8031,22 @@
2771 },
2772 );
2773 PTDEBUG && _d(scalar @$slaves, 'slaves found');
2774+ if ( scalar @$slaves ) {
2775+ print "Found " . scalar(@$slaves) . " slaves:\n";
2776+ foreach my $cxn ( @$slaves ) {
2777+ print " " . $cxn->name() . "\n";
2778+ }
2779+ }
2780+ elsif ( ($o->get('recursion-method') || '') ne 'none') {
2781+ print "No slaves found. See --recursion-method if host "
2782+ . $cxn->name() . " has slaves.\n";
2783+ }
2784+ else {
2785+ print "Ignoring all slaves because --recursion-method=none "
2786+ . "was specified\n";
2787+ }
2788
2789- if ( $o->get('check-slave-lag') ) {
2790+ if ( my $dsn = $o->get('check-slave-lag') ) {
2791 PTDEBUG && _d('Will use --check-slave-lag to check for slave lag');
2792 my $cxn = $make_cxn->(
2793 dsn_string => $o->get('check-slave-lag'),
2794@@ -8044,6 +8058,16 @@
2795 PTDEBUG && _d('Will check slave lag on all slaves');
2796 $slave_lag_cxns = $slaves;
2797 }
2798+ if ( $slave_lag_cxns && scalar @$slave_lag_cxns ) {
2799+ print "Will check slave lag on:\n";
2800+ foreach my $cxn ( @$slave_lag_cxns ) {
2801+ print " " . $cxn->name() . "\n";
2802+ }
2803+ }
2804+ else {
2805+ print "Not checking slave lag because no slaves were found "
2806+ . "and --check-slave-lag was not specified.\n";
2807+ }
2808
2809 # #####################################################################
2810 # Check for replication filters.
2811@@ -8513,14 +8537,36 @@
2812 }
2813 };
2814
2815- for my $slave (@$slaves) {
2816- PTDEBUG && _d('Waiting until', $slave->name(),
2817- 'replicates the table');
2818- sleep 0.5 while ! $tp->check_table(
2819- dbh => $slave->dbh(),
2820- db => $new_tbl->{db},
2821- tbl => $new_tbl->{tbl}
2822- );
2823+ if ( $slaves && scalar @$slaves ) {
2824+ foreach my $slave (@$slaves) {
2825+ my ($pr, $pr_first_report);
2826+ if ( $o->get('progress') ) {
2827+ $pr = new Progress(
2828+ jobsize => scalar @$slaves,
2829+ spec => $o->get('progress'),
2830+ name => "Waiting for " . $slave->name(),
2831+ );
2832+ $pr_first_report = sub {
2833+ print "Waiting forever for new table $new_tbl->{name} to replicate "
2834+ . "to " . $slave->name() . "...\n";
2835+ };
2836+ }
2837+ $pr->start() if $pr;
2838+ my $has_table = 0;
2839+ while ( !$has_table ) {
2840+ $has_table = $tp->check_table(
2841+ dbh => $slave->dbh(),
2842+ db => $new_tbl->{db},
2843+ tbl => $new_tbl->{tbl}
2844+ );
2845+ last if $has_table;
2846+ $pr->update(
2847+ sub { return 0; },
2848+ first_report => $pr_first_report,
2849+ ) if $pr;
2850+ sleep 1;
2851+ }
2852+ }
2853 }
2854
2855 # --plugin hook
2856@@ -11485,7 +11531,7 @@
2857
2858 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2859
2860-This program is copyright 2011-2013 Percona Ireland Ltd.
2861+This program is copyright 2011-2013 Percona LLC and/or its affiliates.
2862
2863 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2864 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
2865@@ -11503,6 +11549,6 @@
2866
2867 =head1 VERSION
2868
2869-pt-online-schema-change 2.2.5
2870+pt-online-schema-change 2.2.6
2871
2872 =cut
2873
2874=== modified file 'bin/pt-pmp'
2875--- bin/pt-pmp 2013-10-20 03:45:04 +0000
2876+++ bin/pt-pmp 2013-12-20 00:06:23 +0000
2877@@ -870,7 +870,7 @@
2878
2879 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2880
2881-This program is copyright 2011-2013 Percona Ireland Ltd,
2882+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
2883 2010-2011 Baron Schwartz.
2884
2885 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2886@@ -889,7 +889,7 @@
2887
2888 =head1 VERSION
2889
2890-pt-pmp 2.2.5
2891+pt-pmp 2.2.6
2892
2893 =cut
2894
2895
2896=== modified file 'bin/pt-query-digest'
2897--- bin/pt-query-digest 2013-11-08 01:47:46 +0000
2898+++ bin/pt-query-digest 2013-12-20 00:06:23 +0000
2899@@ -64,7 +64,7 @@
2900 {
2901 package Percona::Toolkit;
2902
2903-our $VERSION = '2.2.5';
2904+our $VERSION = '2.2.6';
2905
2906 use strict;
2907 use warnings FATAL => 'all';
2908@@ -6776,6 +6776,10 @@
2909 push @result, "# Time range: $time_range";
2910 }
2911
2912+ if ( $results->{globals}->{rate_limit} ) {
2913+ print "# Rate limits apply\n";
2914+ }
2915+
2916 push @result, $self->make_global_header();
2917
2918 my $attribs = $self->sort_attribs( $ea );
2919@@ -6788,7 +6792,6 @@
2920 NUM_ATTRIB:
2921 foreach my $attrib ( @{$attribs->{$type}} ) {
2922 next unless exists $results->{globals}->{$attrib};
2923-
2924 my $store = $results->{globals}->{$attrib};
2925 my $metrics = $ea->stats()->{globals}->{$attrib};
2926 my $func = $attrib =~ m/time|wait$/ ? \&micro_t : \&shorten;
2927@@ -7847,6 +7850,25 @@
2928 $global_data->{queries_per_second} = $qps if $qps;
2929 $global_data->{concurrency} = $conc if $conc;
2930
2931+ if ( exists $results->{globals}->{rate_limit} ) {
2932+ my $rate_limit = $results->{globals}->{rate_limit}->{min} || '';
2933+ my ($type, $limit) = $rate_limit =~ m/^(\w+):(\d+)$/;
2934+ if ( $type && $limit ) {
2935+ $global_data->{rate_limit} = {
2936+ type => $type,
2937+ limit => int($limit),
2938+ };
2939+ }
2940+ else {
2941+ $global_data->{rate_limit}->{error} = "Invalid rate limit: $rate_limit";
2942+ }
2943+
2944+ if ( ($results->{globals}->{rate_limit}->{min} || '')
2945+ ne ($results->{globals}->{rate_limit}->{max} || '') ) {
2946+ $global_data->{rate_limit}->{diff} = 1;
2947+ }
2948+ }
2949+
2950 my %hidden_attrib = (
2951 arg => 1,
2952 fingerprint => 1,
2953@@ -13999,6 +14021,24 @@
2954 );
2955 } # print
2956
2957+ # Combine "# Log_slow_rate_type: query Log_slow_rate_limit: 2"
2958+ # as rate_limit=>'query:2'.
2959+ $pipeline->add(
2960+ name => 'rate limit',
2961+ process => sub {
2962+ my ( $args ) = @_;
2963+ my $event = $args->{event};
2964+ PTDEBUG && _d('callback: rate limit');
2965+ if ( my $limit = $event->{Log_slow_rate_limit} ) {
2966+ $event->{rate_limit} = ($event->{Log_slow_rate_type} || 'session') . ":$limit";
2967+ delete $event->{Log_slow_rate_limit};
2968+ delete $event->{Log_slow_rate_type};
2969+ }
2970+ return $args;
2971+ },
2972+ );
2973+
2974+
2975 # Finally, add aggregator obj for each groupby attrib to the callbacks.
2976 # These aggregating objs should be the last pipeline processes.
2977 foreach my $i ( 0..$#groupby ) {
2978@@ -14024,6 +14064,7 @@
2979 ip => 'string',
2980 port => 'string',
2981 Killed => 'bool',
2982+ rate_limit => 'string',
2983 };
2984
2985 my $ea = new EventAggregator(
2986@@ -16546,7 +16587,7 @@
2987
2988 =head1 COPYRIGHT, LICENSE, AND WARRANTY
2989
2990-This program is copyright 2008-2013 Percona Ireland Ltd.
2991+This program is copyright 2008-2013 Percona LLC and/or its affiliates.
2992
2993 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
2994 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
2995@@ -16564,6 +16605,6 @@
2996
2997 =head1 VERSION
2998
2999-pt-query-digest 2.2.5
3000+pt-query-digest 2.2.6
3001
3002 =cut
3003
3004=== modified file 'bin/pt-show-grants'
3005--- bin/pt-show-grants 2013-11-08 01:47:46 +0000
3006+++ bin/pt-show-grants 2013-12-20 00:06:23 +0000
3007@@ -2387,7 +2387,7 @@
3008
3009 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3010
3011-This program is copyright 2011-2013 Percona Ireland Ltd,
3012+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
3013 2007-2011 Baron Schwartz.
3014
3015 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3016@@ -2406,6 +2406,6 @@
3017
3018 =head1 VERSION
3019
3020-pt-show-grants 2.2.5
3021+pt-show-grants 2.2.6
3022
3023 =cut
3024
3025=== modified file 'bin/pt-sift'
3026--- bin/pt-sift 2013-10-20 03:45:04 +0000
3027+++ bin/pt-sift 2013-12-20 00:06:23 +0000
3028@@ -1218,7 +1218,7 @@
3029
3030 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3031
3032-This program is copyright 2011-2013 Percona Ireland Ltd,
3033+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
3034 2010-2011 Baron Schwartz.
3035
3036 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3037@@ -1237,7 +1237,7 @@
3038
3039 =head1 VERSION
3040
3041-pt-sift 2.2.5
3042+pt-sift 2.2.6
3043
3044 =cut
3045
3046
3047=== modified file 'bin/pt-slave-delay'
3048--- bin/pt-slave-delay 2013-11-08 01:47:46 +0000
3049+++ bin/pt-slave-delay 2013-12-20 00:06:23 +0000
3050@@ -40,7 +40,7 @@
3051 {
3052 package Percona::Toolkit;
3053
3054-our $VERSION = '2.2.5';
3055+our $VERSION = '2.2.6';
3056
3057 use strict;
3058 use warnings FATAL => 'all';
3059@@ -4867,7 +4867,7 @@
3060
3061 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3062
3063-This program is copyright 2011-2013 Percona Ireland Ltd,
3064+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
3065 2007-2011 Sergey Zhuravle and Baron Schwartz.
3066
3067 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3068@@ -4886,6 +4886,6 @@
3069
3070 =head1 VERSION
3071
3072-pt-slave-delay 2.2.5
3073+pt-slave-delay 2.2.6
3074
3075 =cut
3076
3077=== modified file 'bin/pt-slave-find'
3078--- bin/pt-slave-find 2013-11-08 01:47:46 +0000
3079+++ bin/pt-slave-find 2013-12-20 00:06:23 +0000
3080@@ -4315,7 +4315,7 @@
3081
3082 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3083
3084-This program is copyright 2011-2013 Percona Ireland Ltd,
3085+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
3086 2007-2011 Baron Schwartz.
3087
3088 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3089@@ -4334,6 +4334,6 @@
3090
3091 =head1 VERSION
3092
3093-pt-slave-find 2.2.5
3094+pt-slave-find 2.2.6
3095
3096 =cut
3097
3098=== modified file 'bin/pt-slave-restart'
3099--- bin/pt-slave-restart 2013-11-08 01:47:46 +0000
3100+++ bin/pt-slave-restart 2013-12-20 00:06:23 +0000
3101@@ -41,7 +41,7 @@
3102 {
3103 package Percona::Toolkit;
3104
3105-our $VERSION = '2.2.5';
3106+our $VERSION = '2.2.6';
3107
3108 use strict;
3109 use warnings FATAL => 'all';
3110@@ -5809,7 +5809,7 @@
3111
3112 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3113
3114-This program is copyright 2011-2013 Percona Ireland Ltd,
3115+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
3116 2007-2011 Baron Schwartz.
3117
3118 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3119@@ -5828,6 +5828,6 @@
3120
3121 =head1 VERSION
3122
3123-pt-slave-restart 2.2.5
3124+pt-slave-restart 2.2.6
3125
3126 =cut
3127
3128=== modified file 'bin/pt-stalk'
3129--- bin/pt-stalk 2013-10-20 03:45:04 +0000
3130+++ bin/pt-stalk 2013-12-20 00:06:23 +0000
3131@@ -672,10 +672,9 @@
3132 local min_free_pct="${3:-0}"
3133 local bytes_margin="${4:-0}"
3134
3135-
3136- local used_bytes=$(perl -ane 'm!^/! && print $F[2] * 1024' "$file")
3137- local free_bytes=$(perl -ane 'm!^/! && print $F[3] * 1024' "$file")
3138- local pct_used=$(perl -ane 'm!^/! && print ($F[4] =~ m/(\d+)/)' "$file")
3139+ local used_bytes=$(tail -n 1 "$file" | perl -ane 'print $F[2] * 1024')
3140+ local free_bytes=$(tail -n 1 "$file" | perl -ane 'print $F[3] * 1024')
3141+ local pct_used=$(tail -n 1 "$file" | perl -ane 'print ($F[4] =~ m/(\d+)/)')
3142 local pct_free=$((100 - $pct_used))
3143
3144 local real_free_bytes=$free_bytes
3145@@ -863,20 +862,21 @@
3146 if [ "$CMD_SYSCTL" ]; then
3147 $CMD_SYSCTL -a >> "$d/$p-sysctl" &
3148 fi
3149+ local cnt=$(($OPT_RUN_TIME / $OPT_SLEEP_COLLECT))
3150 if [ "$CMD_VMSTAT" ]; then
3151- $CMD_VMSTAT 1 $OPT_RUN_TIME >> "$d/$p-vmstat" &
3152+ $CMD_VMSTAT $OPT_SLEEP_COLLECT $cnt >> "$d/$p-vmstat" &
3153 $CMD_VMSTAT $OPT_RUN_TIME 2 >> "$d/$p-vmstat-overall" &
3154 fi
3155 if [ "$CMD_IOSTAT" ]; then
3156- $CMD_IOSTAT -dx 1 $OPT_RUN_TIME >> "$d/$p-iostat" &
3157+ $CMD_IOSTAT -dx $OPT_SLEEP_COLLECT $cnt >> "$d/$p-iostat" &
3158 $CMD_IOSTAT -dx $OPT_RUN_TIME 2 >> "$d/$p-iostat-overall" &
3159 fi
3160 if [ "$CMD_MPSTAT" ]; then
3161- $CMD_MPSTAT -P ALL 1 $OPT_RUN_TIME >> "$d/$p-mpstat" &
3162+ $CMD_MPSTAT -P ALL $OPT_SLEEP_COLLECT $cnt >> "$d/$p-mpstat" &
3163 $CMD_MPSTAT -P ALL $OPT_RUN_TIME 1 >> "$d/$p-mpstat-overall" &
3164 fi
3165
3166- $CMD_MYSQLADMIN $EXT_ARGV ext -i1 -c$OPT_RUN_TIME >>"$d/$p-mysqladmin" &
3167+ $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" &
3168 local mysqladmin_pid=$!
3169
3170 local have_lock_waits_table=""
3171@@ -887,7 +887,10 @@
3172 fi
3173
3174 log "Loop start: $(date +'TS %s.%N %F %T')"
3175- for loopno in $(_seq $OPT_RUN_TIME); do
3176+ local start_time=$(date +'%s')
3177+ local curr_time=$start_time
3178+ while [ $((curr_time - start_time)) -lt $OPT_RUN_TIME ]; do
3179+
3180 disk_space $d > $d/$p-disk-space
3181 check_disk_space \
3182 $d/$p-disk-space \
3183@@ -895,10 +898,9 @@
3184 "$OPT_DISK_PCT_FREE" \
3185 || break
3186
3187- sleep $(date +%s.%N | awk '{print 1 - ($1 % 1)}')
3188+ sleep $(date +'%s.%N' | awk "{print $OPT_SLEEP_COLLECT - (\$1 % $OPT_SLEEP_COLLECT)}")
3189 local ts="$(date +"TS %s.%N %F %T")"
3190
3191-
3192 if [ -d "/proc" ]; then
3193 if [ -f "/proc/diskstats" ]; then
3194 (echo $ts; cat /proc/diskstats) >> "$d/$p-diskstats" &
3195@@ -919,19 +921,17 @@
3196 (echo $ts; cat /proc/interrupts) >> "$d/$p-interrupts" &
3197 fi
3198 fi
3199-
3200 (echo $ts; df -k) >> "$d/$p-df" &
3201-
3202 (echo $ts; netstat -antp) >> "$d/$p-netstat" &
3203 (echo $ts; netstat -s) >> "$d/$p-netstat_s" &
3204-
3205 (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \
3206 >> "$d/$p-processlist" &
3207-
3208 if [ "$have_lock_waits_table" ]; then
3209 (echo $ts; lock_waits) >>"$d/$p-lock-waits" &
3210 (echo $ts; transactions) >>"$d/$p-transactions" &
3211 fi
3212+
3213+ curr_time=$(date +'%s')
3214 done
3215 log "Loop end: $(date +'TS %s.%N %F %T')"
3216
3217@@ -1996,6 +1996,14 @@
3218 It also prevents filling up the disk or gathering too much data to analyze
3219 reasonably.
3220
3221+=item --sleep-collect
3222+
3223+type: int; default: 1
3224+
3225+How long to sleep between collection loop cycles. This is useful with
3226+C<--no-stalk> to do long collections. For example, to collect data every
3227+minute for an hour, specify: C<--no-stalk --run-time 3600 --sleep-collect 60>.
3228+
3229 =item --socket
3230
3231 short form: -S; type: string
3232@@ -2185,7 +2193,7 @@
3233
3234 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3235
3236-This program is copyright 2011-2013 Percona Ireland Ltd,
3237+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
3238 2010-2011 Baron Schwartz.
3239
3240 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3241@@ -2204,7 +2212,7 @@
3242
3243 =head1 VERSION
3244
3245-pt-stalk 2.2.5
3246+pt-stalk 2.2.6
3247
3248 =cut
3249
3250
3251=== modified file 'bin/pt-summary'
3252--- bin/pt-summary 2013-10-20 03:45:04 +0000
3253+++ bin/pt-summary 2013-12-20 00:06:23 +0000
3254@@ -2671,7 +2671,7 @@
3255
3256 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3257
3258-This program is copyright 2011-2013 Percona Ireland Ltd,
3259+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
3260 2010-2011 Baron Schwartz.
3261
3262 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3263@@ -2690,7 +2690,7 @@
3264
3265 =head1 VERSION
3266
3267-pt-summary 2.2.5
3268+pt-summary 2.2.6
3269
3270 =cut
3271
3272
3273=== modified file 'bin/pt-table-checksum'
3274--- bin/pt-table-checksum 2013-11-08 01:47:46 +0000
3275+++ bin/pt-table-checksum 2013-12-20 00:06:23 +0000
3276@@ -57,7 +57,7 @@
3277 {
3278 package Percona::Toolkit;
3279
3280-our $VERSION = '2.2.5';
3281+our $VERSION = '2.2.6';
3282
3283 use strict;
3284 use warnings FATAL => 'all';
3285@@ -12562,7 +12562,7 @@
3286
3287 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3288
3289-This program is copyright 2011-2013 Percona Ireland Ltd,
3290+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
3291 2007-2011 Baron Schwartz.
3292
3293 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3294@@ -12581,6 +12581,6 @@
3295
3296 =head1 VERSION
3297
3298-pt-table-checksum 2.2.5
3299+pt-table-checksum 2.2.6
3300
3301 =cut
3302
3303=== modified file 'bin/pt-table-sync'
3304--- bin/pt-table-sync 2013-11-08 01:47:46 +0000
3305+++ bin/pt-table-sync 2013-12-20 00:06:23 +0000
3306@@ -55,7 +55,7 @@
3307 {
3308 package Percona::Toolkit;
3309
3310-our $VERSION = '2.2.5';
3311+our $VERSION = '2.2.6';
3312
3313 use strict;
3314 use warnings FATAL => 'all';
3315@@ -10943,6 +10943,27 @@
3316 }
3317 }
3318
3319+ my $replace = $o->get('replace')
3320+ || $o->get('replicate')
3321+ || $o->get('sync-to-master');
3322+ if ( $replace && $o->get('execute') && $o->get('check-child-tables') ) {
3323+ my $child_tables = find_child_tables(
3324+ tbl => $src,
3325+ dbh => $src->{dbh},
3326+ Quoter => $q,
3327+ );
3328+ if ( $child_tables ) {
3329+ foreach my $tbl ( @$child_tables ) {
3330+ my $ddl = $tp->get_create_table(
3331+ $src->{dbh}, $tbl->{db}, $tbl->{tbl});
3332+ if ( $ddl && $ddl =~ m/(ON (?:DELETE|UPDATE) (?:SET|CASCADE))/ ) {
3333+ my $fk = $1;
3334+ die "REPLACE statements on $src->{db}.$src->{tbl} can adversely affect child table $tbl->{name} because it has an $fk foreign key constraint. See --[no]check-child-tables in the documentation for more information. --check-child-tables error\n"
3335+ }
3336+ }
3337+ }
3338+ }
3339+
3340 return;
3341 }
3342
3343@@ -11363,6 +11384,46 @@
3344 }
3345 }
3346
3347+sub find_child_tables {
3348+ my ( %args ) = @_;
3349+ my @required_args = qw(tbl dbh Quoter);
3350+ foreach my $arg ( @required_args ) {
3351+ die "I need a $arg argument" unless $args{$arg};
3352+ }
3353+ my ($tbl, $dbh, $q) = @args{@required_args};
3354+
3355+ if ( lc($tbl->{tbl_struct}->{engine} || '') eq 'myisam' ) {
3356+ PTDEBUG && _d(q{MyISAM table, not looking for child tables});
3357+ return;
3358+ }
3359+
3360+ PTDEBUG && _d('Finding child tables');
3361+
3362+ my $sql = "SELECT table_schema, table_name "
3363+ . "FROM information_schema.key_column_usage "
3364+ . "WHERE constraint_schema='$tbl->{db}' "
3365+ . "AND referenced_table_name='$tbl->{tbl}'";
3366+ PTDEBUG && _d($sql);
3367+ my $rows = $dbh->selectall_arrayref($sql);
3368+ if ( !$rows || !@$rows ) {
3369+ PTDEBUG && _d('No child tables found');
3370+ return;
3371+ }
3372+
3373+ my @child_tables;
3374+ foreach my $row ( @$rows ) {
3375+ my $tbl = {
3376+ db => $row->[0],
3377+ tbl => $row->[1],
3378+ name => $q->quote(@$row),
3379+ };
3380+ push @child_tables, $tbl;
3381+ }
3382+
3383+ PTDEBUG && _d('Child tables:', Dumper(\@child_tables));
3384+ return \@child_tables;
3385+}
3386+
3387 sub _d {
3388 my ($package, undef, $line) = caller 0;
3389 @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
3390@@ -11589,7 +11650,7 @@
3391
3392 Also be careful with tables that have foreign key constraints with C<ON DELETE>
3393 or C<ON UPDATE> definitions because these might cause unintended changes on the
3394-child tables.
3395+child tables. See L<"--[no]check-child-tables">.
3396
3397 In general, this tool is best suited when your tables have a primary key or
3398 unique index. Although it can synchronize data in tables lacking a primary key
3399@@ -11875,6 +11936,31 @@
3400 binmode on STDOUT without the utf8 layer, and runs SET NAMES after
3401 connecting to MySQL.
3402
3403+=item --[no]check-child-tables
3404+
3405+default: yes
3406+
3407+Check if L<"--execute"> will adversely affect child tables. When
3408+L<"--replace">, L<"--replicate">, or L<"--sync-to-master"> is specified,
3409+the tool may sync tables using C<REPLACE> statements. If a table being
3410+synced has child tables with C<ON DELETE CASCADE>, C<ON UPDATE CASCADE>,
3411+or C<ON UPDATE SET NULL>, the tool prints an error and skips the table because
3412+C<REPLACE> becomes C<DELETE> then C<INSERT>, so the C<DELETE> will cascade
3413+to the child table and delete its rows. In the worst case, this can delete
3414+all rows in child tables!
3415+
3416+Specify C<--no-check-child-tables> to disable this check. To completely
3417+avoid affecting child tables, also specify C<--no-foreign-key-checks>
3418+so MySQL will not cascade any operations from the parent to child tables.
3419+
3420+This check is only preformed if L<"--execute"> and one of L<"--replace">,
3421+L<"--replicate">, or L<"--sync-to-master"> is specified. L<"--print">
3422+does not check child tables.
3423+
3424+The error message only prints the first child table found with an
3425+C<ON DELETE CASCADE>, C<ON UPDATE CASCADE>, or C<ON UPDATE SET NULL>
3426+foreign key constraint. There could be other affected child tables.
3427+
3428 =item --[no]check-master
3429
3430 default: yes
3431@@ -12681,7 +12767,7 @@
3432
3433 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3434
3435-This program is copyright 2011-2013 Percona Ireland Ltd,
3436+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
3437 2007-2011 Baron Schwartz.
3438
3439 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3440@@ -12700,6 +12786,6 @@
3441
3442 =head1 VERSION
3443
3444-pt-table-sync 2.2.5
3445+pt-table-sync 2.2.6
3446
3447 =cut
3448
3449=== modified file 'bin/pt-table-usage'
3450--- bin/pt-table-usage 2013-11-08 01:47:46 +0000
3451+++ bin/pt-table-usage 2013-12-20 00:06:23 +0000
3452@@ -7504,7 +7504,7 @@
3453
3454 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3455
3456-This program is copyright 2012-2013 Percona Ireland Ltd.
3457+This program is copyright 2012-2013 Percona LLC and/or its affiliates.
3458
3459 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3460 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
3461@@ -7522,6 +7522,6 @@
3462
3463 =head1 VERSION
3464
3465-pt-table-usage 2.2.5
3466+pt-table-usage 2.2.6
3467
3468 =cut
3469
3470=== modified file 'bin/pt-upgrade'
3471--- bin/pt-upgrade 2013-11-08 01:47:46 +0000
3472+++ bin/pt-upgrade 2013-12-20 00:06:23 +0000
3473@@ -61,7 +61,7 @@
3474 {
3475 package Percona::Toolkit;
3476
3477-our $VERSION = '2.2.5';
3478+our $VERSION = '2.2.6';
3479
3480 use strict;
3481 use warnings FATAL => 'all';
3482@@ -11208,7 +11208,7 @@
3483
3484 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3485
3486-This program is copyright 2009-2013 Percona Ireland Ltd.
3487+This program is copyright 2009-2013 Percona LLC and/or its affiliates.
3488 Feedback and improvements are welcome.
3489
3490 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3491@@ -11227,6 +11227,6 @@
3492
3493 =head1 VERSION
3494
3495-pt-upgrade 2.2.5
3496+pt-upgrade 2.2.6
3497
3498 =cut
3499
3500=== modified file 'bin/pt-variable-advisor'
3501--- bin/pt-variable-advisor 2013-11-08 01:47:46 +0000
3502+++ bin/pt-variable-advisor 2013-12-20 00:06:23 +0000
3503@@ -44,7 +44,7 @@
3504 {
3505 package Percona::Toolkit;
3506
3507-our $VERSION = '2.2.5';
3508+our $VERSION = '2.2.6';
3509
3510 use strict;
3511 use warnings FATAL => 'all';
3512@@ -6122,7 +6122,6 @@
3513
3514 Replace C<TOOL> with the name of any tool.
3515
3516-
3517 =head1 AUTHORS
3518
3519 Baron Schwartz and Daniel Nichter
3520@@ -6138,7 +6137,7 @@
3521
3522 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3523
3524-This program is copyright 2010-2013 Percona Ireland Ltd.
3525+This program is copyright 2010-2013 Percona LLC and/or its affiliates.
3526
3527 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3528 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
3529@@ -6156,6 +6155,6 @@
3530
3531 =head1 VERSION
3532
3533-pt-variable-advisor 2.2.5
3534+pt-variable-advisor 2.2.6
3535
3536 =cut
3537
3538=== modified file 'bin/pt-visual-explain'
3539--- bin/pt-visual-explain 2013-11-08 01:47:46 +0000
3540+++ bin/pt-visual-explain 2013-12-20 00:06:23 +0000
3541@@ -3224,7 +3224,7 @@
3542
3543 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3544
3545-This program is copyright 2011-2013 Percona Ireland Ltd,
3546+This program is copyright 2011-2013 Percona LLC and/or its affiliates,
3547 2007-2011 Baron Schwartz.
3548
3549 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3550@@ -3243,6 +3243,6 @@
3551
3552 =head1 VERSION
3553
3554-pt-visual-explain 2.2.5
3555+pt-visual-explain 2.2.6
3556
3557 =cut
3558
3559=== modified file 'config/deb/changelog'
3560--- config/deb/changelog 2013-10-22 05:56:20 +0000
3561+++ config/deb/changelog 2013-12-20 00:06:23 +0000
3562@@ -1,3 +1,29 @@
3563+percona-toolkit (2.2.6) unstable; urgency=low
3564+
3565+ * Added pt-query-digest support for Percona Server slow log rate limiting
3566+ * Added pt-agent --ping
3567+ * Added pt-mysql-summary --all-databases
3568+ * Added pt-stalk --sleep-collect
3569+ * Added pt-table-sync --[no]check-child-tables
3570+ * Fixed bug 1249150: PTDEBUG prints some info to STDOUT
3571+ * Fixed bug 1248363: pt-agent requires restart after changing MySQL options
3572+ * Fixed bug 1248778: pt-agent --install on PXC is not documented
3573+ * Fixed bug 1250973: pt-agent --install doesn't check for previous install
3574+ * Fixed bug 1250968: pt-agent --install suggest MySQL user isn't quoted
3575+ * Fixed bug 1251004: pt-agent --install error about slave is confusing
3576+ * Fixed bug 1251726: pt-agent --uninstall fails if agent is running
3577+ * Fixed bug 1248785: pt-agent docs don't list privs required for its MySQL user
3578+ * Fixed bug 1215016: pt-deadlock-logger docs use pt-fk-error-logger
3579+ * Fixed bug 1201443: pt-duplicate-key-checker error when EXPLAIN key_len=0
3580+ * Fixed bug 1217013: pt-duplicate-key-checker misses exact duplicate unique indexes
3581+ * Fixed bug 1214685: pt-mysql-summary schema dump prompt can't be disabled
3582+ * Fixed bug 1195628: pt-online-schema-change gets stuck looking for its own _new table
3583+ * Fixed bug 1249149: pt-query-digest stats prints to STDOUT instead of STDERR
3584+ * Fixed bug 1071979: pt-stak error parsing df with NFS
3585+ * Fixed bug 1223458: pt-table-sync deletes child table rows
3586+
3587+ -- Percona Toolkit Developers <toolkit-dev@percona.com> Wed, 18 Dec 2013 23:50:43 +0000
3588+
3589 percona-toolkit (2.2.5) unstable; urgency=low
3590
3591 * Added Query_time histogram bucket counts to pt-query-digest JSON output
3592
3593=== modified file 'config/sphinx-build/conf.py'
3594--- config/sphinx-build/conf.py 2013-10-20 03:45:04 +0000
3595+++ config/sphinx-build/conf.py 2013-12-20 00:06:23 +0000
3596@@ -41,7 +41,7 @@
3597
3598 # General information about the project.
3599 project = u'Percona Toolkit'
3600-copyright = u'2013, Percona Ireland Ltd'
3601+copyright = u'2013, Percona LLC and/or its affiliates'
3602
3603 # The version info for the project you're documenting, acts as replacement for
3604 # |version| and |release|, also used in various other places throughout the
3605@@ -50,7 +50,7 @@
3606 # The short X.Y version.
3607 version = '2.2'
3608 # The full version, including alpha/beta/rc tags.
3609-release = '2.2.5'
3610+release = '2.2.6'
3611
3612 # The language for content autogenerated by Sphinx. Refer to documentation
3613 # for a list of supported languages.
3614
3615=== modified file 'config/sphinx-build/percona-theme/layout.html'
3616--- config/sphinx-build/percona-theme/layout.html 2013-10-20 03:45:04 +0000
3617+++ config/sphinx-build/percona-theme/layout.html 2013-12-20 00:06:23 +0000
3618@@ -302,11 +302,12 @@
3619
3620 {%- block footer %}
3621
3622+ {@ footer_documentation_bugs @}
3623 <div class="file-bugs">
3624- This documentation is developed in Launchpad as part of the <a rel="nofollow" href="https://code.launchpad.net/percona-toolkit">Percona Toolkit source code</a>.<br/>
3625- If you spotted innacuracies, errors, don't understood it or you think something is missing or should be improved, please <a rel="nofollow" href="https://bugs.launchpad.net/percona-toolkit/+filebug?field.tags=doc&amp;field.comment=[In:Percona Toolkit Documentation]&amp;?field.tags=doc&amp;field.title=[DOC] ">file a bug</a>.
3626-
3627+ This documentation is developed in Launchpad as part of the <a rel="nofollow" href="https://code.launchpad.net/percona-toolkit">Percona Toolkit source code</a>.<br/>
3628+ For all document-related issues (typos, errors, confusion, etc.), please <a rel="nofollow" href="https://bugs.launchpad.net/percona-toolkit/+filebug?field.tags=docs&amp;field.comment=[In:Percona Toolkit Documentation]&amp;?field.tags=docs&amp;field.title=[DOC] ">file a bug</a>.
3629 </div>
3630+ {@ /footer_documentation_bugs @}
3631
3632 <div id="footer">
3633
3634@@ -319,7 +320,7 @@
3635 Call us: 1-888-316-9775 • <a href="http://www.percona.com/contact">Contact Us</a><br>
3636 MySQL and InnoDB are trademarks of Oracle Corp.<br>
3637 Proudly running <a href="http://www.percona.com/software/percona-server/">Percona Server<span id="recentServerVersion"></span></a><br>
3638- Copyright &copy; 2006-2013 Percona<br>
3639+ Copyright &copy; 2006-2013 Percona LLC and/or its affiliates<br>
3640 <a href="http://www.percona.com/about-us/policies/">Copyright, Trademark, and Privacy Policy</a> • <a href="http://www.percona.com/site_map/">Sitemap</a>
3641 <span class="inv"><!--[CDATA[</noindex-->]]&gt;</span>
3642 </div>
3643
3644=== modified file 'docs/percona-toolkit.pod'
3645--- docs/percona-toolkit.pod 2013-10-22 05:56:20 +0000
3646+++ docs/percona-toolkit.pod 2013-12-20 00:06:23 +0000
3647@@ -54,14 +54,10 @@
3648
3649 Find duplicate indexes and foreign keys on MySQL tables.
3650
3651-Find duplicate indexes and foreign keys on MySQL tables.
3652-
3653 =item pt-fifo-split
3654
3655 Split files and pipe lines to a fifo without really splitting.
3656
3657-Split files and pipe lines to a fifo without really splitting.
3658-
3659 =item pt-find
3660
3661 Find MySQL tables and execute actions, like GNU find.
3662@@ -118,8 +114,6 @@
3663
3664 Browses files created by pt-stalk.
3665
3666-Browses files created by pt-stalk.
3667-
3668 =item pt-slave-delay
3669
3670 Make a MySQL slave server lag behind its master.
3671@@ -549,7 +543,7 @@
3672
3673 =head1 COPYRIGHT, LICENSE, AND WARRANTY
3674
3675-Percona Toolkit is copyright 2011-2013 Percona Ireland Ltd and others.
3676+Percona Toolkit is copyright 2011-2013 Percona LLC and/or its affiliates, et al.
3677 See each program's documentation for complete copyright notices.
3678
3679 THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
3680@@ -568,6 +562,6 @@
3681
3682 =head1 VERSION
3683
3684-Percona Toolkit v2.2.5 released 2013-10-17
3685+Percona Toolkit v2.2.6 released 2013-12-18
3686
3687 =cut
3688
3689=== modified file 'docs/release_notes.rst'
3690--- docs/release_notes.rst 2013-10-22 05:56:20 +0000
3691+++ docs/release_notes.rst 2013-12-20 00:06:23 +0000
3692@@ -1,6 +1,64 @@
3693 Release Notes
3694 *************
3695
3696+v2.2.6 released 2013-12-18
3697+==========================
3698+
3699+Percona Toolkit 2.2.6 has been released. This release has 16 bug fixes and a few new features. One bug fix is very important, so 2.2 users are strongly encouraged to upgrade:
3700+
3701+* Fixed bug 1223458: pt-table-sync deletes child table rows
3702+
3703+Buried in the pt-table-sync docs is this warning:
3704+
3705+ Also be careful with tables that have foreign key constraints with C<ON DELETE>
3706+ or C<ON UPDATE> definitions because these might cause unintended changes on the
3707+ child tables.
3708+
3709+Until recently, either no one had this problem, or no one reported it, or no one realized that pt-table-sync caused it. In the worst case, pt-table-sync could delete all rows in child tables, which is quite surprising and bad. As of 2.2.6, pt-table-sync has option --[no]check-child-tables which is on by default. In cases were this "bug" can happen, pt-table-sync prints a warning and skips the table. Read the option's docs to learn more.
3710+
3711+Another good bug fix is:
3712+
3713+* Fixed bug 1217013: pt-duplicate-key-checker misses exact duplicate unique indexes
3714+
3715+After saying "pt-duplicate-key-checker hasn't had a bug in years" at enough conferences, users proved us wrong--thanks! The tool is better now.
3716+
3717+* Fixed bug 1195628: pt-online-schema-change gets stuck looking for its own _new table
3718+
3719+This was poor feedback from the tool more than a bug. There was a point in the tool where it waited forever for slaves to catch up, but it did this silently. Now the tool reports --progress while it's waiting and it reports which slaves, if any, it found and intends to check. In short: its feedback delivers a better user experience.
3720+
3721+Finally, this bug (more like a feature request/change) might be a backwards-incompatible change:
3722+
3723+* Fixed bug 1214685: pt-mysql-summary schema dump prompt can't be disabled
3724+
3725+The change is that pt-mysql-summary no longer prompts to dump and summarize schemas. To do this, you must specify --databases or, a new option, --all-databases. Several users said this behavior was better, so we made the change even though some might consider it a backwards-incompatible change.
3726+
3727+Percona Toolkit packages can be downloaded from http://www.percona.com/downloads/percona-toolkit/ or the Percona Software Repositories (http://www.percona.com/software/repositories/).
3728+
3729+Changelog
3730+---------
3731+
3732+* Added pt-query-digest support for Percona Server slow log rate limiting
3733+* Added pt-agent --ping
3734+* Added pt-mysql-summary --all-databases
3735+* Added pt-stalk --sleep-collect
3736+* Added pt-table-sync --[no]check-child-tables
3737+* Fixed bug 1249150: PTDEBUG prints some info to STDOUT
3738+* Fixed bug 1248363: pt-agent requires restart after changing MySQL options
3739+* Fixed bug 1248778: pt-agent --install on PXC is not documented
3740+* Fixed bug 1250973: pt-agent --install doesn't check for previous install
3741+* Fixed bug 1250968: pt-agent --install suggest MySQL user isn't quoted
3742+* Fixed bug 1251004: pt-agent --install error about slave is confusing
3743+* Fixed bug 1251726: pt-agent --uninstall fails if agent is running
3744+* Fixed bug 1248785: pt-agent docs don't list privs required for its MySQL user
3745+* Fixed bug 1215016: pt-deadlock-logger docs use pt-fk-error-logger
3746+* Fixed bug 1201443: pt-duplicate-key-checker error when EXPLAIN key_len=0
3747+* Fixed bug 1217013: pt-duplicate-key-checker misses exact duplicate unique indexes
3748+* Fixed bug 1214685: pt-mysql-summary schema dump prompt can't be disabled
3749+* Fixed bug 1195628: pt-online-schema-change gets stuck looking for its own _new table
3750+* Fixed bug 1249149: pt-query-digest stats prints to STDOUT instead of STDERR
3751+* Fixed bug 1071979: pt-stak error parsing df with NFS
3752+* Fixed bug 1223458: pt-table-sync deletes child table rows
3753+
3754 v2.2.5 released 2013-10-16
3755 ==========================
3756
3757
3758=== modified file 'lib/Cxn.pm'
3759--- lib/Cxn.pm 2013-06-17 06:23:11 +0000
3760+++ lib/Cxn.pm 2013-12-20 00:06:23 +0000
3761@@ -119,7 +119,7 @@
3762
3763 sub connect {
3764 my ( $self, %opts ) = @_;
3765- my $dsn = $self->{dsn};
3766+ my $dsn = $opts{dsn} || $self->{dsn};
3767 my $dp = $self->{DSNParser};
3768
3769 my $dbh = $self->{dbh};
3770@@ -139,6 +139,13 @@
3771 }
3772
3773 $dbh = $self->set_dbh($dbh);
3774+ if ( $opts{dsn} ) {
3775+ $self->{dsn} = $dsn;
3776+ $self->{dsn_name} = $dp->as_string($dsn, [qw(h P S)])
3777+ || $dp->as_string($dsn, [qw(F)])
3778+ || '';
3779+
3780+ }
3781 PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name});
3782 return $dbh;
3783 }
3784
3785=== modified file 'lib/DuplicateKeyFinder.pm'
3786--- lib/DuplicateKeyFinder.pm 2013-01-03 00:19:16 +0000
3787+++ lib/DuplicateKeyFinder.pm 2013-12-20 00:06:23 +0000
3788@@ -143,8 +143,6 @@
3789 push @dupes,
3790 $self->remove_prefix_duplicates(\@fulltext_keys, \@fulltext_keys, %args, exact_duplicates => 1);
3791
3792- # TODO: other structs
3793-
3794 # Remove clustered duplicates.
3795 my $clustered_key = $args{clustered_key} ? $keys{$args{clustered_key}}
3796 : undef;
3797@@ -314,7 +312,7 @@
3798 if ( substr($left_cols, 0, $right_len_cols)
3799 eq substr($right_cols, 0, $right_len_cols) ) {
3800
3801- # FULLTEXT keys, for example, are only duplicates if they
3802+ # UNIQUE and FULLTEXT indexes are only duplicates if they
3803 # are exact duplicates.
3804 if ( $args{exact_duplicates} && ($right_len_cols<$left_len_cols) ) {
3805 PTDEBUG && _d($right_name, 'not exact duplicate of', $left_name);
3806@@ -333,10 +331,10 @@
3807
3808 PTDEBUG && _d('Remove', $right_name);
3809 my $reason;
3810- if ( $right_keys->[$right_index]->{unconstrained} ) {
3811+ if ( my $type = $right_keys->[$right_index]->{unconstrained} ) {
3812 $reason .= "Uniqueness of $right_name ignored because "
3813 . $right_keys->[$right_index]->{constraining_key}->{name}
3814- . " is a stronger constraint\n";
3815+ . " is a $type constraint\n";
3816 }
3817 my $exact_dupe = $right_len_cols < $left_len_cols ? 0 : 1;
3818 $reason .= $right_name
3819@@ -454,14 +452,23 @@
3820 next unless $unique_key; # primary key may be undefined
3821 my $cols = $unique_key->{cols};
3822 if ( @$cols == 1 ) {
3823- PTDEBUG && _d($unique_key->{name},'defines unique column:',$cols->[0]);
3824- # Save only the first unique key for the unique col. If there
3825- # are others, then they are exact duplicates and will be removed
3826- # later when unique keys are compared to unique keys.
3827 if ( !exists $unique_cols{$cols->[0]} ) {
3828+ PTDEBUG && _d($unique_key->{name}, 'defines unique column:',
3829+ $cols->[0]);
3830 $unique_cols{$cols->[0]} = $unique_key;
3831 $unique_key->{unique_col} = 1;
3832 }
3833+ else {
3834+ # https://bugs.launchpad.net/percona-toolkit/+bug/1217013
3835+ # If two unique indexes are not exact, then they must be enforcing
3836+ # different uniqueness constraints. Else they're exact dupes
3837+ # so one can be treated as a non-unique and removed later
3838+ # when comparing unique to non-unique.
3839+ PTDEBUG && _d($unique_key->{name},
3840+ 'redundantly constrains unique column:', $cols->[0]);
3841+ $unique_key->{exact_dupe} = 1;
3842+ $unique_key->{constraining_key} = $unique_cols{$cols->[0]};
3843+ }
3844 }
3845 else {
3846 local $LIST_SEPARATOR = '-';
3847@@ -496,18 +503,25 @@
3848 }
3849 }
3850
3851- # And finally, unconstrain the redudantly unique sets found above by
3852+ # And finally, unconstrain the redundantly unique sets found above by
3853 # removing them from the list of unique keys and adding them to the
3854 # list of normal keys.
3855 for my $i ( 0..(scalar @$unique_keys-1) ) {
3856 if ( exists $unconstrain{$unique_keys->[$i]->{name}} ) {
3857- PTDEBUG && _d('Unconstraining', $unique_keys->[$i]->{name});
3858- $unique_keys->[$i]->{unconstrained} = 1;
3859+ PTDEBUG && _d('Unconstraining weak', $unique_keys->[$i]->{name});
3860+ $unique_keys->[$i]->{unconstrained} = 'stronger';
3861 $unique_keys->[$i]->{constraining_key}
3862 = $unconstrain{$unique_keys->[$i]->{name}};
3863 push @unconstrained_keys, $unique_keys->[$i];
3864 delete $unique_keys->[$i];
3865 }
3866+ elsif ( $unique_keys->[$i]->{exact_dupe} ) {
3867+ # https://bugs.launchpad.net/percona-toolkit/+bug/1217013
3868+ PTDEBUG && _d('Unconstraining dupe', $unique_keys->[$i]->{name});
3869+ $unique_keys->[$i]->{unconstrained} = 'duplicate';
3870+ push @unconstrained_keys, $unique_keys->[$i];
3871+ delete $unique_keys->[$i];
3872+ }
3873 }
3874
3875 PTDEBUG && _d('No more keys');
3876
3877=== modified file 'lib/JSONReportFormatter.pm'
3878--- lib/JSONReportFormatter.pm 2013-10-10 00:54:25 +0000
3879+++ lib/JSONReportFormatter.pm 2013-12-20 00:06:23 +0000
3880@@ -147,6 +147,25 @@
3881 $global_data->{queries_per_second} = $qps if $qps;
3882 $global_data->{concurrency} = $conc if $conc;
3883
3884+ if ( exists $results->{globals}->{rate_limit} ) {
3885+ my $rate_limit = $results->{globals}->{rate_limit}->{min} || '';
3886+ my ($type, $limit) = $rate_limit =~ m/^(\w+):(\d+)$/;
3887+ if ( $type && $limit ) {
3888+ $global_data->{rate_limit} = {
3889+ type => $type,
3890+ limit => int($limit),
3891+ };
3892+ }
3893+ else {
3894+ $global_data->{rate_limit}->{error} = "Invalid rate limit: $rate_limit";
3895+ }
3896+
3897+ if ( ($results->{globals}->{rate_limit}->{min} || '')
3898+ ne ($results->{globals}->{rate_limit}->{max} || '') ) {
3899+ $global_data->{rate_limit}->{diff} = 1;
3900+ }
3901+ }
3902+
3903 my %hidden_attrib = (
3904 arg => 1,
3905 fingerprint => 1,
3906
3907=== modified file 'lib/KeySize.pm'
3908--- lib/KeySize.pm 2013-01-03 00:19:16 +0000
3909+++ lib/KeySize.pm 2013-12-20 00:06:23 +0000
3910@@ -89,7 +89,7 @@
3911 # EXPLAIN rows will report only the rows that satisfy the query
3912 # using the key, but this is not what we want. We want total table rows.
3913 # In other words, we need an EXPLAIN type index, not ref or range.
3914- if ( scalar @cols == 1 ) {
3915+ if ( scalar(@cols) == 1 && !$args{only_eq} ) {
3916 push @where_cols, "$cols[0]<>1";
3917 }
3918 $sql .= join(' OR ', @where_cols);
3919@@ -113,6 +113,22 @@
3920 PTDEBUG && _d('MySQL chose key:', $chosen_key, 'len:', $key_len,
3921 'rows:', $rows);
3922
3923+ # https://bugs.launchpad.net/percona-toolkit/+bug/1201443
3924+ if ( $chosen_key && $key_len eq '0' ) {
3925+ if ( $args{recurse} ) {
3926+ $self->{error} = "key_len = 0 in EXPLAIN:\n"
3927+ . _explain_to_text($explain);
3928+ return;
3929+ }
3930+ else {
3931+ return $self->get_key_size(
3932+ %args,
3933+ only_eq => 1,
3934+ recurse => 1,
3935+ );
3936+ }
3937+ }
3938+
3939 my $key_size = 0;
3940 if ( $key_len && $rows ) {
3941 if ( $chosen_key =~ m/,/ && $key_len =~ m/,/ ) {
3942
3943=== modified file 'lib/Percona/Agent/Logger.pm'
3944--- lib/Percona/Agent/Logger.pm 2013-09-19 20:25:20 +0000
3945+++ lib/Percona/Agent/Logger.pm 2013-12-20 00:06:23 +0000
3946@@ -250,7 +250,7 @@
3947 sub debug {
3948 my $self = shift;
3949 return if $self->online_logging;
3950- return $self->_log(0, 'DEBUG', 1, @_);
3951+ return $self->_log(0, 'DEBUG', @_);
3952 }
3953
3954 sub info {
3955@@ -287,7 +287,7 @@
3956 }
3957
3958 sub _log {
3959- my ($self, $online, $level, $msg, $offline) = @_;
3960+ my ($self, $online, $level, $msg) = @_;
3961
3962 my $ts = ts(time, 1); # 1=UTC
3963 my $level_number = level_number($level);
3964
3965=== modified file 'lib/Percona/Toolkit.pm'
3966--- lib/Percona/Toolkit.pm 2013-10-22 05:56:20 +0000
3967+++ lib/Percona/Toolkit.pm 2013-12-20 00:06:23 +0000
3968@@ -19,7 +19,7 @@
3969 # ###########################################################################
3970 package Percona::Toolkit;
3971
3972-our $VERSION = '2.2.5';
3973+our $VERSION = '2.2.6';
3974
3975 use strict;
3976 use warnings FATAL => 'all';
3977
3978=== modified file 'lib/PerconaTest.pm'
3979--- lib/PerconaTest.pm 2013-10-10 19:21:39 +0000
3980+++ lib/PerconaTest.pm 2013-12-20 00:06:23 +0000
3981@@ -39,6 +39,7 @@
3982 use Time::HiRes qw(sleep time);
3983 use File::Temp qw(tempfile);
3984 use POSIX qw(signal_h);
3985+use Data::Dumper;
3986
3987 require Exporter;
3988 our @ISA = qw(Exporter);
3989
3990=== modified file 'lib/QueryReportFormatter.pm'
3991--- lib/QueryReportFormatter.pm 2013-06-17 06:23:11 +0000
3992+++ lib/QueryReportFormatter.pm 2013-12-20 00:06:23 +0000
3993@@ -272,6 +272,11 @@
3994 push @result, "# Time range: $time_range";
3995 }
3996
3997+ # Third line: rate limiting, if any
3998+ if ( $results->{globals}->{rate_limit} ) {
3999+ print "# Rate limits apply\n";
4000+ }
4001+
4002 # Global column headers
4003 push @result, $self->make_global_header();
4004
4005@@ -287,7 +292,6 @@
4006 NUM_ATTRIB:
4007 foreach my $attrib ( @{$attribs->{$type}} ) {
4008 next unless exists $results->{globals}->{$attrib};
4009-
4010 my $store = $results->{globals}->{$attrib};
4011 my $metrics = $ea->stats()->{globals}->{$attrib};
4012 my $func = $attrib =~ m/time|wait$/ ? \&micro_t : \&shorten;
4013@@ -684,7 +688,7 @@
4014 push @result,
4015 sprintf("# Scores: V/M = %.2f", $val->{variance_to_mean} );
4016
4017- # Last line before column headers: time range
4018+ # Time range
4019 if ( $val->{time_range} ) {
4020 push @result, "# Time range: $val->{time_range}";
4021 }
4022
4023=== modified file 'lib/bash/collect.sh'
4024--- lib/bash/collect.sh 2013-03-12 21:23:02 +0000
4025+++ lib/bash/collect.sh 2013-12-20 00:06:23 +0000
4026@@ -146,16 +146,17 @@
4027 if [ "$CMD_SYSCTL" ]; then
4028 $CMD_SYSCTL -a >> "$d/$p-sysctl" &
4029 fi
4030+ local cnt=$(($OPT_RUN_TIME / $OPT_SLEEP_COLLECT))
4031 if [ "$CMD_VMSTAT" ]; then
4032- $CMD_VMSTAT 1 $OPT_RUN_TIME >> "$d/$p-vmstat" &
4033+ $CMD_VMSTAT $OPT_SLEEP_COLLECT $cnt >> "$d/$p-vmstat" &
4034 $CMD_VMSTAT $OPT_RUN_TIME 2 >> "$d/$p-vmstat-overall" &
4035 fi
4036 if [ "$CMD_IOSTAT" ]; then
4037- $CMD_IOSTAT -dx 1 $OPT_RUN_TIME >> "$d/$p-iostat" &
4038+ $CMD_IOSTAT -dx $OPT_SLEEP_COLLECT $cnt >> "$d/$p-iostat" &
4039 $CMD_IOSTAT -dx $OPT_RUN_TIME 2 >> "$d/$p-iostat-overall" &
4040 fi
4041 if [ "$CMD_MPSTAT" ]; then
4042- $CMD_MPSTAT -P ALL 1 $OPT_RUN_TIME >> "$d/$p-mpstat" &
4043+ $CMD_MPSTAT -P ALL $OPT_SLEEP_COLLECT $cnt >> "$d/$p-mpstat" &
4044 $CMD_MPSTAT -P ALL $OPT_RUN_TIME 1 >> "$d/$p-mpstat-overall" &
4045 fi
4046
4047@@ -165,7 +166,7 @@
4048 # get and keep a connection to the database; in troubled times
4049 # the database tends to exceed max_connections, so reconnecting
4050 # in the loop tends not to work very well.
4051- $CMD_MYSQLADMIN $EXT_ARGV ext -i1 -c$OPT_RUN_TIME >>"$d/$p-mysqladmin" &
4052+ $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" &
4053 local mysqladmin_pid=$!
4054
4055 local have_lock_waits_table=""
4056@@ -178,7 +179,10 @@
4057 # This loop gathers data for the rest of the duration, and defines the time
4058 # of the whole job.
4059 log "Loop start: $(date +'TS %s.%N %F %T')"
4060- for loopno in $(_seq $OPT_RUN_TIME); do
4061+ local start_time=$(date +'%s')
4062+ local curr_time=$start_time
4063+ while [ $((curr_time - start_time)) -lt $OPT_RUN_TIME ]; do
4064+
4065 # We check the disk, but don't exit, because we need to stop jobs if we
4066 # need to exit.
4067 disk_space $d > $d/$p-disk-space
4068@@ -188,14 +192,14 @@
4069 "$OPT_DISK_PCT_FREE" \
4070 || break
4071
4072+ # Sleep between collect cycles.
4073 # Synchronize ourselves onto the clock tick, so the sleeps are 1-second
4074- sleep $(date +%s.%N | awk '{print 1 - ($1 % 1)}')
4075+ sleep $(date +'%s.%N' | awk "{print $OPT_SLEEP_COLLECT - (\$1 % $OPT_SLEEP_COLLECT)}")
4076 local ts="$(date +"TS %s.%N %F %T")"
4077
4078 # #####################################################################
4079 # Collect data for this cycle.
4080 # #####################################################################
4081-
4082 if [ -d "/proc" ]; then
4083 if [ -f "/proc/diskstats" ]; then
4084 (echo $ts; cat /proc/diskstats) >> "$d/$p-diskstats" &
4085@@ -216,19 +220,17 @@
4086 (echo $ts; cat /proc/interrupts) >> "$d/$p-interrupts" &
4087 fi
4088 fi
4089-
4090 (echo $ts; df -k) >> "$d/$p-df" &
4091-
4092 (echo $ts; netstat -antp) >> "$d/$p-netstat" &
4093 (echo $ts; netstat -s) >> "$d/$p-netstat_s" &
4094-
4095 (echo $ts; $CMD_MYSQL $EXT_ARGV -e "SHOW FULL PROCESSLIST\G") \
4096 >> "$d/$p-processlist" &
4097-
4098 if [ "$have_lock_waits_table" ]; then
4099 (echo $ts; lock_waits) >>"$d/$p-lock-waits" &
4100 (echo $ts; transactions) >>"$d/$p-transactions" &
4101 fi
4102+
4103+ curr_time=$(date +'%s')
4104 done
4105 log "Loop end: $(date +'TS %s.%N %F %T')"
4106
4107
4108=== modified file 'lib/bash/collect_mysql_info.sh'
4109--- lib/bash/collect_mysql_info.sh 2013-02-25 14:21:46 +0000
4110+++ lib/bash/collect_mysql_info.sh 2013-12-20 00:06:23 +0000
4111@@ -168,7 +168,7 @@
4112 $CMD_MYSQLDUMP $EXT_ARGV --no-data --skip-comments \
4113 --skip-add-locks --skip-add-drop-table --compact \
4114 --skip-lock-all-tables --skip-lock-tables --skip-set-charset \
4115- ${args} --databases $( local IFS=,; echo ${dbtodump})
4116+ ${args} --databases $(local IFS=,; echo ${dbtodump})
4117 }
4118
4119 # Returns a string with arguments to pass to mysqldump.
4120@@ -250,10 +250,11 @@
4121 echo "pt-summary-internal-Config_File_path $cnf_file" >> "$dir/mysql-variables"
4122 collect_internal_vars "$dir/mysqld-executables" >> "$dir/mysql-variables"
4123
4124- if [ -n "${OPT_DATABASES}" ]; then
4125- # "--dump-schemas passed in, dumping early"
4126- local trg_arg="$( get_mysqldump_args "$dir/mysql-variables" )"
4127- get_mysqldump_for "${trg_arg}" "${OPT_DATABASES}" > "$dir/mysqldump"
4128+ # mysqldump schemas
4129+ if [ "$OPT_DATABASES" -o "$OPT_ALL_DATABASES" ]; then
4130+ local trg_arg="$(get_mysqldump_args "$dir/mysql-variables")"
4131+ local dbs="${OPT_DATABASES:-""}"
4132+ get_mysqldump_for "${trg_arg}" "$dbs" > "$dir/mysqldump"
4133 fi
4134
4135 # TODO: gather this data in the same format as normal: TS line, stats
4136
4137=== modified file 'lib/bash/report_mysql_info.sh'
4138--- lib/bash/report_mysql_info.sh 2013-02-25 14:21:46 +0000
4139+++ lib/bash/report_mysql_info.sh 2013-12-20 00:06:23 +0000
4140@@ -1318,45 +1318,19 @@
4141 # Schema, databases, data type, other analysis.
4142 # ########################################################################
4143 section "Schema"
4144- # Assume "no" if stdin or stdout is not a terminal, so this can be run and
4145- # put into a file, or piped into a pager, or something else like that.
4146- local reply="n"
4147- # But dump no matter what if they passed in something through --databases,
4148- # OR if --read-samples was set
4149- if [ "${OPT_DATABASES}" ] || [ "${OPT_READ_SAMPLES}" ] \
4150- || [ -e "$dir/mysqldump" -a -s "$dir/mysqldump" ]; then
4151- reply="y"
4152- elif [ -t 0 -a -t 1 ]; then
4153- echo -n "Would you like to mysqldump -d the schema and analyze it? y/n "
4154- read reply
4155- reply=${reply:-n}
4156- fi
4157- if echo "${reply:-n}" | grep -i '^y' > /dev/null ; then
4158- if [ -z "${OPT_DATABASES}" ] && [ -z "$OPT_READ_SAMPLES" ] \
4159- && [ ! -e "$dir/mysqldump" ]; then
4160- # If --dump-schemas wasn't used, ask what they want to dump
4161- echo "There are ${num_dbs} databases. Would you like to dump all, or just one?"
4162- echo -n "Type the name of the database, or press Enter to dump all of them. "
4163- local dbtodump=""
4164- read dbtodump
4165- local trg_arg="$( get_mysqldump_args "$dir/mysql-variables" )"
4166- get_mysqldump_for "${trg_arg}" "${dbtodump}" > "$dir/mysqldump"
4167- fi
4168-
4169- # Test the result by checking the file, not by the exit status, because we
4170- # might get partway through and then die, and the info is worth analyzing
4171- # anyway.
4172- if [ -e "$dir/mysqldump" -a -s "$dir/mysqldump" ] \
4173- && grep 'CREATE TABLE' "$dir/mysqldump" >/dev/null 2>&1; then
4174- format_overall_db_stats "$dir/mysqldump"
4175- elif [ ! -e "$dir/mysqldump" -a "$OPT_READ_SAMPLES" ]; then
4176- echo "Skipping schema analysis as the directory passed in" \
4177- "doesn't have a dump file"
4178- else
4179- echo "Skipping schema analysis due to apparent error in dump file"
4180- fi
4181+ # Test the result by checking the file, not by the exit status, because we
4182+ # might get partway through and then die, and the info is worth analyzing
4183+ # anyway.
4184+ if [ -s "$dir/mysqldump" ] \
4185+ && grep 'CREATE TABLE' "$dir/mysqldump" >/dev/null 2>&1; then
4186+ format_overall_db_stats "$dir/mysqldump"
4187+ elif [ ! -e "$dir/mysqldump" -a "$OPT_READ_SAMPLES" ]; then
4188+ echo "Skipping schema analysis because --read-samples $dir/mysqldump " \
4189+ "does not exist"
4190+ elif [ -z "$OPT_DATABASES" -a -z "$OPT_ALL_DATABASES" ]; then
4191+ echo "Specify --databases or --all-databases to dump and summarize schemas"
4192 else
4193- echo "Skipping schema analysis"
4194+ echo "Skipping schema analysis due to apparent error in dump file"
4195 fi
4196
4197 # ########################################################################
4198
4199=== modified file 'lib/bash/safeguards.sh'
4200--- lib/bash/safeguards.sh 2012-02-24 18:11:07 +0000
4201+++ lib/bash/safeguards.sh 2013-12-20 00:06:23 +0000
4202@@ -50,10 +50,9 @@
4203 local bytes_margin="${4:-0}"
4204
4205 # Real/actual bytes used and bytes free.
4206-
4207- local used_bytes=$(perl -ane 'm!^/! && print $F[2] * 1024' "$file")
4208- local free_bytes=$(perl -ane 'm!^/! && print $F[3] * 1024' "$file")
4209- local pct_used=$(perl -ane 'm!^/! && print ($F[4] =~ m/(\d+)/)' "$file")
4210+ local used_bytes=$(tail -n 1 "$file" | perl -ane 'print $F[2] * 1024')
4211+ local free_bytes=$(tail -n 1 "$file" | perl -ane 'print $F[3] * 1024')
4212+ local pct_used=$(tail -n 1 "$file" | perl -ane 'print ($F[4] =~ m/(\d+)/)')
4213 local pct_free=$((100 - $pct_used))
4214
4215 # Report the real values to the user.
4216
4217=== modified file 't/lib/Cxn.t'
4218--- t/lib/Cxn.t 2013-03-02 20:10:28 +0000
4219+++ t/lib/Cxn.t 2013-12-20 00:06:23 +0000
4220@@ -24,6 +24,8 @@
4221 my $dp = new DSNParser(opts=>$dsn_opts);
4222 my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
4223 my $master_dbh = $sb->get_dbh_for('master');
4224+my $slave1_dbh = $sb->get_dbh_for('slave1');
4225+my $slave1_dsn = $sb->dsn_for('slave1');
4226
4227 if ( !$master_dbh ) {
4228 plan skip_all => 'Cannot connect to sandbox master';
4229@@ -320,6 +322,58 @@
4230 unlink $outfile if -f $outfile;
4231
4232 # #############################################################################
4233+# Re-connect with new DSN.
4234+# #############################################################################
4235+
4236+SKIP: {
4237+ skip "Cannot connect to slave1", 4 unless $slave1_dbh;
4238+
4239+ $cxn = make_cxn(
4240+ dsn_string => 'h=127.1,P=12345,u=msandbox,p=msandbox',
4241+ );
4242+
4243+ $cxn->connect();
4244+ ok(
4245+ $cxn->dbh()->ping(),
4246+ "First connect()"
4247+ );
4248+
4249+ ($row) = $cxn->dbh()->selectrow_hashref('SHOW SLAVE STATUS');
4250+ ok(
4251+ !defined $row,
4252+ "First connect() to master"
4253+ ) or diag(Dumper($row));
4254+
4255+ $cxn->dbh->disconnect();
4256+ $cxn->connect(dsn => $dp->parse($slave1_dsn));
4257+
4258+ ok(
4259+ $cxn->dbh()->ping(),
4260+ "Re-connect connect()"
4261+ );
4262+
4263+ ($row) = $cxn->dbh()->selectrow_hashref('SHOW SLAVE STATUS');
4264+ ok(
4265+ $row,
4266+ "Re-connect connect(slave_dsn) to slave"
4267+ ) or diag(Dumper($row));
4268+
4269+ $cxn->dbh->disconnect();
4270+ $cxn->connect();
4271+
4272+ ok(
4273+ $cxn->dbh()->ping(),
4274+ "Re-re-connect connect()"
4275+ );
4276+
4277+ ($row) = $cxn->dbh()->selectrow_hashref('SHOW SLAVE STATUS');
4278+ ok(
4279+ $row,
4280+ "Re-re-connect connect() to slave"
4281+ ) or diag(Dumper($row));
4282+}
4283+
4284+# #############################################################################
4285 # Done.
4286 # #############################################################################
4287 $master_dbh->disconnect() if $master_dbh;
4288
4289=== modified file 't/lib/DuplicateKeyFinder.t'
4290--- t/lib/DuplicateKeyFinder.t 2012-08-15 22:24:19 +0000
4291+++ t/lib/DuplicateKeyFinder.t 2013-12-20 00:06:23 +0000
4292@@ -10,6 +10,7 @@
4293 use warnings FATAL => 'all';
4294 use English qw(-no_match_vars);
4295 use Test::More;
4296+use Data::Dumper;
4297
4298 use VersionParser;
4299 use DuplicateKeyFinder;
4300@@ -756,7 +757,7 @@
4301 duplicate_of_cols => [ 'row_id' ],
4302 duplicate_of_ddl => 'PRIMARY KEY (`row_id`),',
4303 key => 'row_id',
4304- reason => 'row_id is a duplicate of PRIMARY',
4305+ reason => "Uniqueness of row_id ignored because PRIMARY is a duplicate constraint\nrow_id is a duplicate of PRIMARY",
4306 },
4307 {
4308 cols => [ 'player_id' ],
4309@@ -773,6 +774,65 @@
4310 );
4311
4312 # #############################################################################
4313+# https://bugs.launchpad.net/percona-toolkit/+bug/1214114
4314+# #############################################################################
4315+#$ddl = load_file('t/lib/samples/dupekeys/prefix_bug_1214114.sql');
4316+#$dupes = [];
4317+#($keys, $ck) = $tp->get_keys($ddl, $opt);
4318+#$dk->get_duplicate_keys(
4319+# $keys,
4320+# clustered_key => $ck,
4321+# clustered => 1,
4322+# callback => $callback,
4323+# tbl_info => { engine => 'InnoDB', ddl => $ddl },
4324+#);
4325+#
4326+#is_deeply(
4327+# $dupes,
4328+# [{
4329+# cols => ['b', 'id'],
4330+# ddl => 'KEY `b` (`b`,`id`)',
4331+# dupe_type => 'clustered',
4332+# duplicate_of => 'PRIMARY',
4333+# duplicate_of_cols => ['id'],
4334+# duplicate_of_ddl => 'PRIMARY KEY (`id`),',
4335+# key => 'b',
4336+# reason => 'Key b ends with a prefix of the clustered index',
4337+# short_key => '`b`',
4338+# }],
4339+# "Prefix bug 1214114"
4340+#) or diag(Dumper($dupes));
4341+
4342+# #############################################################################
4343+# https://bugs.launchpad.net/percona-toolkit/+bug/1217013
4344+ #############################################################################
4345+$ddl = load_file('t/lib/samples/dupekeys/simple_dupe_bug_1217013.sql');
4346+$dupes = [];
4347+($keys, $ck) = $tp->get_keys($ddl, $opt);
4348+$dk->get_duplicate_keys(
4349+ $keys,
4350+ clustered_key => $ck,
4351+ clustered => 1,
4352+ callback => $callback,
4353+ tbl_info => { engine => 'InnoDB', ddl => $ddl },
4354+);
4355+
4356+is_deeply(
4357+ $dupes,
4358+ [{
4359+ cols => ['domain'],
4360+ ddl => 'UNIQUE KEY `domain` (`domain`),',
4361+ dupe_type => 'exact',
4362+ duplicate_of => 'unique_key_domain',
4363+ duplicate_of_cols => ['domain'],
4364+ duplicate_of_ddl => 'UNIQUE KEY `unique_key_domain` (`domain`)',
4365+ key => 'domain',
4366+ reason => "Uniqueness of domain ignored because unique_key_domain is a duplicate constraint\ndomain is a duplicate of unique_key_domain",
4367+ }],
4368+ "Exact dupe uniques (bug 1217013)"
4369+) or diag(Dumper($dupes));
4370+
4371+# #############################################################################
4372 # Done.
4373 # #############################################################################
4374 my $output = '';
4375@@ -787,4 +847,3 @@
4376 '_d() works'
4377 );
4378 done_testing;
4379-exit;
4380
4381=== modified file 't/lib/KeySize.t'
4382--- t/lib/KeySize.t 2013-03-03 15:31:17 +0000
4383+++ t/lib/KeySize.t 2013-12-20 00:06:23 +0000
4384@@ -25,9 +25,6 @@
4385 if ( !$dbh ) {
4386 plan skip_all => "Cannot connect to sandbox master";
4387 }
4388-else {
4389- plan tests => 19;
4390-}
4391
4392 my $q = new Quoter();
4393 my $tp = new TableParser(Quoter => $q);
4394@@ -191,6 +188,107 @@
4395 );
4396
4397 # #############################################################################
4398+# https://bugs.launchpad.net/percona-toolkit/+bug/1201443
4399+# #############################################################################
4400+$sb->load_file('master', "t/pt-duplicate-key-checker/samples/fk_chosen_index_bug_1201443.sql");
4401+
4402+($size, $chosen_key) = $ks->get_key_size(
4403+ name => 'child_ibfk_2',
4404+ cols => [qw(parent_id)],
4405+ tbl_name => 'fk_chosen_index_bug_1201443.child',
4406+ tbl_struct => {
4407+ charset => 'latin1',
4408+ clustered_key => undef,
4409+ col_posn => {
4410+ id => 0,
4411+ parent_id => 1
4412+ },
4413+ cols => [
4414+ 'id',
4415+ 'parent_id'
4416+ ],
4417+ defs => {
4418+ id => ' `id` int(11) NOT NULL AUTO_INCREMENT',
4419+ parent_id => ' `parent_id` int(11) NOT NULL'
4420+ },
4421+ engine => 'InnoDB',
4422+ is_autoinc => {
4423+ id => 1,
4424+ parent_id => 0
4425+ },
4426+ is_col => {
4427+ id => 1,
4428+ parent_id => 1
4429+ },
4430+ is_nullable => {},
4431+ is_numeric => {
4432+ id => 1,
4433+ parent_id => 1
4434+ },
4435+ keys => {
4436+ id => {
4437+ col_prefixes => [
4438+ undef
4439+ ],
4440+ colnames => '`id`',
4441+ cols => [
4442+ 'id'
4443+ ],
4444+ ddl => 'KEY `id` (`id`),',
4445+ is_col => {
4446+ id => 1
4447+ },
4448+ is_nullable => 0,
4449+ is_unique => 0,
4450+ name => 'id',
4451+ type => 'BTREE'
4452+ },
4453+ parent_id => {
4454+ col_prefixes => [
4455+ undef
4456+ ],
4457+ colnames => '`parent_id`',
4458+ cols => [
4459+ 'parent_id'
4460+ ],
4461+ ddl => 'KEY `parent_id` (`parent_id`),',
4462+ is_col => {
4463+ parent_id => 1
4464+ },
4465+ is_nullable => 0,
4466+ is_unique => 0,
4467+ name => 'parent_id',
4468+ type => 'BTREE'
4469+ }
4470+ },
4471+ name => 'child',
4472+ null_cols => [],
4473+ numeric_cols => [
4474+ 'id',
4475+ 'parent_id'
4476+ ],
4477+ type_for => {
4478+ id => 'int',
4479+ parent_id => 'int'
4480+ }
4481+ },
4482+ dbh => $dbh,
4483+);
4484+
4485+cmp_ok(
4486+ $size,
4487+ '>',
4488+ 15_000, # estimages range from 15k to 30k
4489+ "Bug 1201443: size"
4490+);
4491+
4492+is(
4493+ $chosen_key,
4494+ 'parent_id',
4495+ "Bug 1201443: chosen key"
4496+);
4497+
4498+# #############################################################################
4499 # Done.
4500 # #############################################################################
4501 $output = '';
4502@@ -206,4 +304,4 @@
4503 );
4504 $sb->wipe_clean($dbh);
4505 ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
4506-exit;
4507+done_testing;
4508
4509=== modified file 't/lib/bash/report_mysql_info.sh'
4510--- t/lib/bash/report_mysql_info.sh 2012-12-06 00:10:22 +0000
4511+++ t/lib/bash/report_mysql_info.sh 2013-12-20 00:06:23 +0000
4512@@ -715,6 +715,7 @@
4513 OPT_SLEEP=1
4514 OPT_DATABASES=""
4515 OPT_READ_SAMPLES=""
4516+OPT_ALL_DATABASES=""
4517 NAME_VAL_LEN=25
4518 report_mysql_summary "$samples/tempdir" | tail -n+3 > "$PT_TMPDIR/got"
4519 no_diff "$PT_TMPDIR/got" "$samples/expected_result_report_summary.txt"
4520
4521=== modified file 't/lib/bash/safeguards.sh'
4522--- t/lib/bash/safeguards.sh 2012-06-11 20:51:43 +0000
4523+++ t/lib/bash/safeguards.sh 2013-12-20 00:06:23 +0000
4524@@ -65,6 +65,14 @@
4525 "grep -q 'Actual:[ ]*19% free,' $PT_TMPDIR/out" \
4526 "Calculates % free with margin"
4527
4528+# #############################################################################
4529+# NFS
4530+# https://bugs.launchpad.net/percona-toolkit/+bug/1071979
4531+# #############################################################################
4532+
4533+check_disk_space "$SAMPLE/diskspace002.txt" 104857600 5 20971520
4534+is "$?" "0" "df with NFS (bug 1071979)"
4535+
4536 # ###########################################################################
4537 # Done
4538 # ###########################################################################
4539
4540=== added file 't/lib/samples/bash/diskspace002.txt'
4541--- t/lib/samples/bash/diskspace002.txt 1970-01-01 00:00:00 +0000
4542+++ t/lib/samples/bash/diskspace002.txt 2013-12-20 00:06:23 +0000
4543@@ -0,0 +1,2 @@
4544+Filesystem 1024-blocks Used Available Capacity Mounted on
4545+10.10.10.1:/vol/data_logs_01 498073600 235646464 262427136 48% /var/log
4546
4547=== added file 't/lib/samples/dupekeys/prefix_bug_1214114.sql'
4548--- t/lib/samples/dupekeys/prefix_bug_1214114.sql 1970-01-01 00:00:00 +0000
4549+++ t/lib/samples/dupekeys/prefix_bug_1214114.sql 2013-12-20 00:06:23 +0000
4550@@ -0,0 +1,7 @@
4551+CREATE TABLE `t` (
4552+ `id` int(11) NOT NULL AUTO_INCREMENT,
4553+ `a` varchar(200) DEFAULT NULL,
4554+ `b` decimal(22,0) NOT NULL,
4555+ PRIMARY KEY (`id`),
4556+ KEY `b` (`b`,`id`)
4557+) ENGINE=InnoDB DEFAULT CHARSET=latin1
4558
4559=== added file 't/lib/samples/dupekeys/simple_dupe_bug_1217013.sql'
4560--- t/lib/samples/dupekeys/simple_dupe_bug_1217013.sql 1970-01-01 00:00:00 +0000
4561+++ t/lib/samples/dupekeys/simple_dupe_bug_1217013.sql 2013-12-20 00:06:23 +0000
4562@@ -0,0 +1,7 @@
4563+CREATE TABLE `domains` (
4564+ `id` bigint(20) NOT NULL,
4565+ `domain` varchar(175) COLLATE utf8_bin NOT NULL,
4566+ PRIMARY KEY (`id`),
4567+ UNIQUE KEY `domain` (`domain`),
4568+ UNIQUE KEY `unique_key_domain` (`domain`)
4569+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
4570
4571=== added file 't/lib/samples/slowlogs/slow059.txt'
4572--- t/lib/samples/slowlogs/slow059.txt 1970-01-01 00:00:00 +0000
4573+++ t/lib/samples/slowlogs/slow059.txt 2013-12-20 00:06:23 +0000
4574@@ -0,0 +1,40 @@
4575+# Time: 131128 1:05:31
4576+# User@Host: user1[user1] @ localhost [127.0.0.1] Id: 69194
4577+# Schema: maindb Last_errno: 0 Killed: 0
4578+# Query_time: 0.000228 Lock_time: 0.000114 Rows_sent: 1 Rows_examined: 1 Rows_affected: 0
4579+# Bytes_sent: 545 Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0
4580+# InnoDB_trx_id: 1A88583F
4581+# QC_Hit: No Full_scan: No Full_join: No Tmp_table: No Tmp_table_on_disk: No
4582+# Filesort: No Filesort_on_disk: No Merge_passes: 0
4583+# InnoDB_IO_r_ops: 0 InnoDB_IO_r_bytes: 0 InnoDB_IO_r_wait: 0.000000
4584+# InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000
4585+# InnoDB_pages_distinct: 2
4586+# Log_slow_rate_type: query Log_slow_rate_limit: 2
4587+SET timestamp=1385600731;
4588+SELECT foo FROM bar WHERE id=1;
4589+# User@Host: user1[user1] @ localhost [127.0.0.1] Id: 69195
4590+# Schema: maindb Last_errno: 0 Killed: 0
4591+# Query_time: 0.000237 Lock_time: 0.000122 Rows_sent: 1 Rows_examined: 1 Rows_affected: 0
4592+# Bytes_sent: 545 Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0
4593+# InnoDB_trx_id: 1A885840
4594+# QC_Hit: No Full_scan: No Full_join: No Tmp_table: No Tmp_table_on_disk: No
4595+# Filesort: No Filesort_on_disk: No Merge_passes: 0
4596+# InnoDB_IO_r_ops: 0 InnoDB_IO_r_bytes: 0 InnoDB_IO_r_wait: 0.000000
4597+# InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000
4598+# InnoDB_pages_distinct: 2
4599+# Log_slow_rate_type: query Log_slow_rate_limit: 2
4600+SET timestamp=1385600731;
4601+SELECT foo FROM bar WHERE id=2;
4602+# User@Host: user1[user1] @ localhost [127.0.0.1] Id: 69195
4603+# Schema: maindb Last_errno: 0 Killed: 0
4604+# Query_time: 0.000165 Lock_time: 0.000048 Rows_sent: 5 Rows_examined: 10 Rows_affected: 0
4605+# Bytes_sent: 481 Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0
4606+# InnoDB_trx_id: 1A885842
4607+# QC_Hit: No Full_scan: No Full_join: No Tmp_table: No Tmp_table_on_disk: No
4608+# Filesort: Yes Filesort_on_disk: No Merge_passes: 0
4609+# InnoDB_IO_r_ops: 0 InnoDB_IO_r_bytes: 0 InnoDB_IO_r_wait: 0.000000
4610+# InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000
4611+# InnoDB_pages_distinct: 3
4612+# Log_slow_rate_type: query Log_slow_rate_limit: 2
4613+SET timestamp=1385600731;
4614+INSERT INTO foo VALUES (NULL, 3);
4615
4616=== modified file 't/pt-agent/samples/query-history/data001.json'
4617--- t/pt-agent/samples/query-history/data001.json 2013-09-18 21:05:48 +0000
4618+++ t/pt-agent/samples/query-history/data001.json 2013-12-20 00:06:23 +0000
4619@@ -6,6 +6,7 @@
4620 "checksum" : "C72BF45D68E35A6E",
4621 "distillate" : "SELECT tbl",
4622 "example" : {
4623+ "Query_time" : "0.018799",
4624 "query" : "SELECT MIN(id),MAX(id) FROM tbl",
4625 "ts" : null
4626 },
4627
4628=== modified file 't/pt-agent/samples/query-history/data001.send'
4629--- t/pt-agent/samples/query-history/data001.send 2013-09-18 22:59:30 +0000
4630+++ t/pt-agent/samples/query-history/data001.send 2013-12-20 00:06:23 +0000
4631@@ -19,6 +19,7 @@
4632 "checksum" : "C72BF45D68E35A6E",
4633 "distillate" : "SELECT tbl",
4634 "example" : {
4635+ "Query_time" : "0.018799",
4636 "query" : "SELECT MIN(id),MAX(id) FROM tbl",
4637 "ts" : null
4638 },
4639
4640=== modified file 't/pt-duplicate-key-checker/basics.t'
4641--- t/pt-duplicate-key-checker/basics.t 2012-07-19 21:33:27 +0000
4642+++ t/pt-duplicate-key-checker/basics.t 2013-12-20 00:06:23 +0000
4643@@ -22,9 +22,6 @@
4644 if ( !$dbh ) {
4645 plan skip_all => 'Cannot connect to sandbox master';
4646 }
4647-else {
4648- plan tests => 13;
4649-}
4650
4651 my $output;
4652 my $sample = "t/pt-duplicate-key-checker/samples/";
4653@@ -137,8 +134,22 @@
4654 );
4655
4656 # #############################################################################
4657+# Exact unique dupes
4658+# https://bugs.launchpad.net/percona-toolkit/+bug/1217013
4659+# #############################################################################
4660+
4661+$sb->load_file('master', 't/lib/samples/dupekeys/simple_dupe_bug_1217013.sql', 'test');
4662+
4663+ok(
4664+ no_diff(
4665+ sub { pt_duplicate_key_checker::main(@args, qw(-t test.domains)) },
4666+ "$sample/simple_dupe_bug_1217013.txt"),
4667+ 'Exact unique dupes (bug 1217013)'
4668+) or diag($test_diff);
4669+
4670+# #############################################################################
4671 # Done.
4672 # #############################################################################
4673 $sb->wipe_clean($dbh);
4674 ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
4675-exit;
4676+done_testing;
4677
4678=== modified file 't/pt-duplicate-key-checker/clustered_keys.t'
4679--- t/pt-duplicate-key-checker/clustered_keys.t 2012-08-15 22:24:19 +0000
4680+++ t/pt-duplicate-key-checker/clustered_keys.t 2013-12-20 00:06:23 +0000
4681@@ -41,7 +41,7 @@
4682 : "$sample/issue_295.txt")
4683 ),
4684 "Shorten, not remove, clustered dupes"
4685-);
4686+) or diag($test_diff);
4687
4688 # #############################################################################
4689 # Error if InnoDB table has no PK or unique indexes
4690@@ -81,9 +81,22 @@
4691 );
4692
4693 # #############################################################################
4694+#
4695+# https://bugs.launchpad.net/percona-toolkit/+bug/1201443
4696+# #############################################################################
4697+$sb->load_file('master', "t/pt-duplicate-key-checker/samples/fk_chosen_index_bug_1201443.sql");
4698+
4699+$output = `$trunk/bin/pt-duplicate-key-checker F=$cnf -d fk_chosen_index_bug_1201443 2>&1`;
4700+
4701+unlike(
4702+ $output,
4703+ qr/Use of uninitialized value/,
4704+ 'fk_chosen_index_bug_1201443'
4705+);
4706+
4707+# #############################################################################
4708 # Done.
4709 # #############################################################################
4710 $sb->wipe_clean($dbh);
4711 ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
4712 done_testing;
4713-exit;
4714
4715=== modified file 't/pt-duplicate-key-checker/samples/bug-894140.txt'
4716--- t/pt-duplicate-key-checker/samples/bug-894140.txt 2012-06-05 01:46:35 +0000
4717+++ t/pt-duplicate-key-checker/samples/bug-894140.txt 2013-12-20 00:06:23 +0000
4718@@ -2,6 +2,7 @@
4719 # test.bug_894140
4720 # ########################################################################
4721
4722+# Uniqueness of row_id ignored because PRIMARY is a duplicate constraint
4723 # row_id is a duplicate of PRIMARY
4724 # Key definitions:
4725 # UNIQUE KEY `row_id` (`row_id`),
4726
4727=== added file 't/pt-duplicate-key-checker/samples/fk_chosen_index_bug_1201443.sql'
4728--- t/pt-duplicate-key-checker/samples/fk_chosen_index_bug_1201443.sql 1970-01-01 00:00:00 +0000
4729+++ t/pt-duplicate-key-checker/samples/fk_chosen_index_bug_1201443.sql 2013-12-20 00:06:23 +0000
4730@@ -0,0 +1,21 @@
4731+DROP DATABASE IF EXISTS fk_chosen_index_bug_1201443;
4732+CREATE DATABASE fk_chosen_index_bug_1201443;
4733+USE fk_chosen_index_bug_1201443;
4734+
4735+CREATE TABLE `parent` (
4736+ `id` int(11) NOT NULL AUTO_INCREMENT,
4737+ PRIMARY KEY (`id`)
4738+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
4739+
4740+CREATE TABLE `child` (
4741+ `id` int(11) NOT NULL AUTO_INCREMENT,
4742+ `parent_id` int(11) NOT NULL,
4743+ KEY `id` (`id`),
4744+ KEY `parent_id` (`parent_id`),
4745+ CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`),
4746+ CONSTRAINT `child_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`)
4747+) ENGINE=InnoDB AUTO_INCREMENT=50000 DEFAULT CHARSET=latin1;
4748+
4749+INSERT INTO `parent` (`id`) VALUES (1);
4750+
4751+INSERT INTO `child` (`id`, `parent_id`) VALUES (40001,1),(40002,1),(40003,1),(40004,1),(40005,1),(40006,1),(40007,1),(40008,1),(40009,1),(40010,1),(40011,1),(40012,1),(40013,1),(40014,1),(40015,1),(40016,1),(40017,1),(40018,1),(40019,1),(40020,1),(40021,1),(40022,1),(40023,1),(40024,1),(40025,1),(40026,1),(40027,1),(40028,1),(40029,1),(40030,1),(40031,1),(40032,1),(40033,1),(40034,1),(40035,1),(40036,1),(40037,1),(40038,1),(40039,1),(40040,1),(40041,1),(40042,1),(40043,1),(40044,1),(40045,1),(40046,1),(40047,1),(40048,1),(40049,1),(40050,1),(40051,1),(40052,1),(40053,1),(40054,1),(40055,1),(40056,1),(40057,1),(40058,1),(40059,1),(40060,1),(40061,1),(40062,1),(40063,1),(40064,1),(40065,1),(40066,1),(40067,1),(40068,1),(40069,1),(40070,1),(40071,1),(40072,1),(40073,1),(40074,1),(40075,1),(40076,1),(40077,1),(40078,1),(40079,1),(40080,1),(40081,1),(40082,1),(40083,1),(40084,1),(40085,1),(40086,1),(40087,1),(40088,1),(40089,1),(40090,1),(40091,1),(40092,1),(40093,1),(40094,1),(40095,1),(40096,1),(40097,1),(40098,1),(40099,1),(40100,1),(40101,1),(40102,1),(40103,1),(40104,1),(40105,1),(40106,1),(40107,1),(40108,1),(40109,1),(40110,1),(40111,1),(40112,1),(40113,1),(40114,1),(40115,1),(40116,1),(40117,1),(40118,1),(40119,1),(40120,1),(40121,1),(40122,1),(40123,1),(40124,1),(40125,1),(40126,1),(40127,1),(40128,1),(40129,1),(40130,1),(40131,1),(40132,1),(40133,1),(40134,1),(40135,1),(40136,1),(40137,1),(40138,1),(40139,1),(40140,1),(40141,1),(40142,1),(40143,1),(40144,1),(40145,1),(40146,1),(40147,1),(40148,1),(40149,1),(40150,1),(40151,1),(40152,1),(40153,1),(40154,1),(40155,1),(40156,1),(40157,1),(40158,1),(40159,1),(40160,1),(40161,1),(40162,1),(40163,1),(40164,1),(40165,1),(40166,1),(40167,1),(40168,1),(40169,1),(40170,1),(40171,1),(40172,1),(40173,1),(40174,1),(40175,1),(40176,1),(40177,1),(40178,1),(40179,1),(40180,1),(40181,1),(40182,1),(40183,1),(40184,1),(40185,1),(40186,1),(40187,1),(40188,1),(40189,1),(40190,1),(40191,1),(40192,1),(40193,1),(40194,1),(40195,1),(40196,1),(40197,1),(40198,1),(40199,1),(40200,1),(40201,1),(40202,1),(40203,1),(40204,1),(40205,1),(40206,1),(40207,1),(40208,1),(40209,1),(40210,1),(40211,1),(40212,1),(40213,1),(40214,1),(40215,1),(40216,1),(40217,1),(40218,1),(40219,1),(40220,1),(40221,1),(40222,1),(40223,1),(40224,1),(40225,1),(40226,1),(40227,1),(40228,1),(40229,1),(40230,1),(40231,1),(40232,1),(40233,1),(40234,1),(40235,1),(40236,1),(40237,1),(40238,1),(40239,1),(40240,1),(40241,1),(40242,1),(40243,1),(40244,1),(40245,1),(40246,1),(40247,1),(40248,1),(40249,1),(40250,1),(40251,1),(40252,1),(40253,1),(40254,1),(40255,1),(40256,1),(40257,1),(40258,1),(40259,1),(40260,1),(40261,1),(40262,1),(40263,1),(40264,1),(40265,1),(40266,1),(40267,1),(40268,1),(40269,1),(40270,1),(40271,1),(40272,1),(40273,1),(40274,1),(40275,1),(40276,1),(40277,1),(40278,1),(40279,1),(40280,1),(40281,1),(40282,1),(40283,1),(40284,1),(40285,1),(40286,1),(40287,1),(40288,1),(40289,1),(40290,1),(40291,1),(40292,1),(40293,1),(40294,1),(40295,1),(40296,1),(40297,1),(40298,1),(40299,1),(40300,1),(40301,1),(40302,1),(40303,1),(40304,1),(40305,1),(40306,1),(40307,1),(40308,1),(40309,1),(40310,1),(40311,1),(40312,1),(40313,1),(40314,1),(40315,1),(40316,1),(40317,1),(40318,1),(40319,1),(40320,1),(40321,1),(40322,1),(40323,1),(40324,1),(40325,1),(40326,1),(40327,1),(40328,1),(40329,1),(40330,1),(40331,1),(40332,1),(40333,1),(40334,1),(40335,1),(40336,1),(40337,1),(40338,1),(40339,1),(40340,1),(40341,1),(40342,1),(40343,1),(40344,1),(40345,1),(40346,1),(40347,1),(40348,1),(40349,1),(40350,1),(40351,1),(40352,1),(40353,1),(40354,1),(40355,1),(40356,1),(40357,1),(40358,1),(40359,1),(40360,1),(40361,1),(40362,1),(40363,1),(40364,1),(40365,1),(40366,1),(40367,1),(40368,1),(40369,1),(40370,1),(40371,1),(40372,1),(40373,1),(40374,1),(40375,1),(40376,1),(40377,1),(40378,1),(40379,1),(40380,1),(40381,1),(40382,1),(40383,1),(40384,1),(40385,1),(40386,1),(40387,1),(40388,1),(40389,1),(40390,1),(40391,1),(40392,1),(40393,1),(40394,1),(40395,1),(40396,1),(40397,1),(40398,1),(40399,1),(40400,1),(40401,1),(40402,1),(40403,1),(40404,1),(40405,1),(40406,1),(40407,1),(40408,1),(40409,1),(40410,1),(40411,1),(40412,1),(40413,1),(40414,1),(40415,1),(40416,1),(40417,1),(40418,1),(40419,1),(40420,1),(40421,1),(40422,1),(40423,1),(40424,1),(40425,1),(40426,1),(40427,1),(40428,1),(40429,1),(40430,1),(40431,1),(40432,1),(40433,1),(40434,1),(40435,1),(40436,1),(40437,1),(40438,1),(40439,1),(40440,1),(40441,1),(40442,1),(40443,1),(40444,1),(40445,1),(40446,1),(40447,1),(40448,1),(40449,1),(40450,1),(40451,1),(40452,1),(40453,1),(40454,1),(40455,1),(40456,1),(40457,1),(40458,1),(40459,1),(40460,1),(40461,1),(40462,1),(40463,1),(40464,1),(40465,1),(40466,1),(40467,1),(40468,1),(40469,1),(40470,1),(40471,1),(40472,1),(40473,1),(40474,1),(40475,1),(40476,1),(40477,1),(40478,1),(40479,1),(40480,1),(40481,1),(40482,1),(40483,1),(40484,1),(40485,1),(40486,1),(40487,1),(40488,1),(40489,1),(40490,1),(40491,1),(40492,1),(40493,1),(40494,1),(40495,1),(40496,1),(40497,1),(40498,1),(40499,1),(40500,1),(40501,1),(40502,1),(40503,1),(40504,1),(40505,1),(40506,1),(40507,1),(40508,1),(40509,1),(40510,1),(40511,1),(40512,1),(40513,1),(40514,1),(40515,1),(40516,1),(40517,1),(40518,1),(40519,1),(40520,1),(40521,1),(40522,1),(40523,1),(40524,1),(40525,1),(40526,1),(40527,1),(40528,1),(40529,1),(40530,1),(40531,1),(40532,1),(40533,1),(40534,1),(40535,1),(40536,1),(40537,1),(40538,1),(40539,1),(40540,1),(40541,1),(40542,1),(40543,1),(40544,1),(40545,1),(40546,1),(40547,1),(40548,1),(40549,1),(40550,1),(40551,1),(40552,1),(40553,1),(40554,1),(40555,1),(40556,1),(40557,1),(40558,1),(40559,1),(40560,1),(40561,1),(40562,1),(40563,1),(40564,1),(40565,1),(40566,1),(40567,1),(40568,1),(40569,1),(40570,1),(40571,1),(40572,1),(40573,1),(40574,1),(40575,1),(40576,1),(40577,1),(40578,1),(40579,1),(40580,1),(40581,1),(40582,1),(40583,1),(40584,1),(40585,1),(40586,1),(40587,1),(40588,1),(40589,1),(40590,1),(40591,1),(40592,1),(40593,1),(40594,1),(40595,1),(40596,1),(40597,1),(40598,1),(40599,1),(40600,1),(40601,1),(40602,1),(40603,1),(40604,1),(40605,1),(40606,1),(40607,1),(40608,1),(40609,1),(40610,1),(40611,1),(40612,1),(40613,1),(40614,1),(40615,1),(40616,1),(40617,1),(40618,1),(40619,1),(40620,1),(40621,1),(40622,1),(40623,1),(40624,1),(40625,1),(40626,1),(40627,1),(40628,1),(40629,1),(40630,1),(40631,1),(40632,1),(40633,1),(40634,1),(40635,1),(40636,1),(40637,1),(40638,1),(40639,1),(40640,1),(40641,1),(40642,1),(40643,1),(40644,1),(40645,1),(40646,1),(40647,1),(40648,1),(40649,1),(40650,1),(40651,1),(40652,1),(40653,1),(40654,1),(40655,1),(40656,1),(40657,1),(40658,1),(40659,1),(40660,1),(40661,1),(40662,1),(40663,1),(40664,1),(40665,1),(40666,1),(40667,1),(40668,1),(40669,1),(40670,1),(40671,1),(40672,1),(40673,1),(40674,1),(40675,1),(40676,1),(40677,1),(40678,1),(40679,1),(40680,1),(40681,1),(40682,1),(40683,1),(40684,1),(40685,1),(40686,1),(40687,1),(40688,1),(40689,1),(40690,1),(40691,1),(40692,1),(40693,1),(40694,1),(40695,1),(40696,1),(40697,1),(40698,1),(40699,1),(40700,1),(40701,1),(40702,1),(40703,1),(40704,1),(40705,1),(40706,1),(40707,1),(40708,1),(40709,1),(40710,1),(40711,1),(40712,1),(40713,1),(40714,1),(40715,1),(40716,1),(40717,1),(40718,1),(40719,1),(40720,1),(40721,1),(40722,1),(40723,1),(40724,1),(40725,1),(40726,1),(40727,1),(40728,1),(40729,1),(40730,1),(40731,1),(40732,1),(40733,1),(40734,1),(40735,1),(40736,1),(40737,1),(40738,1),(40739,1),(40740,1),(40741,1),(40742,1),(40743,1),(40744,1),(40745,1),(40746,1),(40747,1),(40748,1),(40749,1),(40750,1),(40751,1),(40752,1),(40753,1),(40754,1),(40755,1),(40756,1),(40757,1),(40758,1),(40759,1),(40760,1),(40761,1),(40762,1),(40763,1),(40764,1),(40765,1),(40766,1),(40767,1),(40768,1),(40769,1),(40770,1),(40771,1),(40772,1),(40773,1),(40774,1),(40775,1),(40776,1),(40777,1),(40778,1),(40779,1),(40780,1),(40781,1),(40782,1),(40783,1),(40784,1),(40785,1),(40786,1),(40787,1),(40788,1),(40789,1),(40790,1),(40791,1),(40792,1),(40793,1),(40794,1),(40795,1),(40796,1),(40797,1),(40798,1),(40799,1),(40800,1),(40801,1),(40802,1),(40803,1),(40804,1),(40805,1),(40806,1),(40807,1),(40808,1),(40809,1),(40810,1),(40811,1),(40812,1),(40813,1),(40814,1),(40815,1),(40816,1),(40817,1),(40818,1),(40819,1),(40820,1),(40821,1),(40822,1),(40823,1),(40824,1),(40825,1),(40826,1),(40827,1),(40828,1),(40829,1),(40830,1),(40831,1),(40832,1),(40833,1),(40834,1),(40835,1),(40836,1),(40837,1),(40838,1),(40839,1),(40840,1),(40841,1),(40842,1),(40843,1),(40844,1),(40845,1),(40846,1),(40847,1),(40848,1),(40849,1),(40850,1),(40851,1),(40852,1),(40853,1),(40854,1),(40855,1),(40856,1),(40857,1),(40858,1),(40859,1),(40860,1),(40861,1),(40862,1),(40863,1),(40864,1),(40865,1),(40866,1),(40867,1),(40868,1),(40869,1),(40870,1),(40871,1),(40872,1),(40873,1),(40874,1),(40875,1),(40876,1),(40877,1),(40878,1),(40879,1),(40880,1),(40881,1),(40882,1),(40883,1),(40884,1),(40885,1),(40886,1),(40887,1),(40888,1),(40889,1),(40890,1),(40891,1),(40892,1),(40893,1),(40894,1),(40895,1),(40896,1),(40897,1),(40898,1),(40899,1),(40900,1),(40901,1),(40902,1),(40903,1),(40904,1),(40905,1),(40906,1),(40907,1),(40908,1),(40909,1),(40910,1),(40911,1),(40912,1),(40913,1),(40914,1),(40915,1),(40916,1),(40917,1),(40918,1),(40919,1),(40920,1),(40921,1),(40922,1),(40923,1),(40924,1),(40925,1),(40926,1),(40927,1),(40928,1),(40929,1),(40930,1),(40931,1),(40932,1),(40933,1),(40934,1),(40935,1),(40936,1),(40937,1),(40938,1),(40939,1),(40940,1),(40941,1),(40942,1),(40943,1),(40944,1),(40945,1),(40946,1),(40947,1),(40948,1),(40949,1),(40950,1),(40951,1),(40952,1),(40953,1),(40954,1),(40955,1),(40956,1),(40957,1),(40958,1),(40959,1),(40960,1),(40961,1),(40962,1),(40963,1),(40964,1),(40965,1),(40966,1),(40967,1),(40968,1),(40969,1),(40970,1),(40971,1),(40972,1),(40973,1),(40974,1),(40975,1),(40976,1),(40977,1),(40978,1),(40979,1),(40980,1),(40981,1),(40982,1),(40983,1),(40984,1),(40985,1),(40986,1),(40987,1),(40988,1),(40989,1),(40990,1),(40991,1),(40992,1),(40993,1),(40994,1),(40995,1),(40996,1),(40997,1),(40998,1),(40999,1),(41000,1),(41001,1),(41002,1),(41003,1),(41004,1),(41005,1),(41006,1),(41007,1),(41008,1),(41009,1),(41010,1),(41011,1),(41012,1),(41013,1),(41014,1),(41015,1),(41016,1),(41017,1),(41018,1),(41019,1),(41020,1),(41021,1),(41022,1),(41023,1),(41024,1),(41025,1),(41026,1),(41027,1),(41028,1),(41029,1),(41030,1),(41031,1),(41032,1),(41033,1),(41034,1),(41035,1),(41036,1),(41037,1),(41038,1),(41039,1),(41040,1),(41041,1),(41042,1),(41043,1),(41044,1),(41045,1),(41046,1),(41047,1),(41048,1),(41049,1),(41050,1),(41051,1),(41052,1),(41053,1),(41054,1),(41055,1),(41056,1),(41057,1),(41058,1),(41059,1),(41060,1),(41061,1),(41062,1),(41063,1),(41064,1),(41065,1),(41066,1),(41067,1),(41068,1),(41069,1),(41070,1),(41071,1),(41072,1),(41073,1),(41074,1),(41075,1),(41076,1),(41077,1),(41078,1),(41079,1),(41080,1),(41081,1),(41082,1),(41083,1),(41084,1),(41085,1),(41086,1),(41087,1),(41088,1),(41089,1),(41090,1),(41091,1),(41092,1),(41093,1),(41094,1),(41095,1),(41096,1),(41097,1),(41098,1),(41099,1),(41100,1),(41101,1),(41102,1),(41103,1),(41104,1),(41105,1),(41106,1),(41107,1),(41108,1),(41109,1),(41110,1),(41111,1),(41112,1),(41113,1),(41114,1),(41115,1),(41116,1),(41117,1),(41118,1),(41119,1),(41120,1),(41121,1),(41122,1),(41123,1),(41124,1),(41125,1),(41126,1),(41127,1),(41128,1),(41129,1),(41130,1),(41131,1),(41132,1),(41133,1),(41134,1),(41135,1),(41136,1),(41137,1),(41138,1),(41139,1),(41140,1),(41141,1),(41142,1),(41143,1),(41144,1),(41145,1),(41146,1),(41147,1),(41148,1),(41149,1),(41150,1),(41151,1),(41152,1),(41153,1),(41154,1),(41155,1),(41156,1),(41157,1),(41158,1),(41159,1),(41160,1),(41161,1),(41162,1),(41163,1),(41164,1),(41165,1),(41166,1),(41167,1),(41168,1),(41169,1),(41170,1),(41171,1),(41172,1),(41173,1),(41174,1),(41175,1),(41176,1),(41177,1),(41178,1),(41179,1),(41180,1),(41181,1),(41182,1),(41183,1),(41184,1),(41185,1),(41186,1),(41187,1),(41188,1),(41189,1),(41190,1),(41191,1),(41192,1),(41193,1),(41194,1),(41195,1),(41196,1),(41197,1),(41198,1),(41199,1),(41200,1),(41201,1),(41202,1),(41203,1),(41204,1),(41205,1),(41206,1),(41207,1),(41208,1),(41209,1),(41210,1),(41211,1),(41212,1),(41213,1),(41214,1),(41215,1),(41216,1),(41217,1),(41218,1),(41219,1),(41220,1),(41221,1),(41222,1),(41223,1),(41224,1),(41225,1),(41226,1),(41227,1),(41228,1),(41229,1),(41230,1),(41231,1),(41232,1),(41233,1),(41234,1),(41235,1),(41236,1),(41237,1),(41238,1),(41239,1),(41240,1),(41241,1),(41242,1),(41243,1),(41244,1),(41245,1),(41246,1),(41247,1),(41248,1),(41249,1),(41250,1),(41251,1),(41252,1),(41253,1),(41254,1),(41255,1),(41256,1),(41257,1),(41258,1),(41259,1),(41260,1),(41261,1),(41262,1),(41263,1),(41264,1),(41265,1),(41266,1),(41267,1),(41268,1),(41269,1),(41270,1),(41271,1),(41272,1),(41273,1),(41274,1),(41275,1),(41276,1),(41277,1),(41278,1),(41279,1),(41280,1),(41281,1),(41282,1),(41283,1),(41284,1),(41285,1),(41286,1),(41287,1),(41288,1),(41289,1),(41290,1),(41291,1),(41292,1),(41293,1),(41294,1),(41295,1),(41296,1),(41297,1),(41298,1),(41299,1),(41300,1),(41301,1),(41302,1),(41303,1),(41304,1),(41305,1),(41306,1),(41307,1),(41308,1),(41309,1),(41310,1),(41311,1),(41312,1),(41313,1),(41314,1),(41315,1),(41316,1),(41317,1),(41318,1),(41319,1),(41320,1),(41321,1),(41322,1),(41323,1),(41324,1),(41325,1),(41326,1),(41327,1),(41328,1),(41329,1),(41330,1),(41331,1),(41332,1),(41333,1),(41334,1),(41335,1),(41336,1),(41337,1),(41338,1),(41339,1),(41340,1),(41341,1),(41342,1),(41343,1),(41344,1),(41345,1),(41346,1),(41347,1),(41348,1),(41349,1),(41350,1),(41351,1),(41352,1),(41353,1),(41354,1),(41355,1),(41356,1),(41357,1),(41358,1),(41359,1),(41360,1),(41361,1),(41362,1),(41363,1),(41364,1),(41365,1),(41366,1),(41367,1),(41368,1),(41369,1),(41370,1),(41371,1),(41372,1),(41373,1),(41374,1),(41375,1),(41376,1),(41377,1),(41378,1),(41379,1),(41380,1),(41381,1),(41382,1),(41383,1),(41384,1),(41385,1),(41386,1),(41387,1),(41388,1),(41389,1),(41390,1),(41391,1),(41392,1),(41393,1),(41394,1),(41395,1),(41396,1),(41397,1),(41398,1),(41399,1),(41400,1),(41401,1),(41402,1),(41403,1),(41404,1),(41405,1),(41406,1),(41407,1),(41408,1),(41409,1),(41410,1),(41411,1),(41412,1),(41413,1),(41414,1),(41415,1),(41416,1),(41417,1),(41418,1),(41419,1),(41420,1),(41421,1),(41422,1),(41423,1),(41424,1),(41425,1),(41426,1),(41427,1),(41428,1),(41429,1),(41430,1),(41431,1),(41432,1),(41433,1),(41434,1),(41435,1),(41436,1),(41437,1),(41438,1),(41439,1),(41440,1),(41441,1),(41442,1),(41443,1),(41444,1),(41445,1),(41446,1),(41447,1),(41448,1),(41449,1),(41450,1),(41451,1),(41452,1),(41453,1),(41454,1),(41455,1),(41456,1),(41457,1),(41458,1),(41459,1),(41460,1),(41461,1),(41462,1),(41463,1),(41464,1),(41465,1),(41466,1),(41467,1),(41468,1),(41469,1),(41470,1),(41471,1),(41472,1),(41473,1),(41474,1),(41475,1),(41476,1),(41477,1),(41478,1),(41479,1),(41480,1),(41481,1),(41482,1),(41483,1),(41484,1),(41485,1),(41486,1),(41487,1),(41488,1),(41489,1),(41490,1),(41491,1),(41492,1),(41493,1),(41494,1),(41495,1),(41496,1),(41497,1),(41498,1),(41499,1),(41500,1),(41501,1),(41502,1),(41503,1),(41504,1),(41505,1),(41506,1),(41507,1),(41508,1),(41509,1),(41510,1),(41511,1),(41512,1),(41513,1),(41514,1),(41515,1),(41516,1),(41517,1),(41518,1),(41519,1),(41520,1),(41521,1),(41522,1),(41523,1),(41524,1),(41525,1),(41526,1),(41527,1),(41528,1),(41529,1),(41530,1),(41531,1),(41532,1),(41533,1),(41534,1),(41535,1),(41536,1),(41537,1),(41538,1),(41539,1),(41540,1),(41541,1),(41542,1),(41543,1),(41544,1),(41545,1),(41546,1),(41547,1),(41548,1),(41549,1),(41550,1),(41551,1),(41552,1),(41553,1),(41554,1),(41555,1),(41556,1),(41557,1),(41558,1),(41559,1),(41560,1),(41561,1),(41562,1),(41563,1),(41564,1),(41565,1),(41566,1),(41567,1),(41568,1),(41569,1),(41570,1),(41571,1),(41572,1),(41573,1),(41574,1),(41575,1),(41576,1),(41577,1),(41578,1),(41579,1),(41580,1),(41581,1),(41582,1),(41583,1),(41584,1),(41585,1),(41586,1),(41587,1),(41588,1),(41589,1),(41590,1),(41591,1),(41592,1),(41593,1),(41594,1),(41595,1),(41596,1),(41597,1),(41598,1),(41599,1),(41600,1),(41601,1),(41602,1),(41603,1),(41604,1),(41605,1),(41606,1),(41607,1),(41608,1),(41609,1),(41610,1),(41611,1),(41612,1),(41613,1),(41614,1),(41615,1),(41616,1),(41617,1),(41618,1),(41619,1),(41620,1),(41621,1),(41622,1),(41623,1),(41624,1),(41625,1),(41626,1),(41627,1),(41628,1),(41629,1),(41630,1),(41631,1),(41632,1),(41633,1),(41634,1),(41635,1),(41636,1),(41637,1),(41638,1),(41639,1),(41640,1),(41641,1),(41642,1),(41643,1),(41644,1),(41645,1),(41646,1),(41647,1),(41648,1),(41649,1),(41650,1),(41651,1),(41652,1),(41653,1),(41654,1),(41655,1),(41656,1),(41657,1),(41658,1),(41659,1),(41660,1),(41661,1),(41662,1),(41663,1),(41664,1),(41665,1),(41666,1),(41667,1),(41668,1),(41669,1),(41670,1),(41671,1),(41672,1),(41673,1),(41674,1),(41675,1),(41676,1),(41677,1),(41678,1),(41679,1),(41680,1),(41681,1),(41682,1),(41683,1),(41684,1),(41685,1),(41686,1),(41687,1),(41688,1),(41689,1),(41690,1),(41691,1),(41692,1),(41693,1),(41694,1),(41695,1),(41696,1),(41697,1),(41698,1),(41699,1),(41700,1),(41701,1),(41702,1),(41703,1),(41704,1),(41705,1),(41706,1),(41707,1),(41708,1),(41709,1),(41710,1),(41711,1),(41712,1),(41713,1),(41714,1),(41715,1),(41716,1),(41717,1),(41718,1),(41719,1),(41720,1),(41721,1),(41722,1),(41723,1),(41724,1),(41725,1),(41726,1),(41727,1),(41728,1),(41729,1),(41730,1),(41731,1),(41732,1),(41733,1),(41734,1),(41735,1),(41736,1),(41737,1),(41738,1),(41739,1),(41740,1),(41741,1),(41742,1),(41743,1),(41744,1),(41745,1),(41746,1),(41747,1),(41748,1),(41749,1),(41750,1),(41751,1),(41752,1),(41753,1),(41754,1),(41755,1),(41756,1),(41757,1),(41758,1),(41759,1),(41760,1),(41761,1),(41762,1),(41763,1),(41764,1),(41765,1),(41766,1),(41767,1),(41768,1),(41769,1),(41770,1),(41771,1),(41772,1),(41773,1),(41774,1),(41775,1),(41776,1),(41777,1),(41778,1),(41779,1),(41780,1),(41781,1),(41782,1),(41783,1),(41784,1),(41785,1),(41786,1),(41787,1),(41788,1),(41789,1),(41790,1),(41791,1),(41792,1),(41793,1),(41794,1),(41795,1),(41796,1),(41797,1),(41798,1),(41799,1),(41800,1),(41801,1),(41802,1),(41803,1),(41804,1),(41805,1),(41806,1),(41807,1),(41808,1),(41809,1),(41810,1),(41811,1),(41812,1),(41813,1),(41814,1),(41815,1),(41816,1),(41817,1),(41818,1),(41819,1),(41820,1),(41821,1),(41822,1),(41823,1),(41824,1),(41825,1),(41826,1),(41827,1),(41828,1),(41829,1),(41830,1),(41831,1),(41832,1),(41833,1),(41834,1),(41835,1),(41836,1),(41837,1),(41838,1),(41839,1),(41840,1),(41841,1),(41842,1),(41843,1),(41844,1),(41845,1),(41846,1),(41847,1),(41848,1),(41849,1),(41850,1),(41851,1),(41852,1),(41853,1),(41854,1),(41855,1),(41856,1),(41857,1),(41858,1),(41859,1),(41860,1),(41861,1),(41862,1),(41863,1),(41864,1),(41865,1),(41866,1),(41867,1),(41868,1),(41869,1),(41870,1),(41871,1),(41872,1),(41873,1),(41874,1),(41875,1),(41876,1),(41877,1),(41878,1),(41879,1),(41880,1),(41881,1),(41882,1),(41883,1),(41884,1),(41885,1),(41886,1),(41887,1),(41888,1),(41889,1),(41890,1),(41891,1),(41892,1),(41893,1),(41894,1),(41895,1),(41896,1),(41897,1),(41898,1),(41899,1),(41900,1),(41901,1),(41902,1),(41903,1),(41904,1),(41905,1),(41906,1),(41907,1),(41908,1),(41909,1),(41910,1),(41911,1),(41912,1),(41913,1),(41914,1),(41915,1),(41916,1),(41917,1),(41918,1),(41919,1),(41920,1),(41921,1),(41922,1),(41923,1),(41924,1),(41925,1),(41926,1),(41927,1),(41928,1),(41929,1),(41930,1),(41931,1),(41932,1),(41933,1),(41934,1),(41935,1),(41936,1),(41937,1),(41938,1),(41939,1),(41940,1),(41941,1),(41942,1),(41943,1),(41944,1),(41945,1),(41946,1),(41947,1),(41948,1),(41949,1),(41950,1),(41951,1),(41952,1),(41953,1),(41954,1),(41955,1),(41956,1),(41957,1),(41958,1),(41959,1),(41960,1),(41961,1),(41962,1),(41963,1),(41964,1),(41965,1),(41966,1),(41967,1),(41968,1),(41969,1),(41970,1),(41971,1),(41972,1),(41973,1),(41974,1),(41975,1),(41976,1),(41977,1),(41978,1),(41979,1),(41980,1),(41981,1),(41982,1),(41983,1),(41984,1),(41985,1),(41986,1),(41987,1),(41988,1),(41989,1),(41990,1),(41991,1),(41992,1),(41993,1),(41994,1),(41995,1),(41996,1),(41997,1),(41998,1),(41999,1),(42000,1),(42001,1),(42002,1),(42003,1),(42004,1),(42005,1),(42006,1),(42007,1),(42008,1),(42009,1),(42010,1),(42011,1),(42012,1),(42013,1),(42014,1),(42015,1),(42016,1),(42017,1),(42018,1),(42019,1),(42020,1),(42021,1),(42022,1),(42023,1),(42024,1),(42025,1),(42026,1),(42027,1),(42028,1),(42029,1),(42030,1),(42031,1),(42032,1),(42033,1),(42034,1),(42035,1),(42036,1),(42037,1),(42038,1),(42039,1),(42040,1),(42041,1),(42042,1),(42043,1),(42044,1),(42045,1),(42046,1),(42047,1),(42048,1),(42049,1),(42050,1),(42051,1),(42052,1),(42053,1),(42054,1),(42055,1),(42056,1),(42057,1),(42058,1),(42059,1),(42060,1),(42061,1),(42062,1),(42063,1),(42064,1),(42065,1),(42066,1),(42067,1),(42068,1),(42069,1),(42070,1),(42071,1),(42072,1),(42073,1),(42074,1),(42075,1),(42076,1),(42077,1),(42078,1),(42079,1),(42080,1),(42081,1),(42082,1),(42083,1),(42084,1),(42085,1),(42086,1),(42087,1),(42088,1),(42089,1),(42090,1),(42091,1),(42092,1),(42093,1),(42094,1),(42095,1),(42096,1),(42097,1),(42098,1),(42099,1),(42100,1),(42101,1),(42102,1),(42103,1),(42104,1),(42105,1),(42106,1),(42107,1),(42108,1),(42109,1),(42110,1),(42111,1),(42112,1),(42113,1),(42114,1),(42115,1),(42116,1),(42117,1),(42118,1),(42119,1),(42120,1),(42121,1),(42122,1),(42123,1),(42124,1),(42125,1),(42126,1),(42127,1),(42128,1),(42129,1),(42130,1),(42131,1),(42132,1),(42133,1),(42134,1),(42135,1),(42136,1),(42137,1),(42138,1),(42139,1),(42140,1),(42141,1),(42142,1),(42143,1),(42144,1),(42145,1),(42146,1),(42147,1),(42148,1),(42149,1),(42150,1),(42151,1),(42152,1),(42153,1),(42154,1),(42155,1),(42156,1),(42157,1),(42158,1),(42159,1),(42160,1),(42161,1),(42162,1),(42163,1),(42164,1),(42165,1),(42166,1),(42167,1),(42168,1),(42169,1),(42170,1),(42171,1),(42172,1),(42173,1),(42174,1),(42175,1),(42176,1),(42177,1),(42178,1),(42179,1),(42180,1),(42181,1),(42182,1),(42183,1),(42184,1),(42185,1),(42186,1),(42187,1),(42188,1),(42189,1),(42190,1),(42191,1),(42192,1),(42193,1),(42194,1),(42195,1),(42196,1),(42197,1),(42198,1),(42199,1),(42200,1),(42201,1),(42202,1),(42203,1),(42204,1),(42205,1),(42206,1),(42207,1),(42208,1),(42209,1),(42210,1),(42211,1),(42212,1),(42213,1),(42214,1),(42215,1),(42216,1),(42217,1),(42218,1),(42219,1),(42220,1),(42221,1),(42222,1),(42223,1),(42224,1),(42225,1),(42226,1),(42227,1),(42228,1),(42229,1),(42230,1),(42231,1),(42232,1),(42233,1),(42234,1),(42235,1),(42236,1),(42237,1),(42238,1),(42239,1),(42240,1),(42241,1),(42242,1),(42243,1),(42244,1),(42245,1),(42246,1),(42247,1),(42248,1),(42249,1),(42250,1),(42251,1),(42252,1),(42253,1),(42254,1),(42255,1),(42256,1),(42257,1),(42258,1),(42259,1),(42260,1),(42261,1),(42262,1),(42263,1),(42264,1),(42265,1),(42266,1),(42267,1),(42268,1),(42269,1),(42270,1),(42271,1),(42272,1),(42273,1),(42274,1),(42275,1),(42276,1),(42277,1),(42278,1),(42279,1),(42280,1),(42281,1),(42282,1),(42283,1),(42284,1),(42285,1),(42286,1),(42287,1),(42288,1),(42289,1),(42290,1),(42291,1),(42292,1),(42293,1),(42294,1),(42295,1),(42296,1),(42297,1),(42298,1),(42299,1),(42300,1),(42301,1),(42302,1),(42303,1),(42304,1),(42305,1),(42306,1),(42307,1),(42308,1),(42309,1),(42310,1),(42311,1),(42312,1),(42313,1),(42314,1),(42315,1),(42316,1),(42317,1),(42318,1),(42319,1),(42320,1),(42321,1),(42322,1),(42323,1),(42324,1),(42325,1),(42326,1),(42327,1),(42328,1),(42329,1),(42330,1),(42331,1),(42332,1),(42333,1),(42334,1),(42335,1),(42336,1),(42337,1),(42338,1),(42339,1),(42340,1),(42341,1),(42342,1),(42343,1),(42344,1),(42345,1),(42346,1),(42347,1),(42348,1),(42349,1),(42350,1),(42351,1),(42352,1),(42353,1),(42354,1),(42355,1),(42356,1),(42357,1),(42358,1),(42359,1),(42360,1),(42361,1),(42362,1),(42363,1),(42364,1),(42365,1),(42366,1),(42367,1),(42368,1),(42369,1),(42370,1),(42371,1),(42372,1),(42373,1),(42374,1),(42375,1),(42376,1),(42377,1),(42378,1),(42379,1),(42380,1),(42381,1),(42382,1),(42383,1),(42384,1),(42385,1),(42386,1),(42387,1),(42388,1),(42389,1),(42390,1),(42391,1),(42392,1),(42393,1),(42394,1),(42395,1),(42396,1),(42397,1),(42398,1),(42399,1),(42400,1),(42401,1),(42402,1),(42403,1),(42404,1),(42405,1),(42406,1),(42407,1),(42408,1),(42409,1),(42410,1),(42411,1),(42412,1),(42413,1),(42414,1),(42415,1),(42416,1),(42417,1),(42418,1),(42419,1),(42420,1),(42421,1),(42422,1),(42423,1),(42424,1),(42425,1),(42426,1),(42427,1),(42428,1),(42429,1),(42430,1),(42431,1),(42432,1),(42433,1),(42434,1),(42435,1),(42436,1),(42437,1),(42438,1),(42439,1),(42440,1),(42441,1),(42442,1),(42443,1),(42444,1),(42445,1),(42446,1),(42447,1),(42448,1),(42449,1),(42450,1),(42451,1),(42452,1),(42453,1),(42454,1),(42455,1),(42456,1),(42457,1),(42458,1),(42459,1),(42460,1),(42461,1),(42462,1),(42463,1),(42464,1),(42465,1),(42466,1),(42467,1),(42468,1),(42469,1),(42470,1),(42471,1),(42472,1),(42473,1),(42474,1),(42475,1),(42476,1),(42477,1),(42478,1),(42479,1),(42480,1),(42481,1),(42482,1),(42483,1),(42484,1),(42485,1),(42486,1),(42487,1),(42488,1),(42489,1),(42490,1),(42491,1),(42492,1),(42493,1),(42494,1),(42495,1),(42496,1),(42497,1),(42498,1),(42499,1),(42500,1),(42501,1),(42502,1),(42503,1),(42504,1),(42505,1),(42506,1),(42507,1),(42508,1),(42509,1),(42510,1),(42511,1),(42512,1),(42513,1),(42514,1),(42515,1),(42516,1),(42517,1),(42518,1),(42519,1),(42520,1),(42521,1),(42522,1),(42523,1),(42524,1),(42525,1),(42526,1),(42527,1),(42528,1),(42529,1),(42530,1),(42531,1),(42532,1),(42533,1),(42534,1),(42535,1),(42536,1),(42537,1),(42538,1),(42539,1),(42540,1),(42541,1),(42542,1),(42543,1),(42544,1),(42545,1),(42546,1),(42547,1),(42548,1),(42549,1),(42550,1),(42551,1),(42552,1),(42553,1),(42554,1),(42555,1),(42556,1),(42557,1),(42558,1),(42559,1),(42560,1),(42561,1),(42562,1),(42563,1),(42564,1),(42565,1),(42566,1),(42567,1),(42568,1),(42569,1),(42570,1),(42571,1),(42572,1),(42573,1),(42574,1),(42575,1),(42576,1),(42577,1),(42578,1),(42579,1),(42580,1),(42581,1),(42582,1),(42583,1),(42584,1),(42585,1),(42586,1),(42587,1),(42588,1),(42589,1),(42590,1),(42591,1),(42592,1),(42593,1),(42594,1),(42595,1),(42596,1),(42597,1),(42598,1),(42599,1),(42600,1),(42601,1),(42602,1),(42603,1),(42604,1),(42605,1),(42606,1),(42607,1),(42608,1),(42609,1),(42610,1),(42611,1),(42612,1),(42613,1),(42614,1),(42615,1),(42616,1),(42617,1),(42618,1),(42619,1),(42620,1),(42621,1),(42622,1),(42623,1),(42624,1),(42625,1),(42626,1),(42627,1),(42628,1),(42629,1),(42630,1),(42631,1),(42632,1),(42633,1),(42634,1),(42635,1),(42636,1),(42637,1),(42638,1),(42639,1),(42640,1),(42641,1),(42642,1),(42643,1),(42644,1),(42645,1),(42646,1),(42647,1),(42648,1),(42649,1),(42650,1),(42651,1),(42652,1),(42653,1),(42654,1),(42655,1),(42656,1),(42657,1),(42658,1),(42659,1),(42660,1),(42661,1),(42662,1),(42663,1),(42664,1),(42665,1),(42666,1),(42667,1),(42668,1),(42669,1),(42670,1),(42671,1),(42672,1),(42673,1),(42674,1),(42675,1),(42676,1),(42677,1),(42678,1),(42679,1),(42680,1),(42681,1),(42682,1),(42683,1),(42684,1),(42685,1),(42686,1),(42687,1),(42688,1),(42689,1),(42690,1),(42691,1),(42692,1),(42693,1),(42694,1),(42695,1),(42696,1),(42697,1),(42698,1),(42699,1),(42700,1),(42701,1),(42702,1),(42703,1),(42704,1),(42705,1),(42706,1),(42707,1),(42708,1),(42709,1),(42710,1),(42711,1),(42712,1),(42713,1),(42714,1),(42715,1),(42716,1),(42717,1),(42718,1),(42719,1),(42720,1),(42721,1),(42722,1),(42723,1),(42724,1),(42725,1),(42726,1),(42727,1),(42728,1),(42729,1),(42730,1),(42731,1),(42732,1),(42733,1),(42734,1),(42735,1),(42736,1),(42737,1),(42738,1),(42739,1),(42740,1),(42741,1),(42742,1),(42743,1),(42744,1),(42745,1),(42746,1),(42747,1),(42748,1),(42749,1),(42750,1),(42751,1),(42752,1),(42753,1),(42754,1),(42755,1),(42756,1),(42757,1),(42758,1),(42759,1),(42760,1),(42761,1),(42762,1),(42763,1),(42764,1),(42765,1),(42766,1),(42767,1),(42768,1),(42769,1),(42770,1),(42771,1),(42772,1),(42773,1),(42774,1),(42775,1),(42776,1),(42777,1),(42778,1),(42779,1),(42780,1),(42781,1),(42782,1),(42783,1),(42784,1),(42785,1),(42786,1),(42787,1),(42788,1),(42789,1),(42790,1),(42791,1),(42792,1),(42793,1),(42794,1),(42795,1),(42796,1),(42797,1),(42798,1),(42799,1),(42800,1),(42801,1),(42802,1),(42803,1),(42804,1),(42805,1),(42806,1),(42807,1),(42808,1),(42809,1),(42810,1),(42811,1),(42812,1),(42813,1),(42814,1),(42815,1),(42816,1),(42817,1),(42818,1),(42819,1),(42820,1),(42821,1),(42822,1),(42823,1),(42824,1),(42825,1),(42826,1),(42827,1),(42828,1),(42829,1),(42830,1),(42831,1),(42832,1),(42833,1),(42834,1),(42835,1),(42836,1),(42837,1),(42838,1),(42839,1),(42840,1),(42841,1),(42842,1),(42843,1),(42844,1),(42845,1),(42846,1),(42847,1),(42848,1),(42849,1),(42850,1),(42851,1),(42852,1),(42853,1),(42854,1),(42855,1),(42856,1),(42857,1),(42858,1),(42859,1),(42860,1),(42861,1),(42862,1),(42863,1),(42864,1),(42865,1),(42866,1),(42867,1),(42868,1),(42869,1),(42870,1),(42871,1),(42872,1),(42873,1),(42874,1),(42875,1),(42876,1),(42877,1),(42878,1),(42879,1),(42880,1),(42881,1),(42882,1),(42883,1),(42884,1),(42885,1),(42886,1),(42887,1),(42888,1),(42889,1),(42890,1),(42891,1),(42892,1),(42893,1),(42894,1),(42895,1),(42896,1),(42897,1),(42898,1),(42899,1),(42900,1),(42901,1),(42902,1),(42903,1),(42904,1),(42905,1),(42906,1),(42907,1),(42908,1),(42909,1),(42910,1),(42911,1),(42912,1),(42913,1),(42914,1),(42915,1),(42916,1),(42917,1),(42918,1),(42919,1),(42920,1),(42921,1),(42922,1),(42923,1),(42924,1),(42925,1),(42926,1),(42927,1),(42928,1),(42929,1),(42930,1),(42931,1),(42932,1),(42933,1),(42934,1),(42935,1),(42936,1),(42937,1),(42938,1),(42939,1),(42940,1),(42941,1),(42942,1),(42943,1),(42944,1),(42945,1),(42946,1),(42947,1),(42948,1),(42949,1),(42950,1),(42951,1),(42952,1),(42953,1),(42954,1),(42955,1),(42956,1),(42957,1),(42958,1),(42959,1),(42960,1),(42961,1),(42962,1),(42963,1),(42964,1),(42965,1),(42966,1),(42967,1),(42968,1),(42969,1),(42970,1),(42971,1),(42972,1),(42973,1),(42974,1),(42975,1),(42976,1),(42977,1),(42978,1),(42979,1),(42980,1),(42981,1),(42982,1),(42983,1),(42984,1),(42985,1),(42986,1),(42987,1),(42988,1),(42989,1),(42990,1),(42991,1),(42992,1),(42993,1),(42994,1),(42995,1),(42996,1),(42997,1),(42998,1),(42999,1),(43000,1),(43001,1),(43002,1),(43003,1),(43004,1),(43005,1),(43006,1),(43007,1),(43008,1),(43009,1),(43010,1),(43011,1),(43012,1),(43013,1),(43014,1),(43015,1),(43016,1),(43017,1),(43018,1),(43019,1),(43020,1),(43021,1),(43022,1),(43023,1),(43024,1),(43025,1),(43026,1),(43027,1),(43028,1),(43029,1),(43030,1),(43031,1),(43032,1),(43033,1),(43034,1),(43035,1),(43036,1),(43037,1),(43038,1),(43039,1),(43040,1),(43041,1),(43042,1),(43043,1),(43044,1),(43045,1),(43046,1),(43047,1),(43048,1),(43049,1),(43050,1),(43051,1),(43052,1),(43053,1),(43054,1),(43055,1),(43056,1),(43057,1),(43058,1),(43059,1),(43060,1),(43061,1),(43062,1),(43063,1),(43064,1),(43065,1),(43066,1),(43067,1),(43068,1),(43069,1),(43070,1),(43071,1),(43072,1),(43073,1),(43074,1),(43075,1),(43076,1),(43077,1),(43078,1),(43079,1),(43080,1),(43081,1),(43082,1),(43083,1),(43084,1),(43085,1),(43086,1),(43087,1),(43088,1),(43089,1),(43090,1),(43091,1),(43092,1),(43093,1),(43094,1),(43095,1),(43096,1),(43097,1),(43098,1),(43099,1),(43100,1),(43101,1),(43102,1),(43103,1),(43104,1),(43105,1),(43106,1),(43107,1),(43108,1),(43109,1),(43110,1),(43111,1),(43112,1),(43113,1),(43114,1),(43115,1),(43116,1),(43117,1),(43118,1),(43119,1),(43120,1),(43121,1),(43122,1),(43123,1),(43124,1),(43125,1),(43126,1),(43127,1),(43128,1),(43129,1),(43130,1),(43131,1),(43132,1),(43133,1),(43134,1),(43135,1),(43136,1),(43137,1),(43138,1),(43139,1),(43140,1),(43141,1),(43142,1),(43143,1),(43144,1),(43145,1),(43146,1),(43147,1),(43148,1),(43149,1),(43150,1),(43151,1),(43152,1),(43153,1),(43154,1),(43155,1),(43156,1),(43157,1),(43158,1),(43159,1),(43160,1),(43161,1),(43162,1),(43163,1),(43164,1),(43165,1),(43166,1),(43167,1),(43168,1),(43169,1),(43170,1),(43171,1),(43172,1),(43173,1),(43174,1),(43175,1),(43176,1),(43177,1),(43178,1),(43179,1),(43180,1),(43181,1),(43182,1),(43183,1),(43184,1),(43185,1),(43186,1),(43187,1),(43188,1),(43189,1),(43190,1),(43191,1),(43192,1),(43193,1),(43194,1),(43195,1),(43196,1),(43197,1),(43198,1),(43199,1),(43200,1),(43201,1),(43202,1),(43203,1),(43204,1),(43205,1),(43206,1),(43207,1),(43208,1),(43209,1),(43210,1),(43211,1),(43212,1),(43213,1),(43214,1),(43215,1),(43216,1),(43217,1),(43218,1),(43219,1),(43220,1),(43221,1),(43222,1),(43223,1),(43224,1),(43225,1),(43226,1),(43227,1),(43228,1),(43229,1),(43230,1),(43231,1),(43232,1),(43233,1),(43234,1),(43235,1),(43236,1),(43237,1),(43238,1),(43239,1),(43240,1),(43241,1),(43242,1),(43243,1),(43244,1),(43245,1),(43246,1),(43247,1),(43248,1),(43249,1),(43250,1),(43251,1),(43252,1),(43253,1),(43254,1),(43255,1),(43256,1),(43257,1),(43258,1),(43259,1),(43260,1),(43261,1),(43262,1),(43263,1),(43264,1),(43265,1),(43266,1),(43267,1),(43268,1),(43269,1),(43270,1),(43271,1),(43272,1),(43273,1),(43274,1),(43275,1),(43276,1),(43277,1),(43278,1),(43279,1),(43280,1),(43281,1),(43282,1),(43283,1),(43284,1),(43285,1),(43286,1),(43287,1),(43288,1),(43289,1),(43290,1),(43291,1),(43292,1),(43293,1),(43294,1),(43295,1),(43296,1),(43297,1),(43298,1),(43299,1),(43300,1),(43301,1),(43302,1),(43303,1),(43304,1),(43305,1),(43306,1),(43307,1),(43308,1),(43309,1),(43310,1),(43311,1),(43312,1),(43313,1),(43314,1),(43315,1),(43316,1),(43317,1),(43318,1),(43319,1),(43320,1),(43321,1),(43322,1),(43323,1),(43324,1),(43325,1),(43326,1),(43327,1),(43328,1),(43329,1),(43330,1),(43331,1),(43332,1),(43333,1),(43334,1),(43335,1),(43336,1),(43337,1),(43338,1),(43339,1),(43340,1),(43341,1),(43342,1),(43343,1),(43344,1),(43345,1),(43346,1),(43347,1),(43348,1),(43349,1),(43350,1),(43351,1),(43352,1),(43353,1),(43354,1),(43355,1),(43356,1),(43357,1),(43358,1),(43359,1),(43360,1),(43361,1),(43362,1),(43363,1),(43364,1),(43365,1),(43366,1),(43367,1),(43368,1),(43369,1),(43370,1),(43371,1),(43372,1),(43373,1),(43374,1),(43375,1),(43376,1),(43377,1),(43378,1),(43379,1),(43380,1),(43381,1),(43382,1),(43383,1),(43384,1),(43385,1),(43386,1),(43387,1),(43388,1),(43389,1),(43390,1),(43391,1),(43392,1),(43393,1),(43394,1),(43395,1),(43396,1),(43397,1),(43398,1),(43399,1),(43400,1),(43401,1),(43402,1),(43403,1),(43404,1),(43405,1),(43406,1),(43407,1),(43408,1),(43409,1),(43410,1),(43411,1),(43412,1),(43413,1),(43414,1),(43415,1),(43416,1),(43417,1),(43418,1),(43419,1),(43420,1),(43421,1),(43422,1),(43423,1),(43424,1),(43425,1),(43426,1),(43427,1),(43428,1),(43429,1),(43430,1),(43431,1),(43432,1),(43433,1),(43434,1),(43435,1),(43436,1),(43437,1),(43438,1),(43439,1),(43440,1),(43441,1),(43442,1),(43443,1),(43444,1),(43445,1),(43446,1),(43447,1),(43448,1),(43449,1),(43450,1),(43451,1),(43452,1),(43453,1),(43454,1),(43455,1),(43456,1),(43457,1),(43458,1),(43459,1),(43460,1),(43461,1),(43462,1),(43463,1),(43464,1),(43465,1),(43466,1),(43467,1),(43468,1),(43469,1),(43470,1),(43471,1),(43472,1),(43473,1),(43474,1),(43475,1),(43476,1),(43477,1),(43478,1),(43479,1),(43480,1),(43481,1),(43482,1),(43483,1),(43484,1),(43485,1),(43486,1),(43487,1),(43488,1),(43489,1),(43490,1),(43491,1),(43492,1),(43493,1),(43494,1),(43495,1),(43496,1),(43497,1),(43498,1),(43499,1),(43500,1),(43501,1),(43502,1),(43503,1),(43504,1),(43505,1),(43506,1),(43507,1),(43508,1),(43509,1),(43510,1),(43511,1),(43512,1),(43513,1),(43514,1),(43515,1),(43516,1),(43517,1),(43518,1),(43519,1),(43520,1),(43521,1),(43522,1),(43523,1),(43524,1),(43525,1),(43526,1),(43527,1),(43528,1),(43529,1),(43530,1),(43531,1),(43532,1),(43533,1),(43534,1),(43535,1),(43536,1),(43537,1),(43538,1),(43539,1),(43540,1),(43541,1),(43542,1),(43543,1),(43544,1),(43545,1),(43546,1),(43547,1),(43548,1),(43549,1),(43550,1),(43551,1),(43552,1),(43553,1),(43554,1),(43555,1),(43556,1),(43557,1),(43558,1),(43559,1),(43560,1),(43561,1),(43562,1),(43563,1),(43564,1),(43565,1),(43566,1),(43567,1),(43568,1),(43569,1),(43570,1),(43571,1),(43572,1),(43573,1),(43574,1),(43575,1),(43576,1),(43577,1),(43578,1),(43579,1),(43580,1),(43581,1),(43582,1),(43583,1),(43584,1),(43585,1),(43586,1),(43587,1),(43588,1),(43589,1),(43590,1),(43591,1),(43592,1),(43593,1),(43594,1),(43595,1),(43596,1),(43597,1),(43598,1),(43599,1),(43600,1),(43601,1),(43602,1),(43603,1),(43604,1),(43605,1),(43606,1),(43607,1),(43608,1),(43609,1),(43610,1),(43611,1),(43612,1),(43613,1),(43614,1),(43615,1),(43616,1),(43617,1),(43618,1),(43619,1),(43620,1),(43621,1),(43622,1),(43623,1),(43624,1),(43625,1),(43626,1),(43627,1),(43628,1),(43629,1),(43630,1),(43631,1),(43632,1),(43633,1),(43634,1),(43635,1),(43636,1),(43637,1),(43638,1),(43639,1),(43640,1),(43641,1),(43642,1),(43643,1),(43644,1),(43645,1),(43646,1),(43647,1),(43648,1),(43649,1),(43650,1),(43651,1),(43652,1),(43653,1),(43654,1),(43655,1),(43656,1),(43657,1),(43658,1),(43659,1),(43660,1),(43661,1),(43662,1),(43663,1),(43664,1),(43665,1),(43666,1),(43667,1),(43668,1),(43669,1),(43670,1),(43671,1),(43672,1),(43673,1),(43674,1),(43675,1),(43676,1),(43677,1),(43678,1),(43679,1),(43680,1),(43681,1),(43682,1),(43683,1),(43684,1),(43685,1),(43686,1),(43687,1),(43688,1),(43689,1),(43690,1),(43691,1),(43692,1),(43693,1),(43694,1),(43695,1),(43696,1),(43697,1),(43698,1),(43699,1),(43700,1),(43701,1),(43702,1),(43703,1),(43704,1),(43705,1),(43706,1),(43707,1),(43708,1),(43709,1),(43710,1),(43711,1),(43712,1),(43713,1),(43714,1),(43715,1),(43716,1),(43717,1),(43718,1),(43719,1),(43720,1),(43721,1),(43722,1),(43723,1),(43724,1),(43725,1),(43726,1),(43727,1),(43728,1),(43729,1),(43730,1),(43731,1),(43732,1),(43733,1),(43734,1),(43735,1),(43736,1),(43737,1),(43738,1),(43739,1),(43740,1),(43741,1),(43742,1),(43743,1),(43744,1),(43745,1),(43746,1),(43747,1),(43748,1),(43749,1),(43750,1),(43751,1),(43752,1),(43753,1),(43754,1),(43755,1),(43756,1),(43757,1),(43758,1),(43759,1),(43760,1),(43761,1),(43762,1),(43763,1),(43764,1),(43765,1),(43766,1),(43767,1),(43768,1),(43769,1),(43770,1),(43771,1),(43772,1),(43773,1),(43774,1),(43775,1),(43776,1),(43777,1),(43778,1),(43779,1),(43780,1),(43781,1),(43782,1),(43783,1),(43784,1),(43785,1),(43786,1),(43787,1),(43788,1),(43789,1),(43790,1),(43791,1),(43792,1),(43793,1),(43794,1),(43795,1),(43796,1),(43797,1),(43798,1),(43799,1),(43800,1),(43801,1),(43802,1),(43803,1),(43804,1),(43805,1),(43806,1),(43807,1),(43808,1),(43809,1),(43810,1),(43811,1),(43812,1),(43813,1),(43814,1),(43815,1),(43816,1),(43817,1),(43818,1),(43819,1),(43820,1),(43821,1),(43822,1),(43823,1),(43824,1),(43825,1),(43826,1),(43827,1),(43828,1),(43829,1),(43830,1),(43831,1),(43832,1),(43833,1),(43834,1),(43835,1),(43836,1),(43837,1),(43838,1),(43839,1),(43840,1),(43841,1),(43842,1),(43843,1),(43844,1),(43845,1),(43846,1),(43847,1),(43848,1),(43849,1),(43850,1),(43851,1),(43852,1),(43853,1),(43854,1),(43855,1),(43856,1),(43857,1),(43858,1),(43859,1),(43860,1),(43861,1),(43862,1),(43863,1),(43864,1),(43865,1),(43866,1),(43867,1),(43868,1),(43869,1),(43870,1),(43871,1),(43872,1),(43873,1),(43874,1),(43875,1),(43876,1),(43877,1),(43878,1),(43879,1),(43880,1),(43881,1),(43882,1),(43883,1),(43884,1),(43885,1),(43886,1),(43887,1),(43888,1),(43889,1),(43890,1),(43891,1),(43892,1),(43893,1),(43894,1),(43895,1),(43896,1),(43897,1),(43898,1),(43899,1),(43900,1),(43901,1),(43902,1),(43903,1),(43904,1),(43905,1),(43906,1),(43907,1),(43908,1),(43909,1),(43910,1),(43911,1),(43912,1),(43913,1),(43914,1),(43915,1),(43916,1),(43917,1),(43918,1),(43919,1),(43920,1),(43921,1),(43922,1),(43923,1),(43924,1),(43925,1),(43926,1),(43927,1),(43928,1),(43929,1),(43930,1),(43931,1),(43932,1),(43933,1),(43934,1),(43935,1),(43936,1),(43937,1),(43938,1),(43939,1),(43940,1),(43941,1),(43942,1),(43943,1),(43944,1),(43945,1),(43946,1),(43947,1),(43948,1),(43949,1),(43950,1),(43951,1),(43952,1),(43953,1),(43954,1),(43955,1),(43956,1),(43957,1),(43958,1),(43959,1),(43960,1),(43961,1),(43962,1),(43963,1),(43964,1),(43965,1),(43966,1),(43967,1),(43968,1),(43969,1),(43970,1),(43971,1),(43972,1),(43973,1),(43974,1),(43975,1),(43976,1),(43977,1),(43978,1),(43979,1),(43980,1),(43981,1),(43982,1),(43983,1),(43984,1),(43985,1),(43986,1),(43987,1),(43988,1),(43989,1),(43990,1),(43991,1),(43992,1),(43993,1),(43994,1),(43995,1),(43996,1),(43997,1),(43998,1),(43999,1),(44000,1),(44001,1),(44002,1),(44003,1),(44004,1),(44005,1),(44006,1),(44007,1),(44008,1),(44009,1),(44010,1),(44011,1),(44012,1),(44013,1),(44014,1),(44015,1),(44016,1),(44017,1),(44018,1),(44019,1),(44020,1),(44021,1),(44022,1),(44023,1),(44024,1),(44025,1),(44026,1),(44027,1),(44028,1),(44029,1),(44030,1),(44031,1),(44032,1),(44033,1),(44034,1),(44035,1),(44036,1),(44037,1),(44038,1),(44039,1),(44040,1),(44041,1),(44042,1),(44043,1),(44044,1),(44045,1),(44046,1),(44047,1),(44048,1),(44049,1),(44050,1),(44051,1),(44052,1),(44053,1),(44054,1),(44055,1),(44056,1),(44057,1),(44058,1),(44059,1),(44060,1),(44061,1),(44062,1),(44063,1),(44064,1),(44065,1),(44066,1),(44067,1),(44068,1),(44069,1),(44070,1),(44071,1),(44072,1),(44073,1),(44074,1),(44075,1),(44076,1),(44077,1),(44078,1),(44079,1),(44080,1),(44081,1),(44082,1),(44083,1),(44084,1),(44085,1),(44086,1),(44087,1),(44088,1),(44089,1),(44090,1),(44091,1),(44092,1),(44093,1),(44094,1),(44095,1),(44096,1),(44097,1),(44098,1),(44099,1),(44100,1),(44101,1),(44102,1),(44103,1),(44104,1),(44105,1),(44106,1),(44107,1),(44108,1),(44109,1),(44110,1),(44111,1),(44112,1),(44113,1),(44114,1),(44115,1),(44116,1),(44117,1),(44118,1),(44119,1),(44120,1),(44121,1),(44122,1),(44123,1),(44124,1),(44125,1),(44126,1),(44127,1),(44128,1),(44129,1),(44130,1),(44131,1),(44132,1),(44133,1),(44134,1),(44135,1),(44136,1),(44137,1),(44138,1),(44139,1),(44140,1),(44141,1),(44142,1),(44143,1),(44144,1),(44145,1),(44146,1),(44147,1),(44148,1),(44149,1),(44150,1),(44151,1),(44152,1),(44153,1),(44154,1),(44155,1),(44156,1),(44157,1),(44158,1),(44159,1),(44160,1),(44161,1),(44162,1),(44163,1),(44164,1),(44165,1),(44166,1),(44167,1),(44168,1),(44169,1),(44170,1),(44171,1),(44172,1),(44173,1),(44174,1),(44175,1),(44176,1),(44177,1),(44178,1),(44179,1),(44180,1),(44181,1),(44182,1),(44183,1),(44184,1),(44185,1),(44186,1),(44187,1),(44188,1),(44189,1),(44190,1),(44191,1),(44192,1),(44193,1),(44194,1),(44195,1),(44196,1),(44197,1),(44198,1),(44199,1),(44200,1),(44201,1),(44202,1),(44203,1),(44204,1),(44205,1),(44206,1),(44207,1),(44208,1),(44209,1),(44210,1),(44211,1),(44212,1),(44213,1),(44214,1),(44215,1),(44216,1),(44217,1),(44218,1),(44219,1),(44220,1),(44221,1),(44222,1),(44223,1),(44224,1),(44225,1),(44226,1),(44227,1),(44228,1),(44229,1),(44230,1),(44231,1),(44232,1),(44233,1),(44234,1),(44235,1),(44236,1),(44237,1),(44238,1),(44239,1),(44240,1),(44241,1),(44242,1),(44243,1),(44244,1),(44245,1),(44246,1),(44247,1),(44248,1),(44249,1),(44250,1),(44251,1),(44252,1),(44253,1),(44254,1),(44255,1),(44256,1),(44257,1),(44258,1),(44259,1),(44260,1),(44261,1),(44262,1),(44263,1),(44264,1),(44265,1),(44266,1),(44267,1),(44268,1),(44269,1),(44270,1),(44271,1),(44272,1),(44273,1),(44274,1),(44275,1),(44276,1),(44277,1),(44278,1),(44279,1),(44280,1),(44281,1),(44282,1),(44283,1),(44284,1),(44285,1),(44286,1),(44287,1),(44288,1),(44289,1),(44290,1),(44291,1),(44292,1),(44293,1),(44294,1),(44295,1),(44296,1),(44297,1),(44298,1),(44299,1),(44300,1),(44301,1),(44302,1),(44303,1),(44304,1),(44305,1),(44306,1),(44307,1),(44308,1),(44309,1),(44310,1),(44311,1),(44312,1),(44313,1),(44314,1),(44315,1),(44316,1),(44317,1),(44318,1),(44319,1),(44320,1),(44321,1),(44322,1),(44323,1),(44324,1),(44325,1),(44326,1),(44327,1),(44328,1),(44329,1),(44330,1),(44331,1),(44332,1),(44333,1),(44334,1),(44335,1),(44336,1),(44337,1),(44338,1),(44339,1),(44340,1),(44341,1),(44342,1),(44343,1),(44344,1),(44345,1),(44346,1),(44347,1),(44348,1),(44349,1),(44350,1),(44351,1),(44352,1),(44353,1),(44354,1),(44355,1),(44356,1),(44357,1),(44358,1),(44359,1),(44360,1),(44361,1),(44362,1),(44363,1),(44364,1),(44365,1),(44366,1),(44367,1),(44368,1),(44369,1),(44370,1),(44371,1),(44372,1),(44373,1),(44374,1),(44375,1),(44376,1),(44377,1),(44378,1),(44379,1),(44380,1),(44381,1),(44382,1),(44383,1),(44384,1),(44385,1),(44386,1),(44387,1),(44388,1),(44389,1),(44390,1),(44391,1),(44392,1),(44393,1),(44394,1),(44395,1),(44396,1),(44397,1),(44398,1),(44399,1),(44400,1),(44401,1),(44402,1),(44403,1),(44404,1),(44405,1),(44406,1),(44407,1),(44408,1),(44409,1),(44410,1),(44411,1),(44412,1),(44413,1),(44414,1),(44415,1),(44416,1),(44417,1),(44418,1),(44419,1),(44420,1),(44421,1),(44422,1),(44423,1),(44424,1),(44425,1),(44426,1),(44427,1),(44428,1),(44429,1),(44430,1),(44431,1),(44432,1),(44433,1),(44434,1),(44435,1),(44436,1),(44437,1),(44438,1),(44439,1),(44440,1),(44441,1),(44442,1),(44443,1),(44444,1),(44445,1),(44446,1),(44447,1),(44448,1),(44449,1),(44450,1),(44451,1),(44452,1),(44453,1),(44454,1),(44455,1),(44456,1),(44457,1),(44458,1),(44459,1),(44460,1),(44461,1),(44462,1),(44463,1),(44464,1),(44465,1),(44466,1),(44467,1),(44468,1),(44469,1),(44470,1),(44471,1),(44472,1),(44473,1),(44474,1),(44475,1),(44476,1),(44477,1),(44478,1),(44479,1),(44480,1),(44481,1),(44482,1),(44483,1),(44484,1),(44485,1),(44486,1),(44487,1),(44488,1),(44489,1),(44490,1),(44491,1),(44492,1),(44493,1),(44494,1),(44495,1),(44496,1),(44497,1),(44498,1),(44499,1),(44500,1),(44501,1),(44502,1),(44503,1),(44504,1),(44505,1),(44506,1),(44507,1),(44508,1),(44509,1),(44510,1),(44511,1),(44512,1),(44513,1),(44514,1),(44515,1),(44516,1),(44517,1),(44518,1),(44519,1),(44520,1),(44521,1),(44522,1),(44523,1),(44524,1),(44525,1),(44526,1),(44527,1),(44528,1),(44529,1),(44530,1),(44531,1),(44532,1),(44533,1),(44534,1),(44535,1),(44536,1),(44537,1),(44538,1),(44539,1),(44540,1),(44541,1),(44542,1),(44543,1),(44544,1),(44545,1),(44546,1),(44547,1),(44548,1),(44549,1),(44550,1),(44551,1),(44552,1),(44553,1),(44554,1),(44555,1),(44556,1),(44557,1),(44558,1),(44559,1),(44560,1),(44561,1),(44562,1),(44563,1),(44564,1),(44565,1),(44566,1),(44567,1),(44568,1),(44569,1),(44570,1),(44571,1),(44572,1),(44573,1),(44574,1),(44575,1),(44576,1),(44577,1),(44578,1),(44579,1),(44580,1),(44581,1),(44582,1),(44583,1),(44584,1),(44585,1),(44586,1),(44587,1),(44588,1),(44589,1),(44590,1),(44591,1),(44592,1),(44593,1),(44594,1),(44595,1),(44596,1),(44597,1),(44598,1),(44599,1),(44600,1),(44601,1),(44602,1),(44603,1),(44604,1),(44605,1),(44606,1),(44607,1),(44608,1),(44609,1),(44610,1),(44611,1),(44612,1),(44613,1),(44614,1),(44615,1),(44616,1),(44617,1),(44618,1),(44619,1),(44620,1),(44621,1),(44622,1),(44623,1),(44624,1),(44625,1),(44626,1),(44627,1),(44628,1),(44629,1),(44630,1),(44631,1),(44632,1),(44633,1),(44634,1),(44635,1),(44636,1),(44637,1),(44638,1),(44639,1),(44640,1),(44641,1),(44642,1),(44643,1),(44644,1),(44645,1),(44646,1),(44647,1),(44648,1),(44649,1),(44650,1),(44651,1),(44652,1),(44653,1),(44654,1),(44655,1),(44656,1),(44657,1),(44658,1),(44659,1),(44660,1),(44661,1),(44662,1),(44663,1),(44664,1),(44665,1),(44666,1),(44667,1),(44668,1),(44669,1),(44670,1),(44671,1),(44672,1),(44673,1),(44674,1),(44675,1),(44676,1),(44677,1),(44678,1),(44679,1),(44680,1),(44681,1),(44682,1),(44683,1),(44684,1),(44685,1),(44686,1),(44687,1),(44688,1),(44689,1),(44690,1),(44691,1),(44692,1),(44693,1),(44694,1),(44695,1),(44696,1),(44697,1),(44698,1),(44699,1),(44700,1),(44701,1),(44702,1),(44703,1),(44704,1),(44705,1),(44706,1),(44707,1),(44708,1),(44709,1),(44710,1),(44711,1),(44712,1),(44713,1),(44714,1),(44715,1),(44716,1),(44717,1),(44718,1),(44719,1),(44720,1),(44721,1),(44722,1),(44723,1),(44724,1),(44725,1),(44726,1),(44727,1),(44728,1),(44729,1),(44730,1),(44731,1),(44732,1),(44733,1),(44734,1),(44735,1),(44736,1),(44737,1),(44738,1),(44739,1),(44740,1),(44741,1),(44742,1),(44743,1),(44744,1),(44745,1),(44746,1),(44747,1),(44748,1),(44749,1),(44750,1),(44751,1),(44752,1),(44753,1),(44754,1),(44755,1),(44756,1),(44757,1),(44758,1),(44759,1),(44760,1),(44761,1),(44762,1),(44763,1),(44764,1),(44765,1),(44766,1),(44767,1),(44768,1),(44769,1),(44770,1),(44771,1),(44772,1),(44773,1),(44774,1),(44775,1),(44776,1),(44777,1),(44778,1),(44779,1),(44780,1),(44781,1),(44782,1),(44783,1),(44784,1),(44785,1),(44786,1),(44787,1),(44788,1),(44789,1),(44790,1),(44791,1),(44792,1),(44793,1),(44794,1),(44795,1),(44796,1),(44797,1),(44798,1),(44799,1),(44800,1),(44801,1),(44802,1),(44803,1),(44804,1),(44805,1),(44806,1),(44807,1),(44808,1),(44809,1),(44810,1),(44811,1),(44812,1),(44813,1),(44814,1),(44815,1),(44816,1),(44817,1),(44818,1),(44819,1),(44820,1),(44821,1),(44822,1),(44823,1),(44824,1),(44825,1),(44826,1),(44827,1),(44828,1),(44829,1),(44830,1),(44831,1),(44832,1),(44833,1),(44834,1),(44835,1),(44836,1),(44837,1),(44838,1),(44839,1),(44840,1),(44841,1),(44842,1),(44843,1),(44844,1),(44845,1),(44846,1),(44847,1),(44848,1),(44849,1),(44850,1),(44851,1),(44852,1),(44853,1),(44854,1),(44855,1),(44856,1),(44857,1),(44858,1),(44859,1),(44860,1),(44861,1),(44862,1),(44863,1),(44864,1),(44865,1),(44866,1),(44867,1),(44868,1),(44869,1),(44870,1),(44871,1),(44872,1),(44873,1),(44874,1),(44875,1),(44876,1),(44877,1),(44878,1),(44879,1),(44880,1),(44881,1),(44882,1),(44883,1),(44884,1),(44885,1),(44886,1),(44887,1),(44888,1),(44889,1),(44890,1),(44891,1),(44892,1),(44893,1),(44894,1),(44895,1),(44896,1),(44897,1),(44898,1),(44899,1),(44900,1),(44901,1),(44902,1),(44903,1),(44904,1),(44905,1),(44906,1),(44907,1),(44908,1),(44909,1),(44910,1),(44911,1),(44912,1),(44913,1),(44914,1),(44915,1),(44916,1),(44917,1),(44918,1),(44919,1),(44920,1),(44921,1),(44922,1),(44923,1),(44924,1),(44925,1),(44926,1),(44927,1),(44928,1),(44929,1),(44930,1),(44931,1),(44932,1),(44933,1),(44934,1),(44935,1),(44936,1),(44937,1),(44938,1),(44939,1),(44940,1),(44941,1),(44942,1),(44943,1),(44944,1),(44945,1),(44946,1),(44947,1),(44948,1),(44949,1),(44950,1),(44951,1),(44952,1),(44953,1),(44954,1),(44955,1),(44956,1),(44957,1),(44958,1),(44959,1),(44960,1),(44961,1),(44962,1),(44963,1),(44964,1),(44965,1),(44966,1),(44967,1),(44968,1),(44969,1),(44970,1),(44971,1),(44972,1),(44973,1),(44974,1),(44975,1),(44976,1),(44977,1),(44978,1),(44979,1),(44980,1),(44981,1),(44982,1),(44983,1),(44984,1),(44985,1),(44986,1),(44987,1),(44988,1),(44989,1),(44990,1),(44991,1),(44992,1),(44993,1),(44994,1),(44995,1),(44996,1),(44997,1),(44998,1),(44999,1),(45000,1),(45001,1),(45002,1),(45003,1),(45004,1),(45005,1),(45006,1),(45007,1),(45008,1),(45009,1),(45010,1),(45011,1),(45012,1),(45013,1),(45014,1),(45015,1),(45016,1),(45017,1),(45018,1),(45019,1),(45020,1),(45021,1),(45022,1),(45023,1),(45024,1),(45025,1),(45026,1),(45027,1),(45028,1),(45029,1),(45030,1),(45031,1),(45032,1),(45033,1),(45034,1),(45035,1),(45036,1),(45037,1),(45038,1),(45039,1),(45040,1),(45041,1),(45042,1),(45043,1),(45044,1),(45045,1),(45046,1),(45047,1),(45048,1),(45049,1),(45050,1),(45051,1),(45052,1),(45053,1),(45054,1),(45055,1),(45056,1),(45057,1),(45058,1),(45059,1),(45060,1),(45061,1),(45062,1),(45063,1),(45064,1),(45065,1),(45066,1),(45067,1),(45068,1),(45069,1),(45070,1),(45071,1),(45072,1),(45073,1),(45074,1),(45075,1),(45076,1),(45077,1),(45078,1),(45079,1),(45080,1),(45081,1),(45082,1),(45083,1),(45084,1),(45085,1),(45086,1),(45087,1),(45088,1),(45089,1),(45090,1),(45091,1),(45092,1),(45093,1),(45094,1),(45095,1),(45096,1),(45097,1),(45098,1),(45099,1),(45100,1),(45101,1),(45102,1),(45103,1),(45104,1),(45105,1),(45106,1),(45107,1),(45108,1),(45109,1),(45110,1),(45111,1),(45112,1),(45113,1),(45114,1),(45115,1),(45116,1),(45117,1),(45118,1),(45119,1),(45120,1),(45121,1),(45122,1),(45123,1),(45124,1),(45125,1),(45126,1),(45127,1),(45128,1),(45129,1),(45130,1),(45131,1),(45132,1),(45133,1),(45134,1),(45135,1),(45136,1),(45137,1),(45138,1),(45139,1),(45140,1),(45141,1),(45142,1),(45143,1),(45144,1),(45145,1),(45146,1),(45147,1),(45148,1),(45149,1),(45150,1),(45151,1),(45152,1),(45153,1),(45154,1),(45155,1),(45156,1),(45157,1),(45158,1),(45159,1),(45160,1),(45161,1),(45162,1),(45163,1),(45164,1),(45165,1),(45166,1),(45167,1),(45168,1),(45169,1),(45170,1),(45171,1),(45172,1),(45173,1),(45174,1),(45175,1),(45176,1),(45177,1),(45178,1),(45179,1),(45180,1),(45181,1),(45182,1),(45183,1),(45184,1),(45185,1),(45186,1),(45187,1),(45188,1),(45189,1),(45190,1),(45191,1),(45192,1),(45193,1),(45194,1),(45195,1),(45196,1),(45197,1),(45198,1),(45199,1),(45200,1),(45201,1),(45202,1),(45203,1),(45204,1),(45205,1),(45206,1),(45207,1),(45208,1),(45209,1),(45210,1),(45211,1),(45212,1),(45213,1),(45214,1),(45215,1),(45216,1),(45217,1),(45218,1),(45219,1),(45220,1),(45221,1),(45222,1),(45223,1),(45224,1),(45225,1),(45226,1),(45227,1),(45228,1),(45229,1),(45230,1),(45231,1),(45232,1),(45233,1),(45234,1),(45235,1),(45236,1),(45237,1),(45238,1),(45239,1),(45240,1),(45241,1),(45242,1),(45243,1),(45244,1),(45245,1),(45246,1),(45247,1),(45248,1),(45249,1),(45250,1),(45251,1),(45252,1),(45253,1),(45254,1),(45255,1),(45256,1),(45257,1),(45258,1),(45259,1),(45260,1),(45261,1),(45262,1),(45263,1),(45264,1),(45265,1),(45266,1),(45267,1),(45268,1),(45269,1),(45270,1),(45271,1),(45272,1),(45273,1),(45274,1),(45275,1),(45276,1),(45277,1),(45278,1),(45279,1),(45280,1),(45281,1),(45282,1),(45283,1),(45284,1),(45285,1),(45286,1),(45287,1),(45288,1),(45289,1),(45290,1),(45291,1),(45292,1),(45293,1),(45294,1),(45295,1),(45296,1),(45297,1),(45298,1),(45299,1),(45300,1),(45301,1),(45302,1),(45303,1),(45304,1),(45305,1),(45306,1),(45307,1),(45308,1),(45309,1),(45310,1),(45311,1),(45312,1),(45313,1),(45314,1),(45315,1),(45316,1),(45317,1),(45318,1),(45319,1),(45320,1),(45321,1),(45322,1),(45323,1),(45324,1),(45325,1),(45326,1),(45327,1),(45328,1),(45329,1),(45330,1),(45331,1),(45332,1),(45333,1),(45334,1),(45335,1),(45336,1),(45337,1),(45338,1),(45339,1),(45340,1),(45341,1),(45342,1),(45343,1),(45344,1),(45345,1),(45346,1),(45347,1),(45348,1),(45349,1),(45350,1),(45351,1),(45352,1),(45353,1),(45354,1),(45355,1),(45356,1),(45357,1),(45358,1),(45359,1),(45360,1),(45361,1),(45362,1),(45363,1),(45364,1),(45365,1),(45366,1),(45367,1),(45368,1),(45369,1),(45370,1),(45371,1),(45372,1),(45373,1),(45374,1),(45375,1),(45376,1),(45377,1),(45378,1),(45379,1),(45380,1),(45381,1),(45382,1),(45383,1),(45384,1),(45385,1),(45386,1),(45387,1),(45388,1),(45389,1),(45390,1),(45391,1),(45392,1),(45393,1),(45394,1),(45395,1),(45396,1),(45397,1),(45398,1),(45399,1),(45400,1),(45401,1),(45402,1),(45403,1),(45404,1),(45405,1),(45406,1),(45407,1),(45408,1),(45409,1),(45410,1),(45411,1),(45412,1),(45413,1),(45414,1),(45415,1),(45416,1),(45417,1),(45418,1),(45419,1),(45420,1),(45421,1),(45422,1),(45423,1),(45424,1),(45425,1),(45426,1),(45427,1),(45428,1),(45429,1),(45430,1),(45431,1),(45432,1),(45433,1),(45434,1),(45435,1),(45436,1),(45437,1),(45438,1),(45439,1),(45440,1),(45441,1),(45442,1),(45443,1),(45444,1),(45445,1),(45446,1),(45447,1),(45448,1),(45449,1),(45450,1),(45451,1),(45452,1),(45453,1),(45454,1),(45455,1),(45456,1),(45457,1),(45458,1),(45459,1),(45460,1),(45461,1),(45462,1),(45463,1),(45464,1),(45465,1),(45466,1),(45467,1),(45468,1),(45469,1),(45470,1),(45471,1),(45472,1),(45473,1),(45474,1),(45475,1),(45476,1),(45477,1),(45478,1),(45479,1),(45480,1),(45481,1),(45482,1),(45483,1),(45484,1),(45485,1),(45486,1),(45487,1),(45488,1),(45489,1),(45490,1),(45491,1),(45492,1),(45493,1),(45494,1),(45495,1),(45496,1),(45497,1),(45498,1),(45499,1),(45500,1),(45501,1),(45502,1),(45503,1),(45504,1),(45505,1),(45506,1),(45507,1),(45508,1),(45509,1),(45510,1),(45511,1),(45512,1),(45513,1),(45514,1),(45515,1),(45516,1),(45517,1),(45518,1),(45519,1),(45520,1),(45521,1),(45522,1),(45523,1),(45524,1),(45525,1),(45526,1),(45527,1),(45528,1),(45529,1),(45530,1),(45531,1),(45532,1),(45533,1),(45534,1),(45535,1),(45536,1),(45537,1),(45538,1),(45539,1),(45540,1),(45541,1),(45542,1),(45543,1),(45544,1),(45545,1),(45546,1),(45547,1),(45548,1),(45549,1),(45550,1),(45551,1),(45552,1),(45553,1),(45554,1),(45555,1),(45556,1),(45557,1),(45558,1),(45559,1),(45560,1),(45561,1),(45562,1),(45563,1),(45564,1),(45565,1),(45566,1),(45567,1),(45568,1),(45569,1),(45570,1),(45571,1),(45572,1),(45573,1),(45574,1),(45575,1),(45576,1),(45577,1),(45578,1),(45579,1),(45580,1),(45581,1),(45582,1),(45583,1),(45584,1),(45585,1),(45586,1),(45587,1),(45588,1),(45589,1),(45590,1),(45591,1),(45592,1),(45593,1),(45594,1),(45595,1),(45596,1),(45597,1),(45598,1),(45599,1),(45600,1),(45601,1),(45602,1),(45603,1),(45604,1),(45605,1),(45606,1),(45607,1),(45608,1),(45609,1),(45610,1),(45611,1),(45612,1),(45613,1),(45614,1),(45615,1),(45616,1),(45617,1),(45618,1),(45619,1),(45620,1),(45621,1),(45622,1),(45623,1),(45624,1),(45625,1),(45626,1),(45627,1),(45628,1),(45629,1),(45630,1),(45631,1),(45632,1),(45633,1),(45634,1),(45635,1),(45636,1),(45637,1),(45638,1),(45639,1),(45640,1),(45641,1),(45642,1),(45643,1),(45644,1),(45645,1),(45646,1),(45647,1),(45648,1),(45649,1),(45650,1),(45651,1),(45652,1),(45653,1),(45654,1),(45655,1),(45656,1),(45657,1),(45658,1),(45659,1),(45660,1),(45661,1),(45662,1),(45663,1),(45664,1),(45665,1),(45666,1),(45667,1),(45668,1),(45669,1),(45670,1),(45671,1),(45672,1),(45673,1),(45674,1),(45675,1),(45676,1),(45677,1),(45678,1),(45679,1),(45680,1),(45681,1),(45682,1),(45683,1),(45684,1),(45685,1),(45686,1),(45687,1),(45688,1),(45689,1),(45690,1),(45691,1),(45692,1),(45693,1),(45694,1),(45695,1),(45696,1),(45697,1),(45698,1),(45699,1),(45700,1),(45701,1),(45702,1),(45703,1),(45704,1),(45705,1),(45706,1),(45707,1),(45708,1),(45709,1),(45710,1),(45711,1),(45712,1),(45713,1),(45714,1),(45715,1),(45716,1),(45717,1),(45718,1),(45719,1),(45720,1),(45721,1),(45722,1),(45723,1),(45724,1),(45725,1),(45726,1),(45727,1),(45728,1),(45729,1),(45730,1),(45731,1),(45732,1),(45733,1),(45734,1),(45735,1),(45736,1),(45737,1),(45738,1),(45739,1),(45740,1),(45741,1),(45742,1),(45743,1),(45744,1),(45745,1),(45746,1),(45747,1),(45748,1),(45749,1),(45750,1),(45751,1),(45752,1),(45753,1),(45754,1),(45755,1),(45756,1),(45757,1),(45758,1),(45759,1),(45760,1),(45761,1),(45762,1),(45763,1),(45764,1),(45765,1),(45766,1),(45767,1),(45768,1),(45769,1),(45770,1),(45771,1),(45772,1),(45773,1),(45774,1),(45775,1),(45776,1),(45777,1),(45778,1),(45779,1),(45780,1),(45781,1),(45782,1),(45783,1),(45784,1),(45785,1),(45786,1),(45787,1),(45788,1),(45789,1),(45790,1),(45791,1),(45792,1),(45793,1),(45794,1),(45795,1),(45796,1),(45797,1),(45798,1),(45799,1),(45800,1),(45801,1),(45802,1),(45803,1),(45804,1),(45805,1),(45806,1),(45807,1),(45808,1),(45809,1),(45810,1),(45811,1),(45812,1),(45813,1),(45814,1),(45815,1),(45816,1),(45817,1),(45818,1),(45819,1),(45820,1),(45821,1),(45822,1),(45823,1),(45824,1),(45825,1),(45826,1),(45827,1),(45828,1),(45829,1),(45830,1),(45831,1),(45832,1),(45833,1),(45834,1),(45835,1),(45836,1),(45837,1),(45838,1),(45839,1),(45840,1),(45841,1),(45842,1),(45843,1),(45844,1),(45845,1),(45846,1),(45847,1),(45848,1),(45849,1),(45850,1),(45851,1),(45852,1),(45853,1),(45854,1),(45855,1),(45856,1),(45857,1),(45858,1),(45859,1),(45860,1),(45861,1),(45862,1),(45863,1),(45864,1),(45865,1),(45866,1),(45867,1),(45868,1),(45869,1),(45870,1),(45871,1),(45872,1),(45873,1),(45874,1),(45875,1),(45876,1),(45877,1),(45878,1),(45879,1),(45880,1),(45881,1),(45882,1),(45883,1),(45884,1),(45885,1),(45886,1),(45887,1),(45888,1),(45889,1),(45890,1),(45891,1),(45892,1),(45893,1),(45894,1),(45895,1),(45896,1),(45897,1),(45898,1),(45899,1),(45900,1),(45901,1),(45902,1),(45903,1),(45904,1),(45905,1),(45906,1),(45907,1),(45908,1),(45909,1),(45910,1),(45911,1),(45912,1),(45913,1),(45914,1),(45915,1),(45916,1),(45917,1),(45918,1),(45919,1),(45920,1),(45921,1),(45922,1),(45923,1),(45924,1),(45925,1),(45926,1),(45927,1),(45928,1),(45929,1),(45930,1),(45931,1),(45932,1),(45933,1),(45934,1),(45935,1),(45936,1),(45937,1),(45938,1),(45939,1),(45940,1),(45941,1),(45942,1),(45943,1),(45944,1),(45945,1),(45946,1),(45947,1),(45948,1),(45949,1),(45950,1),(45951,1),(45952,1),(45953,1),(45954,1),(45955,1),(45956,1),(45957,1),(45958,1),(45959,1),(45960,1),(45961,1),(45962,1),(45963,1),(45964,1),(45965,1),(45966,1),(45967,1),(45968,1),(45969,1),(45970,1),(45971,1),(45972,1),(45973,1),(45974,1),(45975,1),(45976,1),(45977,1),(45978,1),(45979,1),(45980,1),(45981,1),(45982,1),(45983,1),(45984,1),(45985,1),(45986,1),(45987,1),(45988,1),(45989,1),(45990,1),(45991,1),(45992,1),(45993,1),(45994,1),(45995,1),(45996,1),(45997,1),(45998,1),(45999,1),(46000,1),(46001,1),(46002,1),(46003,1),(46004,1),(46005,1),(46006,1),(46007,1),(46008,1),(46009,1),(46010,1),(46011,1),(46012,1),(46013,1),(46014,1),(46015,1),(46016,1),(46017,1),(46018,1),(46019,1),(46020,1),(46021,1),(46022,1),(46023,1),(46024,1),(46025,1),(46026,1),(46027,1),(46028,1),(46029,1),(46030,1),(46031,1),(46032,1),(46033,1),(46034,1),(46035,1),(46036,1),(46037,1),(46038,1),(46039,1),(46040,1),(46041,1),(46042,1),(46043,1),(46044,1),(46045,1),(46046,1),(46047,1),(46048,1),(46049,1),(46050,1),(46051,1),(46052,1),(46053,1),(46054,1),(46055,1),(46056,1),(46057,1),(46058,1),(46059,1),(46060,1),(46061,1),(46062,1),(46063,1),(46064,1),(46065,1),(46066,1),(46067,1),(46068,1),(46069,1),(46070,1),(46071,1),(46072,1),(46073,1),(46074,1),(46075,1),(46076,1),(46077,1),(46078,1),(46079,1),(46080,1),(46081,1),(46082,1),(46083,1),(46084,1),(46085,1),(46086,1),(46087,1),(46088,1),(46089,1),(46090,1),(46091,1),(46092,1),(46093,1),(46094,1),(46095,1),(46096,1),(46097,1),(46098,1),(46099,1),(46100,1),(46101,1),(46102,1),(46103,1),(46104,1),(46105,1),(46106,1),(46107,1),(46108,1),(46109,1),(46110,1),(46111,1),(46112,1),(46113,1),(46114,1),(46115,1),(46116,1),(46117,1),(46118,1),(46119,1),(46120,1),(46121,1),(46122,1),(46123,1),(46124,1),(46125,1),(46126,1),(46127,1),(46128,1),(46129,1),(46130,1),(46131,1),(46132,1),(46133,1),(46134,1),(46135,1),(46136,1),(46137,1),(46138,1),(46139,1),(46140,1),(46141,1),(46142,1),(46143,1),(46144,1),(46145,1),(46146,1),(46147,1),(46148,1),(46149,1),(46150,1),(46151,1),(46152,1),(46153,1),(46154,1),(46155,1),(46156,1),(46157,1),(46158,1),(46159,1),(46160,1),(46161,1),(46162,1),(46163,1),(46164,1),(46165,1),(46166,1),(46167,1),(46168,1),(46169,1),(46170,1),(46171,1),(46172,1),(46173,1),(46174,1),(46175,1),(46176,1),(46177,1),(46178,1),(46179,1),(46180,1),(46181,1),(46182,1),(46183,1),(46184,1),(46185,1),(46186,1),(46187,1),(46188,1),(46189,1),(46190,1),(46191,1),(46192,1),(46193,1),(46194,1),(46195,1),(46196,1),(46197,1),(46198,1),(46199,1),(46200,1),(46201,1),(46202,1),(46203,1),(46204,1),(46205,1),(46206,1),(46207,1),(46208,1),(46209,1),(46210,1),(46211,1),(46212,1),(46213,1),(46214,1),(46215,1),(46216,1),(46217,1),(46218,1),(46219,1),(46220,1),(46221,1),(46222,1),(46223,1),(46224,1),(46225,1),(46226,1),(46227,1),(46228,1),(46229,1),(46230,1),(46231,1),(46232,1),(46233,1),(46234,1),(46235,1),(46236,1),(46237,1),(46238,1),(46239,1),(46240,1),(46241,1),(46242,1),(46243,1),(46244,1),(46245,1),(46246,1),(46247,1),(46248,1),(46249,1),(46250,1),(46251,1),(46252,1),(46253,1),(46254,1),(46255,1),(46256,1),(46257,1),(46258,1),(46259,1),(46260,1),(46261,1),(46262,1),(46263,1),(46264,1),(46265,1),(46266,1),(46267,1),(46268,1),(46269,1),(46270,1),(46271,1),(46272,1),(46273,1),(46274,1),(46275,1),(46276,1),(46277,1),(46278,1),(46279,1),(46280,1),(46281,1),(46282,1),(46283,1),(46284,1),(46285,1),(46286,1),(46287,1),(46288,1),(46289,1),(46290,1),(46291,1),(46292,1),(46293,1),(46294,1),(46295,1),(46296,1),(46297,1),(46298,1),(46299,1),(46300,1),(46301,1),(46302,1),(46303,1),(46304,1),(46305,1),(46306,1),(46307,1),(46308,1),(46309,1),(46310,1),(46311,1),(46312,1),(46313,1),(46314,1),(46315,1),(46316,1),(46317,1),(46318,1),(46319,1),(46320,1),(46321,1),(46322,1),(46323,1),(46324,1),(46325,1),(46326,1),(46327,1),(46328,1),(46329,1),(46330,1),(46331,1),(46332,1),(46333,1),(46334,1),(46335,1),(46336,1),(46337,1),(46338,1),(46339,1),(46340,1),(46341,1),(46342,1),(46343,1),(46344,1),(46345,1),(46346,1),(46347,1),(46348,1),(46349,1),(46350,1),(46351,1),(46352,1),(46353,1),(46354,1),(46355,1),(46356,1),(46357,1),(46358,1),(46359,1),(46360,1),(46361,1),(46362,1),(46363,1),(46364,1),(46365,1),(46366,1),(46367,1),(46368,1),(46369,1),(46370,1),(46371,1),(46372,1),(46373,1),(46374,1),(46375,1),(46376,1),(46377,1),(46378,1),(46379,1),(46380,1),(46381,1),(46382,1),(46383,1),(46384,1),(46385,1),(46386,1),(46387,1),(46388,1),(46389,1),(46390,1),(46391,1),(46392,1),(46393,1),(46394,1),(46395,1),(46396,1),(46397,1),(46398,1),(46399,1),(46400,1),(46401,1),(46402,1),(46403,1),(46404,1),(46405,1),(46406,1),(46407,1),(46408,1),(46409,1),(46410,1),(46411,1),(46412,1),(46413,1),(46414,1),(46415,1),(46416,1),(46417,1),(46418,1),(46419,1),(46420,1),(46421,1),(46422,1),(46423,1),(46424,1),(46425,1),(46426,1),(46427,1),(46428,1),(46429,1),(46430,1),(46431,1),(46432,1),(46433,1),(46434,1),(46435,1),(46436,1),(46437,1),(46438,1),(46439,1),(46440,1),(46441,1),(46442,1),(46443,1),(46444,1),(46445,1),(46446,1),(46447,1),(46448,1),(46449,1),(46450,1),(46451,1),(46452,1),(46453,1),(46454,1),(46455,1),(46456,1),(46457,1),(46458,1),(46459,1),(46460,1),(46461,1),(46462,1),(46463,1),(46464,1),(46465,1),(46466,1),(46467,1),(46468,1),(46469,1),(46470,1),(46471,1),(46472,1),(46473,1),(46474,1),(46475,1),(46476,1),(46477,1),(46478,1),(46479,1),(46480,1),(46481,1),(46482,1),(46483,1),(46484,1),(46485,1),(46486,1),(46487,1),(46488,1),(46489,1),(46490,1),(46491,1),(46492,1),(46493,1),(46494,1),(46495,1),(46496,1),(46497,1),(46498,1),(46499,1),(46500,1),(46501,1),(46502,1),(46503,1),(46504,1),(46505,1),(46506,1),(46507,1),(46508,1),(46509,1),(46510,1),(46511,1),(46512,1),(46513,1),(46514,1),(46515,1),(46516,1),(46517,1),(46518,1),(46519,1),(46520,1),(46521,1),(46522,1),(46523,1),(46524,1),(46525,1),(46526,1),(46527,1),(46528,1),(46529,1),(46530,1),(46531,1),(46532,1),(46533,1),(46534,1),(46535,1),(46536,1),(46537,1),(46538,1),(46539,1),(46540,1),(46541,1),(46542,1),(46543,1),(46544,1),(46545,1),(46546,1),(46547,1),(46548,1),(46549,1),(46550,1),(46551,1),(46552,1),(46553,1),(46554,1),(46555,1),(46556,1),(46557,1),(46558,1),(46559,1),(46560,1),(46561,1),(46562,1),(46563,1),(46564,1),(46565,1),(46566,1),(46567,1),(46568,1),(46569,1),(46570,1),(46571,1),(46572,1),(46573,1),(46574,1),(46575,1),(46576,1),(46577,1),(46578,1),(46579,1),(46580,1),(46581,1),(46582,1),(46583,1),(46584,1),(46585,1),(46586,1),(46587,1),(46588,1),(46589,1),(46590,1),(46591,1),(46592,1),(46593,1),(46594,1),(46595,1),(46596,1),(46597,1),(46598,1),(46599,1),(46600,1),(46601,1),(46602,1),(46603,1),(46604,1),(46605,1),(46606,1),(46607,1),(46608,1),(46609,1),(46610,1),(46611,1),(46612,1),(46613,1),(46614,1),(46615,1),(46616,1),(46617,1),(46618,1),(46619,1),(46620,1),(46621,1),(46622,1),(46623,1),(46624,1),(46625,1),(46626,1),(46627,1),(46628,1),(46629,1),(46630,1),(46631,1),(46632,1),(46633,1),(46634,1),(46635,1),(46636,1),(46637,1),(46638,1),(46639,1),(46640,1),(46641,1),(46642,1),(46643,1),(46644,1),(46645,1),(46646,1),(46647,1),(46648,1),(46649,1),(46650,1),(46651,1),(46652,1),(46653,1),(46654,1),(46655,1),(46656,1),(46657,1),(46658,1),(46659,1),(46660,1),(46661,1),(46662,1),(46663,1),(46664,1),(46665,1),(46666,1),(46667,1),(46668,1),(46669,1),(46670,1),(46671,1),(46672,1),(46673,1),(46674,1),(46675,1),(46676,1),(46677,1),(46678,1),(46679,1),(46680,1),(46681,1),(46682,1),(46683,1),(46684,1),(46685,1),(46686,1),(46687,1),(46688,1),(46689,1),(46690,1),(46691,1),(46692,1),(46693,1),(46694,1),(46695,1),(46696,1),(46697,1),(46698,1),(46699,1),(46700,1),(46701,1),(46702,1),(46703,1),(46704,1),(46705,1),(46706,1),(46707,1),(46708,1),(46709,1),(46710,1),(46711,1),(46712,1),(46713,1),(46714,1),(46715,1),(46716,1),(46717,1),(46718,1),(46719,1),(46720,1),(46721,1),(46722,1),(46723,1),(46724,1),(46725,1),(46726,1),(46727,1),(46728,1),(46729,1),(46730,1),(46731,1),(46732,1),(46733,1),(46734,1),(46735,1),(46736,1),(46737,1),(46738,1),(46739,1),(46740,1),(46741,1),(46742,1),(46743,1),(46744,1),(46745,1),(46746,1),(46747,1),(46748,1),(46749,1),(46750,1),(46751,1),(46752,1),(46753,1),(46754,1),(46755,1),(46756,1),(46757,1),(46758,1),(46759,1),(46760,1),(46761,1),(46762,1),(46763,1),(46764,1),(46765,1),(46766,1),(46767,1),(46768,1),(46769,1),(46770,1),(46771,1),(46772,1),(46773,1),(46774,1),(46775,1),(46776,1),(46777,1),(46778,1),(46779,1),(46780,1),(46781,1),(46782,1),(46783,1),(46784,1),(46785,1),(46786,1),(46787,1),(46788,1),(46789,1),(46790,1),(46791,1),(46792,1),(46793,1),(46794,1),(46795,1),(46796,1),(46797,1),(46798,1),(46799,1),(46800,1),(46801,1),(46802,1),(46803,1),(46804,1),(46805,1),(46806,1),(46807,1),(46808,1),(46809,1),(46810,1),(46811,1),(46812,1),(46813,1),(46814,1),(46815,1),(46816,1),(46817,1),(46818,1),(46819,1),(46820,1),(46821,1),(46822,1),(46823,1),(46824,1),(46825,1),(46826,1),(46827,1),(46828,1),(46829,1),(46830,1),(46831,1),(46832,1),(46833,1),(46834,1),(46835,1),(46836,1),(46837,1),(46838,1),(46839,1),(46840,1),(46841,1),(46842,1),(46843,1),(46844,1),(46845,1),(46846,1),(46847,1),(46848,1),(46849,1),(46850,1),(46851,1),(46852,1),(46853,1),(46854,1),(46855,1),(46856,1),(46857,1),(46858,1),(46859,1),(46860,1),(46861,1),(46862,1),(46863,1),(46864,1),(46865,1),(46866,1),(46867,1),(46868,1),(46869,1),(46870,1),(46871,1),(46872,1),(46873,1),(46874,1),(46875,1),(46876,1),(46877,1),(46878,1),(46879,1),(46880,1),(46881,1),(46882,1),(46883,1),(46884,1),(46885,1),(46886,1),(46887,1),(46888,1),(46889,1),(46890,1),(46891,1),(46892,1),(46893,1),(46894,1),(46895,1),(46896,1),(46897,1),(46898,1),(46899,1),(46900,1),(46901,1),(46902,1),(46903,1),(46904,1),(46905,1),(46906,1),(46907,1),(46908,1),(46909,1),(46910,1),(46911,1),(46912,1),(46913,1),(46914,1),(46915,1),(46916,1),(46917,1),(46918,1),(46919,1),(46920,1),(46921,1),(46922,1),(46923,1),(46924,1),(46925,1),(46926,1),(46927,1),(46928,1),(46929,1),(46930,1),(46931,1),(46932,1),(46933,1),(46934,1),(46935,1),(46936,1),(46937,1),(46938,1),(46939,1),(46940,1),(46941,1),(46942,1),(46943,1),(46944,1),(46945,1),(46946,1),(46947,1),(46948,1),(46949,1),(46950,1),(46951,1),(46952,1),(46953,1),(46954,1),(46955,1),(46956,1),(46957,1),(46958,1),(46959,1),(46960,1),(46961,1),(46962,1),(46963,1),(46964,1),(46965,1),(46966,1),(46967,1),(46968,1),(46969,1),(46970,1),(46971,1),(46972,1),(46973,1),(46974,1),(46975,1),(46976,1),(46977,1),(46978,1),(46979,1),(46980,1),(46981,1),(46982,1),(46983,1),(46984,1),(46985,1),(46986,1),(46987,1),(46988,1),(46989,1),(46990,1),(46991,1),(46992,1),(46993,1),(46994,1),(46995,1),(46996,1),(46997,1),(46998,1),(46999,1),(47000,1),(47001,1),(47002,1),(47003,1),(47004,1),(47005,1),(47006,1),(47007,1),(47008,1),(47009,1),(47010,1),(47011,1),(47012,1),(47013,1),(47014,1),(47015,1),(47016,1),(47017,1),(47018,1),(47019,1),(47020,1),(47021,1),(47022,1),(47023,1),(47024,1),(47025,1),(47026,1),(47027,1),(47028,1),(47029,1),(47030,1),(47031,1),(47032,1),(47033,1),(47034,1),(47035,1),(47036,1),(47037,1),(47038,1),(47039,1),(47040,1),(47041,1),(47042,1),(47043,1),(47044,1),(47045,1),(47046,1),(47047,1),(47048,1),(47049,1),(47050,1),(47051,1),(47052,1),(47053,1),(47054,1),(47055,1),(47056,1),(47057,1),(47058,1),(47059,1),(47060,1),(47061,1),(47062,1),(47063,1),(47064,1),(47065,1),(47066,1),(47067,1),(47068,1),(47069,1),(47070,1),(47071,1),(47072,1),(47073,1),(47074,1),(47075,1),(47076,1),(47077,1),(47078,1),(47079,1),(47080,1),(47081,1),(47082,1),(47083,1),(47084,1),(47085,1),(47086,1),(47087,1),(47088,1),(47089,1),(47090,1),(47091,1),(47092,1),(47093,1),(47094,1),(47095,1),(47096,1),(47097,1),(47098,1),(47099,1),(47100,1),(47101,1),(47102,1),(47103,1),(47104,1),(47105,1),(47106,1),(47107,1),(47108,1),(47109,1),(47110,1),(47111,1),(47112,1),(47113,1),(47114,1),(47115,1),(47116,1),(47117,1),(47118,1),(47119,1),(47120,1),(47121,1),(47122,1),(47123,1),(47124,1),(47125,1),(47126,1),(47127,1),(47128,1),(47129,1),(47130,1),(47131,1),(47132,1),(47133,1),(47134,1),(47135,1),(47136,1),(47137,1),(47138,1),(47139,1),(47140,1),(47141,1),(47142,1),(47143,1),(47144,1),(47145,1),(47146,1),(47147,1),(47148,1),(47149,1),(47150,1),(47151,1),(47152,1),(47153,1),(47154,1),(47155,1),(47156,1),(47157,1),(47158,1),(47159,1),(47160,1),(47161,1),(47162,1),(47163,1),(47164,1),(47165,1),(47166,1),(47167,1),(47168,1),(47169,1),(47170,1),(47171,1),(47172,1),(47173,1),(47174,1),(47175,1),(47176,1),(47177,1),(47178,1),(47179,1),(47180,1),(47181,1),(47182,1),(47183,1),(47184,1),(47185,1),(47186,1),(47187,1),(47188,1),(47189,1),(47190,1),(47191,1),(47192,1),(47193,1),(47194,1),(47195,1),(47196,1),(47197,1),(47198,1),(47199,1),(47200,1),(47201,1),(47202,1),(47203,1),(47204,1),(47205,1),(47206,1),(47207,1),(47208,1),(47209,1),(47210,1),(47211,1),(47212,1),(47213,1),(47214,1),(47215,1),(47216,1),(47217,1),(47218,1),(47219,1),(47220,1),(47221,1),(47222,1),(47223,1),(47224,1),(47225,1),(47226,1),(47227,1),(47228,1),(47229,1),(47230,1),(47231,1),(47232,1),(47233,1),(47234,1),(47235,1),(47236,1),(47237,1),(47238,1),(47239,1),(47240,1),(47241,1),(47242,1),(47243,1),(47244,1),(47245,1),(47246,1),(47247,1),(47248,1),(47249,1),(47250,1),(47251,1),(47252,1),(47253,1),(47254,1),(47255,1),(47256,1),(47257,1),(47258,1),(47259,1),(47260,1),(47261,1),(47262,1),(47263,1),(47264,1),(47265,1),(47266,1),(47267,1),(47268,1),(47269,1),(47270,1),(47271,1),(47272,1),(47273,1),(47274,1),(47275,1),(47276,1),(47277,1),(47278,1),(47279,1),(47280,1),(47281,1),(47282,1),(47283,1),(47284,1),(47285,1),(47286,1),(47287,1),(47288,1),(47289,1),(47290,1),(47291,1),(47292,1),(47293,1),(47294,1),(47295,1),(47296,1),(47297,1),(47298,1),(47299,1),(47300,1),(47301,1),(47302,1),(47303,1),(47304,1),(47305,1),(47306,1),(47307,1),(47308,1),(47309,1),(47310,1),(47311,1),(47312,1),(47313,1),(47314,1),(47315,1),(47316,1),(47317,1),(47318,1),(47319,1),(47320,1),(47321,1),(47322,1),(47323,1),(47324,1),(47325,1),(47326,1),(47327,1),(47328,1),(47329,1),(47330,1),(47331,1),(47332,1),(47333,1),(47334,1),(47335,1),(47336,1),(47337,1),(47338,1),(47339,1),(47340,1),(47341,1),(47342,1),(47343,1),(47344,1),(47345,1),(47346,1),(47347,1),(47348,1),(47349,1),(47350,1),(47351,1),(47352,1),(47353,1),(47354,1),(47355,1),(47356,1),(47357,1),(47358,1),(47359,1),(47360,1),(47361,1),(47362,1),(47363,1),(47364,1),(47365,1),(47366,1),(47367,1),(47368,1),(47369,1),(47370,1),(47371,1),(47372,1),(47373,1),(47374,1),(47375,1),(47376,1),(47377,1),(47378,1),(47379,1),(47380,1),(47381,1),(47382,1),(47383,1),(47384,1),(47385,1),(47386,1),(47387,1),(47388,1),(47389,1),(47390,1),(47391,1),(47392,1),(47393,1),(47394,1),(47395,1),(47396,1),(47397,1),(47398,1),(47399,1),(47400,1),(47401,1),(47402,1),(47403,1),(47404,1),(47405,1),(47406,1),(47407,1),(47408,1),(47409,1),(47410,1),(47411,1),(47412,1),(47413,1),(47414,1),(47415,1),(47416,1),(47417,1),(47418,1),(47419,1),(47420,1),(47421,1),(47422,1),(47423,1),(47424,1),(47425,1),(47426,1),(47427,1),(47428,1),(47429,1),(47430,1),(47431,1),(47432,1),(47433,1),(47434,1),(47435,1),(47436,1),(47437,1),(47438,1),(47439,1),(47440,1),(47441,1),(47442,1),(47443,1),(47444,1),(47445,1),(47446,1),(47447,1),(47448,1),(47449,1),(47450,1),(47451,1),(47452,1),(47453,1),(47454,1),(47455,1),(47456,1),(47457,1),(47458,1),(47459,1),(47460,1),(47461,1),(47462,1),(47463,1),(47464,1),(47465,1),(47466,1),(47467,1),(47468,1),(47469,1),(47470,1),(47471,1),(47472,1),(47473,1),(47474,1),(47475,1),(47476,1),(47477,1),(47478,1),(47479,1),(47480,1),(47481,1),(47482,1),(47483,1),(47484,1),(47485,1),(47486,1),(47487,1),(47488,1),(47489,1),(47490,1),(47491,1),(47492,1),(47493,1),(47494,1),(47495,1),(47496,1),(47497,1),(47498,1),(47499,1),(47500,1),(47501,1),(47502,1),(47503,1),(47504,1),(47505,1),(47506,1),(47507,1),(47508,1),(47509,1),(47510,1),(47511,1),(47512,1),(47513,1),(47514,1),(47515,1),(47516,1),(47517,1),(47518,1),(47519,1),(47520,1),(47521,1),(47522,1),(47523,1),(47524,1),(47525,1),(47526,1),(47527,1),(47528,1),(47529,1),(47530,1),(47531,1),(47532,1),(47533,1),(47534,1),(47535,1),(47536,1),(47537,1),(47538,1),(47539,1),(47540,1),(47541,1),(47542,1),(47543,1),(47544,1),(47545,1),(47546,1),(47547,1),(47548,1),(47549,1),(47550,1),(47551,1),(47552,1),(47553,1),(47554,1),(47555,1),(47556,1),(47557,1),(47558,1),(47559,1),(47560,1),(47561,1),(47562,1),(47563,1),(47564,1),(47565,1),(47566,1),(47567,1),(47568,1),(47569,1),(47570,1),(47571,1),(47572,1),(47573,1),(47574,1),(47575,1),(47576,1),(47577,1),(47578,1),(47579,1),(47580,1),(47581,1),(47582,1),(47583,1),(47584,1),(47585,1),(47586,1),(47587,1),(47588,1),(47589,1),(47590,1),(47591,1),(47592,1),(47593,1),(47594,1),(47595,1),(47596,1),(47597,1),(47598,1),(47599,1),(47600,1),(47601,1),(47602,1),(47603,1),(47604,1),(47605,1),(47606,1),(47607,1),(47608,1),(47609,1),(47610,1),(47611,1),(47612,1),(47613,1),(47614,1),(47615,1),(47616,1),(47617,1),(47618,1),(47619,1),(47620,1),(47621,1),(47622,1),(47623,1),(47624,1),(47625,1),(47626,1),(47627,1),(47628,1),(47629,1),(47630,1),(47631,1),(47632,1),(47633,1),(47634,1),(47635,1),(47636,1),(47637,1),(47638,1),(47639,1),(47640,1),(47641,1),(47642,1),(47643,1),(47644,1),(47645,1),(47646,1),(47647,1),(47648,1),(47649,1),(47650,1),(47651,1),(47652,1),(47653,1),(47654,1),(47655,1),(47656,1),(47657,1),(47658,1),(47659,1),(47660,1),(47661,1),(47662,1),(47663,1),(47664,1),(47665,1),(47666,1),(47667,1),(47668,1),(47669,1),(47670,1),(47671,1),(47672,1),(47673,1),(47674,1),(47675,1),(47676,1),(47677,1),(47678,1),(47679,1),(47680,1),(47681,1),(47682,1),(47683,1),(47684,1),(47685,1),(47686,1),(47687,1),(47688,1),(47689,1),(47690,1),(47691,1),(47692,1),(47693,1),(47694,1),(47695,1),(47696,1),(47697,1),(47698,1),(47699,1),(47700,1),(47701,1),(47702,1),(47703,1),(47704,1),(47705,1),(47706,1),(47707,1),(47708,1),(47709,1),(47710,1),(47711,1),(47712,1),(47713,1),(47714,1),(47715,1),(47716,1),(47717,1),(47718,1),(47719,1),(47720,1),(47721,1),(47722,1),(47723,1),(47724,1),(47725,1),(47726,1),(47727,1),(47728,1),(47729,1),(47730,1),(47731,1),(47732,1),(47733,1),(47734,1),(47735,1),(47736,1),(47737,1),(47738,1),(47739,1),(47740,1),(47741,1),(47742,1),(47743,1),(47744,1),(47745,1),(47746,1),(47747,1),(47748,1),(47749,1),(47750,1),(47751,1),(47752,1),(47753,1),(47754,1),(47755,1),(47756,1),(47757,1),(47758,1),(47759,1),(47760,1),(47761,1),(47762,1),(47763,1),(47764,1),(47765,1),(47766,1),(47767,1),(47768,1),(47769,1),(47770,1),(47771,1),(47772,1),(47773,1),(47774,1),(47775,1),(47776,1),(47777,1),(47778,1),(47779,1),(47780,1),(47781,1),(47782,1),(47783,1),(47784,1),(47785,1),(47786,1),(47787,1),(47788,1),(47789,1),(47790,1),(47791,1),(47792,1),(47793,1),(47794,1),(47795,1),(47796,1),(47797,1),(47798,1),(47799,1),(47800,1),(47801,1),(47802,1),(47803,1),(47804,1),(47805,1),(47806,1),(47807,1),(47808,1),(47809,1),(47810,1),(47811,1),(47812,1),(47813,1),(47814,1),(47815,1),(47816,1),(47817,1),(47818,1),(47819,1),(47820,1),(47821,1),(47822,1),(47823,1),(47824,1),(47825,1),(47826,1),(47827,1),(47828,1),(47829,1),(47830,1),(47831,1),(47832,1),(47833,1),(47834,1),(47835,1),(47836,1),(47837,1),(47838,1),(47839,1),(47840,1),(47841,1),(47842,1),(47843,1),(47844,1),(47845,1),(47846,1),(47847,1),(47848,1),(47849,1),(47850,1),(47851,1),(47852,1),(47853,1),(47854,1),(47855,1),(47856,1),(47857,1),(47858,1),(47859,1),(47860,1),(47861,1),(47862,1),(47863,1),(47864,1),(47865,1),(47866,1),(47867,1),(47868,1),(47869,1),(47870,1),(47871,1),(47872,1),(47873,1),(47874,1),(47875,1),(47876,1),(47877,1),(47878,1),(47879,1),(47880,1),(47881,1),(47882,1),(47883,1),(47884,1),(47885,1),(47886,1),(47887,1),(47888,1),(47889,1),(47890,1),(47891,1),(47892,1),(47893,1),(47894,1),(47895,1),(47896,1),(47897,1),(47898,1),(47899,1),(47900,1),(47901,1),(47902,1),(47903,1),(47904,1),(47905,1),(47906,1),(47907,1),(47908,1),(47909,1),(47910,1),(47911,1),(47912,1),(47913,1),(47914,1),(47915,1),(47916,1),(47917,1),(47918,1),(47919,1),(47920,1),(47921,1),(47922,1),(47923,1),(47924,1),(47925,1),(47926,1),(47927,1),(47928,1),(47929,1),(47930,1),(47931,1),(47932,1),(47933,1),(47934,1),(47935,1),(47936,1),(47937,1),(47938,1),(47939,1),(47940,1),(47941,1),(47942,1),(47943,1),(47944,1),(47945,1),(47946,1),(47947,1),(47948,1),(47949,1),(47950,1),(47951,1),(47952,1),(47953,1),(47954,1),(47955,1),(47956,1),(47957,1),(47958,1),(47959,1),(47960,1),(47961,1),(47962,1),(47963,1),(47964,1),(47965,1),(47966,1),(47967,1),(47968,1),(47969,1),(47970,1),(47971,1),(47972,1),(47973,1),(47974,1),(47975,1),(47976,1),(47977,1),(47978,1),(47979,1),(47980,1),(47981,1),(47982,1),(47983,1),(47984,1),(47985,1),(47986,1),(47987,1),(47988,1),(47989,1),(47990,1),(47991,1),(47992,1),(47993,1),(47994,1),(47995,1),(47996,1),(47997,1),(47998,1),(47999,1),(48000,1),(48001,1),(48002,1),(48003,1),(48004,1),(48005,1),(48006,1),(48007,1),(48008,1),(48009,1),(48010,1),(48011,1),(48012,1),(48013,1),(48014,1),(48015,1),(48016,1),(48017,1),(48018,1),(48019,1),(48020,1),(48021,1),(48022,1),(48023,1),(48024,1),(48025,1),(48026,1),(48027,1),(48028,1),(48029,1),(48030,1),(48031,1),(48032,1),(48033,1),(48034,1),(48035,1),(48036,1),(48037,1),(48038,1),(48039,1),(48040,1),(48041,1),(48042,1),(48043,1),(48044,1),(48045,1),(48046,1),(48047,1),(48048,1),(48049,1),(48050,1),(48051,1),(48052,1),(48053,1),(48054,1),(48055,1),(48056,1),(48057,1),(48058,1),(48059,1),(48060,1),(48061,1),(48062,1),(48063,1),(48064,1),(48065,1),(48066,1),(48067,1),(48068,1),(48069,1),(48070,1),(48071,1),(48072,1),(48073,1),(48074,1),(48075,1),(48076,1),(48077,1),(48078,1),(48079,1),(48080,1),(48081,1),(48082,1),(48083,1),(48084,1),(48085,1),(48086,1),(48087,1),(48088,1),(48089,1),(48090,1),(48091,1),(48092,1),(48093,1),(48094,1),(48095,1),(48096,1),(48097,1),(48098,1),(48099,1),(48100,1),(48101,1),(48102,1),(48103,1),(48104,1),(48105,1),(48106,1),(48107,1),(48108,1),(48109,1),(48110,1),(48111,1),(48112,1),(48113,1),(48114,1),(48115,1),(48116,1),(48117,1),(48118,1),(48119,1),(48120,1),(48121,1),(48122,1),(48123,1),(48124,1),(48125,1),(48126,1),(48127,1),(48128,1),(48129,1),(48130,1),(48131,1),(48132,1),(48133,1),(48134,1),(48135,1),(48136,1),(48137,1),(48138,1),(48139,1),(48140,1),(48141,1),(48142,1),(48143,1),(48144,1),(48145,1),(48146,1),(48147,1),(48148,1),(48149,1),(48150,1),(48151,1),(48152,1),(48153,1),(48154,1),(48155,1),(48156,1),(48157,1),(48158,1),(48159,1),(48160,1),(48161,1),(48162,1),(48163,1),(48164,1),(48165,1),(48166,1),(48167,1),(48168,1),(48169,1),(48170,1),(48171,1),(48172,1),(48173,1),(48174,1),(48175,1),(48176,1),(48177,1),(48178,1),(48179,1),(48180,1),(48181,1),(48182,1),(48183,1),(48184,1),(48185,1),(48186,1),(48187,1),(48188,1),(48189,1),(48190,1),(48191,1),(48192,1),(48193,1),(48194,1),(48195,1),(48196,1),(48197,1),(48198,1),(48199,1),(48200,1),(48201,1),(48202,1),(48203,1),(48204,1),(48205,1),(48206,1),(48207,1),(48208,1),(48209,1),(48210,1),(48211,1),(48212,1),(48213,1),(48214,1),(48215,1),(48216,1),(48217,1),(48218,1),(48219,1),(48220,1),(48221,1),(48222,1),(48223,1),(48224,1),(48225,1),(48226,1),(48227,1),(48228,1),(48229,1),(48230,1),(48231,1),(48232,1),(48233,1),(48234,1),(48235,1),(48236,1),(48237,1),(48238,1),(48239,1),(48240,1),(48241,1),(48242,1),(48243,1),(48244,1),(48245,1),(48246,1),(48247,1),(48248,1),(48249,1),(48250,1),(48251,1),(48252,1),(48253,1),(48254,1),(48255,1),(48256,1),(48257,1),(48258,1),(48259,1),(48260,1),(48261,1),(48262,1),(48263,1),(48264,1),(48265,1),(48266,1),(48267,1),(48268,1),(48269,1),(48270,1),(48271,1),(48272,1),(48273,1),(48274,1),(48275,1),(48276,1),(48277,1),(48278,1),(48279,1),(48280,1),(48281,1),(48282,1),(48283,1),(48284,1),(48285,1),(48286,1),(48287,1),(48288,1),(48289,1),(48290,1),(48291,1),(48292,1),(48293,1),(48294,1),(48295,1),(48296,1),(48297,1),(48298,1),(48299,1),(48300,1),(48301,1),(48302,1),(48303,1),(48304,1),(48305,1),(48306,1),(48307,1),(48308,1),(48309,1),(48310,1),(48311,1),(48312,1),(48313,1),(48314,1),(48315,1),(48316,1),(48317,1),(48318,1),(48319,1),(48320,1),(48321,1),(48322,1),(48323,1),(48324,1),(48325,1),(48326,1),(48327,1),(48328,1),(48329,1),(48330,1),(48331,1),(48332,1),(48333,1),(48334,1),(48335,1),(48336,1),(48337,1),(48338,1),(48339,1),(48340,1),(48341,1),(48342,1),(48343,1),(48344,1),(48345,1),(48346,1),(48347,1),(48348,1),(48349,1),(48350,1),(48351,1),(48352,1),(48353,1),(48354,1),(48355,1),(48356,1),(48357,1),(48358,1),(48359,1),(48360,1),(48361,1),(48362,1),(48363,1),(48364,1),(48365,1),(48366,1),(48367,1),(48368,1),(48369,1),(48370,1),(48371,1),(48372,1),(48373,1),(48374,1),(48375,1),(48376,1),(48377,1),(48378,1),(48379,1),(48380,1),(48381,1),(48382,1),(48383,1),(48384,1),(48385,1),(48386,1),(48387,1),(48388,1),(48389,1),(48390,1),(48391,1),(48392,1),(48393,1),(48394,1),(48395,1),(48396,1),(48397,1),(48398,1),(48399,1),(48400,1),(48401,1),(48402,1),(48403,1),(48404,1),(48405,1),(48406,1),(48407,1),(48408,1),(48409,1),(48410,1),(48411,1),(48412,1),(48413,1),(48414,1),(48415,1),(48416,1),(48417,1),(48418,1),(48419,1),(48420,1),(48421,1),(48422,1),(48423,1),(48424,1),(48425,1),(48426,1),(48427,1),(48428,1),(48429,1),(48430,1),(48431,1),(48432,1),(48433,1),(48434,1),(48435,1),(48436,1),(48437,1),(48438,1),(48439,1),(48440,1),(48441,1),(48442,1),(48443,1),(48444,1),(48445,1),(48446,1),(48447,1),(48448,1),(48449,1),(48450,1),(48451,1),(48452,1),(48453,1),(48454,1),(48455,1),(48456,1),(48457,1),(48458,1),(48459,1),(48460,1),(48461,1),(48462,1),(48463,1),(48464,1),(48465,1),(48466,1),(48467,1),(48468,1),(48469,1),(48470,1),(48471,1),(48472,1),(48473,1),(48474,1),(48475,1),(48476,1),(48477,1),(48478,1),(48479,1),(48480,1),(48481,1),(48482,1),(48483,1),(48484,1),(48485,1),(48486,1),(48487,1),(48488,1),(48489,1),(48490,1),(48491,1),(48492,1),(48493,1),(48494,1),(48495,1),(48496,1),(48497,1),(48498,1),(48499,1),(48500,1),(48501,1),(48502,1),(48503,1),(48504,1),(48505,1),(48506,1),(48507,1),(48508,1),(48509,1),(48510,1),(48511,1),(48512,1),(48513,1),(48514,1),(48515,1),(48516,1),(48517,1),(48518,1),(48519,1),(48520,1),(48521,1),(48522,1),(48523,1),(48524,1),(48525,1),(48526,1),(48527,1),(48528,1),(48529,1),(48530,1),(48531,1),(48532,1),(48533,1),(48534,1),(48535,1),(48536,1),(48537,1),(48538,1),(48539,1),(48540,1),(48541,1),(48542,1),(48543,1),(48544,1),(48545,1),(48546,1),(48547,1),(48548,1),(48549,1),(48550,1),(48551,1),(48552,1),(48553,1),(48554,1),(48555,1),(48556,1),(48557,1),(48558,1),(48559,1),(48560,1),(48561,1),(48562,1),(48563,1),(48564,1),(48565,1),(48566,1),(48567,1),(48568,1),(48569,1),(48570,1),(48571,1),(48572,1),(48573,1),(48574,1),(48575,1),(48576,1),(48577,1),(48578,1),(48579,1),(48580,1),(48581,1),(48582,1),(48583,1),(48584,1),(48585,1),(48586,1),(48587,1),(48588,1),(48589,1),(48590,1),(48591,1),(48592,1),(48593,1),(48594,1),(48595,1),(48596,1),(48597,1),(48598,1),(48599,1),(48600,1),(48601,1),(48602,1),(48603,1),(48604,1),(48605,1),(48606,1),(48607,1),(48608,1),(48609,1),(48610,1),(48611,1),(48612,1),(48613,1),(48614,1),(48615,1),(48616,1),(48617,1),(48618,1),(48619,1),(48620,1),(48621,1),(48622,1),(48623,1),(48624,1),(48625,1),(48626,1),(48627,1),(48628,1),(48629,1),(48630,1),(48631,1),(48632,1),(48633,1),(48634,1),(48635,1),(48636,1),(48637,1),(48638,1),(48639,1),(48640,1),(48641,1),(48642,1),(48643,1),(48644,1),(48645,1),(48646,1),(48647,1),(48648,1),(48649,1),(48650,1),(48651,1),(48652,1),(48653,1),(48654,1),(48655,1),(48656,1),(48657,1),(48658,1),(48659,1),(48660,1),(48661,1),(48662,1),(48663,1),(48664,1),(48665,1),(48666,1),(48667,1),(48668,1),(48669,1),(48670,1),(48671,1),(48672,1),(48673,1),(48674,1),(48675,1),(48676,1),(48677,1),(48678,1),(48679,1),(48680,1),(48681,1),(48682,1),(48683,1),(48684,1),(48685,1),(48686,1),(48687,1),(48688,1),(48689,1),(48690,1),(48691,1),(48692,1),(48693,1),(48694,1),(48695,1),(48696,1),(48697,1),(48698,1),(48699,1),(48700,1),(48701,1),(48702,1),(48703,1),(48704,1),(48705,1),(48706,1),(48707,1),(48708,1),(48709,1),(48710,1),(48711,1),(48712,1),(48713,1),(48714,1),(48715,1),(48716,1),(48717,1),(48718,1),(48719,1),(48720,1),(48721,1),(48722,1),(48723,1),(48724,1),(48725,1),(48726,1),(48727,1),(48728,1),(48729,1),(48730,1),(48731,1),(48732,1),(48733,1),(48734,1),(48735,1),(48736,1),(48737,1),(48738,1),(48739,1),(48740,1),(48741,1),(48742,1),(48743,1),(48744,1),(48745,1),(48746,1),(48747,1),(48748,1),(48749,1),(48750,1),(48751,1),(48752,1),(48753,1),(48754,1),(48755,1),(48756,1),(48757,1),(48758,1),(48759,1),(48760,1),(48761,1),(48762,1),(48763,1),(48764,1),(48765,1),(48766,1),(48767,1),(48768,1),(48769,1),(48770,1),(48771,1),(48772,1),(48773,1),(48774,1),(48775,1),(48776,1),(48777,1),(48778,1),(48779,1),(48780,1),(48781,1),(48782,1),(48783,1),(48784,1),(48785,1),(48786,1),(48787,1),(48788,1),(48789,1),(48790,1),(48791,1),(48792,1),(48793,1),(48794,1),(48795,1),(48796,1),(48797,1),(48798,1),(48799,1),(48800,1),(48801,1),(48802,1),(48803,1),(48804,1),(48805,1),(48806,1),(48807,1),(48808,1),(48809,1),(48810,1),(48811,1),(48812,1),(48813,1),(48814,1),(48815,1),(48816,1),(48817,1),(48818,1),(48819,1),(48820,1),(48821,1),(48822,1),(48823,1),(48824,1),(48825,1),(48826,1),(48827,1),(48828,1),(48829,1),(48830,1),(48831,1),(48832,1),(48833,1),(48834,1),(48835,1),(48836,1),(48837,1),(48838,1),(48839,1),(48840,1),(48841,1),(48842,1),(48843,1),(48844,1),(48845,1),(48846,1),(48847,1),(48848,1),(48849,1),(48850,1),(48851,1),(48852,1),(48853,1),(48854,1),(48855,1),(48856,1),(48857,1),(48858,1),(48859,1),(48860,1),(48861,1),(48862,1),(48863,1),(48864,1),(48865,1),(48866,1),(48867,1),(48868,1),(48869,1),(48870,1),(48871,1),(48872,1),(48873,1),(48874,1),(48875,1),(48876,1),(48877,1),(48878,1),(48879,1),(48880,1),(48881,1),(48882,1),(48883,1),(48884,1),(48885,1),(48886,1),(48887,1),(48888,1),(48889,1),(48890,1),(48891,1),(48892,1),(48893,1),(48894,1),(48895,1),(48896,1),(48897,1),(48898,1),(48899,1),(48900,1),(48901,1),(48902,1),(48903,1),(48904,1),(48905,1),(48906,1),(48907,1),(48908,1),(48909,1),(48910,1),(48911,1),(48912,1),(48913,1),(48914,1),(48915,1),(48916,1),(48917,1),(48918,1),(48919,1),(48920,1),(48921,1),(48922,1),(48923,1),(48924,1),(48925,1),(48926,1),(48927,1),(48928,1),(48929,1),(48930,1),(48931,1),(48932,1),(48933,1),(48934,1),(48935,1),(48936,1),(48937,1),(48938,1),(48939,1),(48940,1),(48941,1),(48942,1),(48943,1),(48944,1),(48945,1),(48946,1),(48947,1),(48948,1),(48949,1),(48950,1),(48951,1),(48952,1),(48953,1),(48954,1),(48955,1),(48956,1),(48957,1),(48958,1),(48959,1),(48960,1),(48961,1),(48962,1),(48963,1),(48964,1),(48965,1),(48966,1),(48967,1),(48968,1),(48969,1),(48970,1),(48971,1),(48972,1),(48973,1),(48974,1),(48975,1),(48976,1),(48977,1),(48978,1),(48979,1),(48980,1),(48981,1),(48982,1),(48983,1),(48984,1),(48985,1),(48986,1),(48987,1),(48988,1),(48989,1),(48990,1),(48991,1),(48992,1),(48993,1),(48994,1),(48995,1),(48996,1),(48997,1),(48998,1),(48999,1),(49000,1),(49001,1),(49002,1),(49003,1),(49004,1),(49005,1),(49006,1),(49007,1),(49008,1),(49009,1),(49010,1),(49011,1),(49012,1),(49013,1),(49014,1),(49015,1),(49016,1),(49017,1),(49018,1),(49019,1),(49020,1),(49021,1),(49022,1),(49023,1),(49024,1),(49025,1),(49026,1),(49027,1),(49028,1),(49029,1),(49030,1),(49031,1),(49032,1),(49033,1),(49034,1),(49035,1),(49036,1),(49037,1),(49038,1),(49039,1),(49040,1),(49041,1),(49042,1),(49043,1),(49044,1),(49045,1),(49046,1),(49047,1),(49048,1),(49049,1),(49050,1),(49051,1),(49052,1),(49053,1),(49054,1),(49055,1),(49056,1),(49057,1),(49058,1),(49059,1),(49060,1),(49061,1),(49062,1),(49063,1),(49064,1),(49065,1),(49066,1),(49067,1),(49068,1),(49069,1),(49070,1),(49071,1),(49072,1),(49073,1),(49074,1),(49075,1),(49076,1),(49077,1),(49078,1),(49079,1),(49080,1),(49081,1),(49082,1),(49083,1),(49084,1),(49085,1),(49086,1),(49087,1),(49088,1),(49089,1),(49090,1),(49091,1),(49092,1),(49093,1),(49094,1),(49095,1),(49096,1),(49097,1),(49098,1),(49099,1),(49100,1),(49101,1),(49102,1),(49103,1),(49104,1),(49105,1),(49106,1),(49107,1),(49108,1),(49109,1),(49110,1),(49111,1),(49112,1),(49113,1),(49114,1),(49115,1),(49116,1),(49117,1),(49118,1),(49119,1),(49120,1),(49121,1),(49122,1),(49123,1),(49124,1),(49125,1),(49126,1),(49127,1),(49128,1),(49129,1),(49130,1),(49131,1),(49132,1),(49133,1),(49134,1),(49135,1),(49136,1),(49137,1),(49138,1),(49139,1),(49140,1),(49141,1),(49142,1),(49143,1),(49144,1),(49145,1),(49146,1),(49147,1),(49148,1),(49149,1),(49150,1),(49151,1),(49152,1),(49153,1),(49154,1),(49155,1),(49156,1),(49157,1),(49158,1),(49159,1),(49160,1),(49161,1),(49162,1),(49163,1),(49164,1),(49165,1),(49166,1),(49167,1),(49168,1),(49169,1),(49170,1),(49171,1),(49172,1),(49173,1),(49174,1),(49175,1),(49176,1),(49177,1),(49178,1),(49179,1),(49180,1),(49181,1),(49182,1),(49183,1),(49184,1),(49185,1),(49186,1),(49187,1),(49188,1),(49189,1),(49190,1),(49191,1),(49192,1),(49193,1),(49194,1),(49195,1),(49196,1),(49197,1),(49198,1),(49199,1),(49200,1),(49201,1),(49202,1),(49203,1),(49204,1),(49205,1),(49206,1),(49207,1),(49208,1),(49209,1),(49210,1),(49211,1),(49212,1),(49213,1),(49214,1),(49215,1),(49216,1),(49217,1),(49218,1),(49219,1),(49220,1),(49221,1),(49222,1),(49223,1),(49224,1),(49225,1),(49226,1),(49227,1),(49228,1),(49229,1),(49230,1),(49231,1),(49232,1),(49233,1),(49234,1),(49235,1),(49236,1),(49237,1),(49238,1),(49239,1),(49240,1),(49241,1),(49242,1),(49243,1),(49244,1),(49245,1),(49246,1),(49247,1),(49248,1),(49249,1),(49250,1),(49251,1),(49252,1),(49253,1),(49254,1),(49255,1),(49256,1),(49257,1),(49258,1),(49259,1),(49260,1),(49261,1),(49262,1),(49263,1),(49264,1),(49265,1),(49266,1),(49267,1),(49268,1),(49269,1),(49270,1),(49271,1),(49272,1),(49273,1),(49274,1),(49275,1),(49276,1),(49277,1),(49278,1),(49279,1),(49280,1),(49281,1),(49282,1),(49283,1),(49284,1),(49285,1),(49286,1),(49287,1),(49288,1),(49289,1),(49290,1),(49291,1),(49292,1),(49293,1),(49294,1),(49295,1),(49296,1),(49297,1),(49298,1),(49299,1),(49300,1),(49301,1),(49302,1),(49303,1),(49304,1),(49305,1),(49306,1),(49307,1),(49308,1),(49309,1),(49310,1),(49311,1),(49312,1),(49313,1),(49314,1),(49315,1),(49316,1),(49317,1),(49318,1),(49319,1),(49320,1),(49321,1),(49322,1),(49323,1),(49324,1),(49325,1),(49326,1),(49327,1),(49328,1),(49329,1),(49330,1),(49331,1),(49332,1),(49333,1),(49334,1),(49335,1),(49336,1),(49337,1),(49338,1),(49339,1),(49340,1),(49341,1),(49342,1),(49343,1),(49344,1),(49345,1),(49346,1),(49347,1),(49348,1),(49349,1),(49350,1),(49351,1),(49352,1),(49353,1),(49354,1),(49355,1),(49356,1),(49357,1),(49358,1),(49359,1),(49360,1),(49361,1),(49362,1),(49363,1),(49364,1),(49365,1),(49366,1),(49367,1),(49368,1),(49369,1),(49370,1),(49371,1),(49372,1),(49373,1),(49374,1),(49375,1),(49376,1),(49377,1),(49378,1),(49379,1),(49380,1),(49381,1),(49382,1),(49383,1),(49384,1),(49385,1),(49386,1),(49387,1),(49388,1),(49389,1),(49390,1),(49391,1),(49392,1),(49393,1),(49394,1),(49395,1),(49396,1),(49397,1),(49398,1),(49399,1),(49400,1),(49401,1),(49402,1),(49403,1),(49404,1),(49405,1),(49406,1),(49407,1),(49408,1),(49409,1),(49410,1),(49411,1),(49412,1),(49413,1),(49414,1),(49415,1),(49416,1),(49417,1),(49418,1),(49419,1),(49420,1),(49421,1),(49422,1),(49423,1),(49424,1),(49425,1),(49426,1),(49427,1),(49428,1),(49429,1),(49430,1),(49431,1),(49432,1),(49433,1),(49434,1),(49435,1),(49436,1),(49437,1),(49438,1),(49439,1),(49440,1),(49441,1),(49442,1),(49443,1),(49444,1),(49445,1),(49446,1),(49447,1),(49448,1),(49449,1),(49450,1),(49451,1),(49452,1),(49453,1),(49454,1),(49455,1),(49456,1),(49457,1),(49458,1),(49459,1),(49460,1),(49461,1),(49462,1),(49463,1),(49464,1),(49465,1),(49466,1),(49467,1),(49468,1),(49469,1),(49470,1),(49471,1),(49472,1),(49473,1),(49474,1),(49475,1),(49476,1),(49477,1),(49478,1),(49479,1),(49480,1),(49481,1),(49482,1),(49483,1),(49484,1),(49485,1),(49486,1),(49487,1),(49488,1),(49489,1),(49490,1),(49491,1),(49492,1),(49493,1),(49494,1),(49495,1),(49496,1),(49497,1),(49498,1),(49499,1),(49500,1),(49501,1),(49502,1),(49503,1),(49504,1),(49505,1),(49506,1),(49507,1),(49508,1),(49509,1),(49510,1),(49511,1),(49512,1),(49513,1),(49514,1),(49515,1),(49516,1),(49517,1),(49518,1),(49519,1),(49520,1),(49521,1),(49522,1),(49523,1),(49524,1),(49525,1),(49526,1),(49527,1),(49528,1),(49529,1),(49530,1),(49531,1),(49532,1),(49533,1),(49534,1),(49535,1),(49536,1),(49537,1),(49538,1),(49539,1),(49540,1),(49541,1),(49542,1),(49543,1),(49544,1),(49545,1),(49546,1),(49547,1),(49548,1),(49549,1),(49550,1),(49551,1),(49552,1),(49553,1),(49554,1),(49555,1),(49556,1),(49557,1),(49558,1),(49559,1),(49560,1),(49561,1),(49562,1),(49563,1),(49564,1),(49565,1),(49566,1),(49567,1),(49568,1),(49569,1),(49570,1),(49571,1),(49572,1),(49573,1),(49574,1),(49575,1),(49576,1),(49577,1),(49578,1),(49579,1),(49580,1),(49581,1),(49582,1),(49583,1),(49584,1),(49585,1),(49586,1),(49587,1),(49588,1),(49589,1),(49590,1),(49591,1),(49592,1),(49593,1),(49594,1),(49595,1),(49596,1),(49597,1),(49598,1),(49599,1),(49600,1),(49601,1),(49602,1),(49603,1),(49604,1),(49605,1),(49606,1),(49607,1),(49608,1),(49609,1),(49610,1),(49611,1),(49612,1),(49613,1),(49614,1),(49615,1),(49616,1),(49617,1),(49618,1),(49619,1),(49620,1),(49621,1),(49622,1),(49623,1),(49624,1),(49625,1),(49626,1),(49627,1),(49628,1),(49629,1),(49630,1),(49631,1),(49632,1),(49633,1),(49634,1),(49635,1),(49636,1),(49637,1),(49638,1),(49639,1),(49640,1),(49641,1),(49642,1),(49643,1),(49644,1),(49645,1),(49646,1),(49647,1),(49648,1),(49649,1),(49650,1),(49651,1),(49652,1),(49653,1),(49654,1),(49655,1),(49656,1),(49657,1),(49658,1),(49659,1),(49660,1),(49661,1),(49662,1),(49663,1),(49664,1),(49665,1),(49666,1),(49667,1),(49668,1),(49669,1),(49670,1),(49671,1),(49672,1),(49673,1),(49674,1),(49675,1),(49676,1),(49677,1),(49678,1),(49679,1),(49680,1),(49681,1),(49682,1),(49683,1),(49684,1),(49685,1),(49686,1),(49687,1),(49688,1),(49689,1),(49690,1),(49691,1),(49692,1),(49693,1),(49694,1),(49695,1),(49696,1),(49697,1),(49698,1),(49699,1),(49700,1),(49701,1),(49702,1),(49703,1),(49704,1),(49705,1),(49706,1),(49707,1),(49708,1),(49709,1),(49710,1),(49711,1),(49712,1),(49713,1),(49714,1),(49715,1),(49716,1),(49717,1),(49718,1),(49719,1),(49720,1),(49721,1),(49722,1),(49723,1),(49724,1),(49725,1),(49726,1),(49727,1),(49728,1),(49729,1),(49730,1),(49731,1),(49732,1),(49733,1),(49734,1),(49735,1),(49736,1),(49737,1),(49738,1),(49739,1),(49740,1),(49741,1),(49742,1),(49743,1),(49744,1),(49745,1),(49746,1),(49747,1),(49748,1),(49749,1),(49750,1),(49751,1),(49752,1),(49753,1),(49754,1),(49755,1),(49756,1),(49757,1),(49758,1),(49759,1),(49760,1),(49761,1),(49762,1),(49763,1),(49764,1),(49765,1),(49766,1),(49767,1),(49768,1),(49769,1),(49770,1),(49771,1),(49772,1),(49773,1),(49774,1),(49775,1),(49776,1),(49777,1),(49778,1),(49779,1),(49780,1),(49781,1),(49782,1),(49783,1),(49784,1),(49785,1),(49786,1),(49787,1),(49788,1),(49789,1),(49790,1),(49791,1),(49792,1),(49793,1),(49794,1),(49795,1),(49796,1),(49797,1),(49798,1),(49799,1),(49800,1),(49801,1),(49802,1),(49803,1),(49804,1),(49805,1),(49806,1),(49807,1),(49808,1),(49809,1),(49810,1),(49811,1),(49812,1),(49813,1),(49814,1),(49815,1),(49816,1),(49817,1),(49818,1),(49819,1),(49820,1),(49821,1),(49822,1),(49823,1),(49824,1),(49825,1),(49826,1),(49827,1),(49828,1),(49829,1),(49830,1),(49831,1),(49832,1),(49833,1),(49834,1),(49835,1),(49836,1),(49837,1),(49838,1),(49839,1),(49840,1),(49841,1),(49842,1),(49843,1),(49844,1),(49845,1),(49846,1),(49847,1),(49848,1),(49849,1),(49850,1),(49851,1),(49852,1),(49853,1),(49854,1),(49855,1),(49856,1),(49857,1),(49858,1),(49859,1),(49860,1),(49861,1),(49862,1),(49863,1),(49864,1),(49865,1),(49866,1),(49867,1),(49868,1),(49869,1),(49870,1),(49871,1),(49872,1),(49873,1),(49874,1),(49875,1),(49876,1),(49877,1),(49878,1),(49879,1),(49880,1),(49881,1),(49882,1),(49883,1),(49884,1),(49885,1),(49886,1),(49887,1),(49888,1),(49889,1),(49890,1),(49891,1),(49892,1),(49893,1),(49894,1),(49895,1),(49896,1),(49897,1),(49898,1),(49899,1),(49900,1),(49901,1),(49902,1),(49903,1),(49904,1),(49905,1),(49906,1),(49907,1),(49908,1),(49909,1),(49910,1),(49911,1),(49912,1),(49913,1),(49914,1),(49915,1),(49916,1),(49917,1),(49918,1),(49919,1),(49920,1),(49921,1),(49922,1),(49923,1),(49924,1),(49925,1),(49926,1),(49927,1),(49928,1),(49929,1),(49930,1),(49931,1),(49932,1),(49933,1),(49934,1),(49935,1),(49936,1),(49937,1),(49938,1),(49939,1),(49940,1),(49941,1),(49942,1),(49943,1),(49944,1),(49945,1),(49946,1),(49947,1),(49948,1),(49949,1),(49950,1),(49951,1),(49952,1),(49953,1),(49954,1),(49955,1),(49956,1),(49957,1),(49958,1),(49959,1),(49960,1),(49961,1),(49962,1),(49963,1),(49964,1),(49965,1),(49966,1),(49967,1),(49968,1),(49969,1),(49970,1),(49971,1),(49972,1),(49973,1),(49974,1),(49975,1),(49976,1),(49977,1),(49978,1),(49979,1),(49980,1),(49981,1),(49982,1),(49983,1),(49984,1),(49985,1),(49986,1),(49987,1),(49988,1),(49989,1),(49990,1),(49991,1),(49992,1),(49993,1),(49994,1),(49995,1),(49996,1),(49997,1),(49998,1),(49999,1);
4752
4753=== added file 't/pt-duplicate-key-checker/samples/simple_dupe_bug_1217013.txt'
4754--- t/pt-duplicate-key-checker/samples/simple_dupe_bug_1217013.txt 1970-01-01 00:00:00 +0000
4755+++ t/pt-duplicate-key-checker/samples/simple_dupe_bug_1217013.txt 2013-12-20 00:06:23 +0000
4756@@ -0,0 +1,21 @@
4757+# ########################################################################
4758+# test.domains
4759+# ########################################################################
4760+
4761+# Uniqueness of domain ignored because unique_key_domain is a duplicate constraint
4762+# domain is a duplicate of unique_key_domain
4763+# Key definitions:
4764+# UNIQUE KEY `domain` (`domain`),
4765+# UNIQUE KEY `unique_key_domain` (`domain`)
4766+# Column types:
4767+# `domain` varchar(175) collate utf8_bin not null
4768+# To remove this duplicate index, execute:
4769+ALTER TABLE `test`.`domains` DROP INDEX `domain`;
4770+
4771+# ########################################################################
4772+# Summary of indexes
4773+# ########################################################################
4774+
4775+# Size Duplicate Indexes 527
4776+# Total Duplicate Indexes 1
4777+# Total Indexes 3
4778
4779=== modified file 't/pt-duplicate-key-checker/standard_options.t'
4780--- t/pt-duplicate-key-checker/standard_options.t 2011-07-12 22:56:55 +0000
4781+++ t/pt-duplicate-key-checker/standard_options.t 2013-12-20 00:06:23 +0000
4782@@ -18,20 +18,25 @@
4783 my $output;
4784 my $cnf = "/tmp/12345/my.sandbox.cnf";
4785 my $cmd = "$trunk/bin/pt-duplicate-key-checker -F $cnf -h 127.1";
4786+my $pid_file = "/tmp/pt-dupe-key-test.pid";
4787+
4788+diag(`rm -f $pid_file >/dev/null`);
4789
4790 # #########################################################################
4791 # Issue 391: Add --pid option to all scripts
4792 # #########################################################################
4793-`touch /tmp/mk-script.pid`;
4794-$output = `$cmd -d issue_295 --pid /tmp/mk-script.pid 2>&1`;
4795+
4796+diag(`touch $pid_file`);
4797+
4798+$output = `$cmd -d issue_295 --pid $pid_file 2>&1`;
4799 like(
4800 $output,
4801- qr{PID file /tmp/mk-script.pid already exists},
4802+ qr{PID file $pid_file exists},
4803 'Dies if PID file already exists (issue 391)'
4804 );
4805-`rm -rf /tmp/mk-script.pid`;
4806
4807 # #############################################################################
4808 # Done.
4809 # #############################################################################
4810+diag(`rm -f $pid_file >/dev/null`);
4811 exit;
4812
4813=== modified file 't/pt-mysql-summary/pt-mysql-summary.t'
4814--- t/pt-mysql-summary/pt-mysql-summary.t 2012-12-07 18:52:33 +0000
4815+++ t/pt-mysql-summary/pt-mysql-summary.t 2013-12-20 00:06:23 +0000
4816@@ -66,12 +66,12 @@
4817 no_diff(
4818 sub {
4819 local $ENV{_NO_FALSE_NEGATIVES} = 1;
4820- print `$env $trunk/bin/$tool --read-samples $trunk/t/pt-mysql-summary/samples/temp00$i -- --defaults-file=/tmp/12345/my.sandbox.cnf | tail -n+3 | perl -wlnpe 's/Skipping schema analysis.*/Skipping schema analysis/'`
4821+ print `$env $trunk/bin/$tool --read-samples $trunk/t/pt-mysql-summary/samples/temp00$i -- --defaults-file=/tmp/12345/my.sandbox.cnf | tail -n+3 | perl -wlnpe 's/Skipping schema analysis.*/Specify --databases or --all-databases to dump and summarize schemas/'`
4822 },
4823 "t/pt-mysql-summary/samples/expected_output_temp00$i.txt",
4824 ),
4825 "--read-samples works for t/pt-mysql-summary/temp00$i",
4826- );
4827+ ) or diag($test_diff);
4828 }
4829
4830 # Test that --help works under sh
4831
4832=== modified file 't/pt-mysql-summary/samples/expected_output_temp003.txt'
4833--- t/pt-mysql-summary/samples/expected_output_temp003.txt 2012-11-27 22:05:45 +0000
4834+++ t/pt-mysql-summary/samples/expected_output_temp003.txt 2013-12-20 00:06:23 +0000
4835@@ -108,7 +108,7 @@
4836 Usage | 0%
4837 HitToInsertRatio | 0%
4838 # Schema #####################################################
4839-Skipping schema analysis
4840+Specify --databases or --all-databases to dump and summarize schemas
4841 # Noteworthy Technologies ####################################
4842 SSL | No
4843 Explicit LOCK TABLES | No
4844
4845=== modified file 't/pt-mysql-summary/samples/expected_output_temp004.txt'
4846--- t/pt-mysql-summary/samples/expected_output_temp004.txt 2012-11-27 22:05:45 +0000
4847+++ t/pt-mysql-summary/samples/expected_output_temp004.txt 2013-12-20 00:06:23 +0000
4848@@ -107,7 +107,7 @@
4849 Usage | 0%
4850 HitToInsertRatio | 0%
4851 # Schema #####################################################
4852-Skipping schema analysis
4853+Specify --databases or --all-databases to dump and summarize schemas
4854 # Noteworthy Technologies ####################################
4855 SSL | No
4856 Explicit LOCK TABLES | No
4857
4858=== modified file 't/pt-online-schema-change/ansi_quotes.t'
4859--- t/pt-online-schema-change/ansi_quotes.t 2013-03-02 17:17:23 +0000
4860+++ t/pt-online-schema-change/ansi_quotes.t 2013-12-20 00:06:23 +0000
4861@@ -61,7 +61,7 @@
4862 $exit_status,
4863 0,
4864 "--dry-run exit 0 (bug 1058285)"
4865-);
4866+) or diag($output);
4867
4868 unlike(
4869 $output,
4870
4871=== modified file 't/pt-online-schema-change/basics.t'
4872--- t/pt-online-schema-change/basics.t 2013-10-10 02:13:49 +0000
4873+++ t/pt-online-schema-change/basics.t 2013-12-20 00:06:23 +0000
4874@@ -13,6 +13,7 @@
4875 use Time::HiRes qw(sleep);
4876
4877 $ENV{PTTEST_FAKE_TS} = 1;
4878+$ENV{PERCONA_TOOLKIT_TEST_USE_DSN_NAMES} = 1;
4879
4880 use PerconaTest;
4881 use Sandbox;
4882@@ -704,7 +705,8 @@
4883 no_diff(
4884 sub { pt_online_schema_change::main(@args, "$dsn,D=bug_1045317,t=bits",
4885 '--execute', '--statistics',
4886- '--alter', "modify column val ENUM('M','E','H') NOT NULL")
4887+ '--alter', "modify column val ENUM('M','E','H') NOT NULL",
4888+ '--recursion-method', 'none')
4889 },
4890 ($sandbox_version ge '5.5' && $db_flavor !~ m/XtraDB Cluster/
4891 ? "$sample/stats-execute-5.5.txt"
4892
4893=== modified file 't/pt-online-schema-change/charset.t'
4894--- t/pt-online-schema-change/charset.t 2013-06-26 17:47:19 +0000
4895+++ t/pt-online-schema-change/charset.t 2013-12-20 00:06:23 +0000
4896@@ -56,10 +56,10 @@
4897 my @create = split("\n\n", $output);
4898
4899 like(
4900- $create[1],
4901+ $create[1] || '',
4902 qr/DEFAULT CHARSET=utf8/,
4903 "Can alter charset of new table"
4904-);
4905+) or diag($output);
4906
4907 # #############################################################################
4908 # Done.
4909
4910=== modified file 't/pt-online-schema-change/samples/stats-execute-5.5.txt'
4911--- t/pt-online-schema-change/samples/stats-execute-5.5.txt 2013-06-25 19:52:03 +0000
4912+++ t/pt-online-schema-change/samples/stats-execute-5.5.txt 2013-12-20 00:06:23 +0000
4913@@ -1,3 +1,5 @@
4914+No slaves found. See --recursion-method if host h=127.1,P=12345 has slaves.
4915+Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
4916 Operation, tries, wait:
4917 copy_rows, 10, 0.25
4918 create_triggers, 10, 1
4919
4920=== modified file 't/pt-query-digest/json.t'
4921--- t/pt-query-digest/json.t 2013-08-03 19:36:26 +0000
4922+++ t/pt-query-digest/json.t 2013-12-20 00:06:23 +0000
4923@@ -62,6 +62,22 @@
4924 ) or diag($test_diff);
4925
4926 # #############################################################################
4927+# pt-query-digest support for Percona Server slow log rate limiting
4928+# https://blueprints.launchpad.net/percona-toolkit/+spec/pt-query-digest-rate-limit
4929+# #############################################################################
4930+ok(
4931+ no_diff(
4932+ sub { pt_query_digest::main(@args,
4933+ "$trunk/t/lib/samples/slowlogs/slow059.txt",
4934+ qw(--output json))
4935+ },
4936+ "t/pt-query-digest/samples/slow059_report02.txt",
4937+ "sed" => [q{-e 's/"name" : ".*/"name" : "slow059.txt"/'}],
4938+ ),
4939+ 'json output for slow059'
4940+) or diag($test_diff);
4941+
4942+# #############################################################################
4943 # Done.
4944 # #############################################################################
4945 done_testing;
4946
4947=== added file 't/pt-query-digest/samples/slow059_report01.txt'
4948--- t/pt-query-digest/samples/slow059_report01.txt 1970-01-01 00:00:00 +0000
4949+++ t/pt-query-digest/samples/slow059_report01.txt 2013-12-20 00:06:23 +0000
4950@@ -0,0 +1,127 @@
4951+# Rate limits apply
4952+
4953+# Overall: 3 total, 2 unique, 0 QPS, 0x concurrency ______________________
4954+# Time range: all events occurred at 2013-11-28 01:05:31
4955+# Attribute total min max avg 95% stddev median
4956+# ============ ======= ======= ======= ======= ======= ======= =======
4957+# Exec time 630us 165us 237us 210us 236us 33us 224us
4958+# Lock time 284us 48us 122us 94us 119us 32us 113us
4959+# Rows sent 7 1 5 2.33 4.96 1.87 0.99
4960+# Rows examine 12 1 10 4 9.83 4.17 0.99
4961+# Rows affecte 0 0 0 0 0 0 0
4962+# Bytes sent 1.53k 481 545 523.67 537.02 32 537.02
4963+# Merge passes 0 0 0 0 0 0 0
4964+# Tmp tables 0 0 0 0 0 0 0
4965+# Tmp disk tbl 0 0 0 0 0 0 0
4966+# Tmp tbl size 0 0 0 0 0 0 0
4967+# Query size 92 30 32 30.67 31.70 1 28.75
4968+# InnoDB:
4969+# IO r bytes 0 0 0 0 0 0 0
4970+# IO r ops 0 0 0 0 0 0 0
4971+# IO r wait 0 0 0 0 0 0 0
4972+# pages distin 7 2 3 2.33 2.90 0.44 1.96
4973+# queue wait 0 0 0 0 0 0 0
4974+# rec lock wai 0 0 0 0 0 0 0
4975+# Boolean:
4976+# Filesort 33% yes, 66% no
4977+
4978+# Query 1: 0 QPS, 0x concurrency, ID 0x9EA505F4786E7F15 at byte 733 ______
4979+# This item is included in the report because it matches --limit.
4980+# Scores: V/M = 0.00
4981+# Time range: all events occurred at 2013-11-28 01:05:31
4982+# Attribute pct total min max avg 95% stddev median
4983+# ============ === ======= ======= ======= ======= ======= ======= =======
4984+# Count 66 2
4985+# Exec time 73 465us 228us 237us 232us 237us 6us 232us
4986+# Lock time 83 236us 114us 122us 118us 122us 5us 118us
4987+# Rows sent 28 2 1 1 1 1 0 1
4988+# Rows examine 16 2 1 1 1 1 0 1
4989+# Rows affecte 0 0 0 0 0 0 0 0
4990+# Bytes sent 69 1.06k 545 545 545 545 0 545
4991+# Merge passes 0 0 0 0 0 0 0 0
4992+# Tmp tables 0 0 0 0 0 0 0 0
4993+# Tmp disk tbl 0 0 0 0 0 0 0 0
4994+# Tmp tbl size 0 0 0 0 0 0 0 0
4995+# Query size 65 60 30 30 30 30 0 30
4996+# InnoDB:
4997+# IO r bytes 0 0 0 0 0 0 0 0
4998+# IO r ops 0 0 0 0 0 0 0 0
4999+# IO r wait 0 0 0 0 0 0 0 0
5000+# pages distin 57 4 2 2 2 2 0 2
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches