Compare commits

..

46 Commits

Author SHA1 Message Date
Tomislav Plavcic
cb55103a57 Build percona-toolkit-2.2.14 2015-04-10 11:01:07 +02:00
Frank Cizmich
e6167dcc0b changed Percona::Toolkit version to 2.2.14 2015-04-09 14:28:28 -03:00
Frank Cizmich
319a8db103 Changelog 2015-04-09 14:19:34 -03:00
Frank Cizmich
d0ac2039cd merged pt-table-sync-ignores-system-databases-but-doc-doesn-t-clarify-this-1442277 2015-04-09 14:08:06 -03:00
Frank Cizmich
4571568fb0 clarified that pt-table-sync ignores system databases in docs 2015-04-09 14:00:39 -03:00
Frank Cizmich
d03ccaa9e5 merged pt-online-schema-change-error-in-doc-of--tries-option-1417864 2015-04-09 13:29:15 -03:00
Frank Cizmich
ceb333fb4e merged pt-duplicate-key-checker-docs-dont-explain-how-Size-Duplicate-Indexes-is-calculated-1415646 2015-04-09 13:27:34 -03:00
Frank Cizmich
ad65779d15 merged pt-stalk-with--collect-strace-output-doesnt-go-to-an-YYYY_MM_DD_HH_mm_ss-strace-file-1417558 2015-04-09 13:26:31 -03:00
Frank Cizmich
44a7768abb merged pt-table-sync-fails-to-close-one-db-handle-1401399 2015-04-09 13:23:24 -03:00
Frank Cizmich
150846995a merged pt-table-sync-add-ignore-tables-regex-option-1439842 2015-04-09 13:22:10 -03:00
Frank Cizmich
1a99478b10 pt-upgrade-fails-to-aggregate-queries-based-on-fingerprint-1421405 2015-04-09 13:17:32 -03:00
Frank Cizmich
39e2c53912 merged rpm-missing-dependency-perl-termreadkey-1421025 2015-04-09 13:13:16 -03:00
Frank Cizmich
0daefbd9d8 merged resolve-IP-addresses-in-pt-slave-find-1418446 2015-04-09 13:12:46 -03:00
Frank Cizmich
921856ed30 merged pt-query-digest-waits-for-STDIN-if-file-dosnt-exist-1404313 2015-04-09 11:58:30 -03:00
Frank Cizmich
26959bc098 merged pt-osc-alter-foreign-keys-method-drop-swap-is-vulnerable-to-interruption-1368244 2015-04-09 11:57:11 -03:00
Frank Cizmich
c055de4bc0 merged pt-stalk-removes-non-empty-files-that-start-with-empty-line-1425478 2015-04-09 11:54:16 -03:00
Frank Cizmich
536a72ed65 merged pt-heartbeat-crashes-with-sleep-argument-1406390 2015-04-09 11:49:13 -03:00
Frank Cizmich
47b8835d05 merged pt-upgrade-fails-on-SELECT-INTO-queries-1421781 2015-04-09 11:47:46 -03:00
Frank Cizmich
8a4dc3bd4a merged pt-table-checksum-fails-on-BINARY-field-in-PK-1381280 2015-04-09 11:46:03 -03:00
Frank Cizmich
9d90cc61b1 merged pt-duplicate-key-checker-fails-with-verbose-1402730 2015-04-09 11:45:35 -03:00
Frank Cizmich
35cd94251a minor typo 2015-04-08 16:54:16 -03:00
Frank Cizmich
789f76fc89 minor typo 2015-04-07 17:29:03 -03:00
Frank Cizmich
270ad6f741 minor typo 2015-04-07 17:06:35 -03:00
Frank Cizmich
3fd9083f34 Added info in doc. Minor test tweak 2015-04-06 18:48:06 -03:00
Frank Cizmich
c47660211f pt-heartbeat added comment for issue 1406390 fix 2015-04-06 18:20:55 -03:00
Frank Cizmich
54c3419e68 pt-t-c changed text of warnings and docs. Minor tweak of test for Ubuntu 14 2015-04-06 16:41:35 -03:00
Frank Cizmich
2eada50f8d pt-table-sync added --ignore-tables-regex option 2015-04-02 17:34:56 -03:00
Frank Cizmich
ade9a283d4 pt-upgrade failed to group by fingerprint & reported wrong number of diffs as reason for report 2015-04-01 16:45:23 -03:00
Frank Cizmich
5742175dfe pt-table-sync avoid error when closing auxiliary db handles 2015-03-31 13:07:22 -03:00
Frank Cizmich
33956074af pt-heartbeat sometimes failed with --sleep due to race condition 2015-03-30 19:27:46 -03:00
Frank Cizmich
a3d9182331 pt-stalk did not save strace data 2015-03-30 18:56:20 -03:00
Frank Cizmich
162350a804 pt-upgrade failed on SELECT..INTO statements 2015-03-30 16:20:18 -03:00
Frank Cizmich
41c4080522 pt-stalk erroneously deleted files with empty first line 2015-03-27 15:54:11 -03:00
Frank Cizmich
2459053634 Added sort to some hash loops to make tests consistent. Modified test files accordingly 2015-03-26 15:42:11 -03:00
Frank Cizmich
793ff24a69 Added warning about size of fulltext keys not being computed, if present. Sort key report by key name for ease of testing. 2015-03-25 15:02:22 -03:00
Frank Cizmich
0c50d5b1cd pt-duplicate-key-checker skipped reporting when verbose option on 2015-03-23 14:00:01 -03:00
Frank Cizmich
2877be83f4 pt-query-digest waits for STDIN if file dosnt exist 2015-03-20 17:08:28 -03:00
Frank Cizmich
39b0e026c8 pt-duplicate-key-checker added explanation of index size in docs 2015-03-20 12:17:43 -03:00
Tomislav Plavcic
f26cc8d3f7 Added perl(Term::ReadKey) dependency in rpm spec file 2015-03-20 10:10:09 +01:00
Frank Cizmich
29cbec8b75 pt-slave-find added --resolve-address option 2015-03-19 17:44:39 -03:00
Frank Cizmich
5f5558542a pt-osc minor doc correction on --tries option 2015-03-19 14:41:33 -03:00
Frank Cizmich
e178fb6ef1 pt-osc disable interrupts during drop_swap 2015-03-18 13:56:23 -03:00
Frank Cizmich
8d7c749e16 added option to handle checksum of tables with binary keys 2015-02-18 14:13:09 -02:00
Frank Cizmich
16a7ffa6f9 merged release-2.2.13 2015-01-30 17:01:50 -02:00
Hrvoje Matijakovic
a3027497c8 Merged lp:~hrvojem/percona-toolkit/pdfmanual-2.2 2015-01-21 15:42:32 +01:00
Hrvoje Matijakovic
ff7e218c96 - PDF manual is in now built along side html one
- Fixed the incorrect copyright for pdf manual
 - added the missing percona-logo to the pdf manual
2015-01-15 12:51:25 +01:00
58 changed files with 3576 additions and 912 deletions

View File

@@ -1,5 +1,28 @@
Changelog for Percona Toolkit
v2.2.14 released 2015-04-14
* Fixed bug 1402730 pt-duplicate-key-checker seems useless with MySQL 5.6
* Fixed bug 1415646 pt-duplicate-key-checker documentation does not explain how Size Duplicate Indexes is calculated
* Fixed bug 1406390 pt-heartbeat crashes with sleep argument error
* Fixed bug 1368244 pt-online-schema-change --alter-foreign-keys-method=drop-swap is not atomic
* FIxed bug 1417864 pt-online-schema-change documentation, the interpretation of --tries create_triggers:5:0.5,drop_triggers:5:0.5 is wrong
* Fixed bug 1404313 pt-query-digest: specifying a file that doesn't exist as log causes the tool to wait for STDIN instead of giving an error
* Feature 1418446 pt-slave-find resolve IP addresses option
* Fixed bug 1417558 pt-stalk with --collect-strace output doesn't go to an YYYY_MM_DD_HH_mm_ss-strace file
* Fixed bug 1425478 pt-stalk removes non-empty files that start with empty line
* Fixed bug 925781 pt-table-checksum checksum error when default-character-set = utf8
* Fixed bug 1381280 pt-table-checksum fails on BINARY field in PK
* Feature 1439842 pt-table-sync lacks --ignore-tables-regex option
* Fixed bug 1401399 pt-table-sync fails to close one db handle
* Fixed bug 1442277 pt-table-sync-ignores system databases but doc doesn't clarify this
* Fixed bug 1421781 pt-upgrade fails on SELECT ... INTO queries
* Fixed bug 1421405 pt-upgrade fails to aggregate queries based on fingerprint
* Fixed bug 1439348 pt-upgrade erroneously reports number of diffs
* Fixed bug 1421025 rpm missing dependency on perl-TermReadKey for --ask-pass
v2.2.13 released 2015-01-26

View File

@@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'percona-toolkit',
VERSION => '2.2.13',
VERSION => '2.2.14',
EXE_FILES => [ <bin/*> ],
MAN1PODS => {
'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p',

View File

@@ -1331,6 +1331,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-align 2.2.13
pt-align 2.2.14
=cut

View File

@@ -43,7 +43,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -7910,6 +7910,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-archiver 2.2.13
pt-archiver 2.2.14
=cut

View File

@@ -43,7 +43,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -5783,6 +5783,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-config-diff 2.2.13
pt-config-diff 2.2.14
=cut

View File

@@ -42,7 +42,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -5573,6 +5573,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-deadlock-logger 2.2.13
pt-deadlock-logger 2.2.14
=cut

View File

@@ -38,7 +38,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -5586,6 +5586,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-diskstats 2.2.13
pt-diskstats 2.2.14
=cut

View File

@@ -39,7 +39,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -2336,7 +2336,8 @@ sub get_duplicate_keys {
my @dupes;
KEY:
foreach my $key ( values %keys ) {
# sort by key name for consistent testing
foreach my $key ( sort {$a->{name} cmp $b->{name}} values %keys ) {
$key->{real_cols} = [ @{$key->{cols}} ];
$key->{len_cols} = length $key->{colnames};
@@ -2412,7 +2413,8 @@ sub get_duplicate_keys {
sub get_duplicate_fks {
my ( $self, $fks, %args ) = @_;
die "I need a fks argument" unless $fks;
my @fks = values %$fks;
# sort by name for consistent testing
my @fks = sort {$a->{name} cmp $b->{name}} values %$fks;
my @dupes;
foreach my $i ( 0..$#fks - 1 ) {
@@ -4881,7 +4883,7 @@ my $hdr_fmt = "# %-${hdr_width}s\n";
sub main {
local @ARGV = @_; # set global ARGV for this package
my %summary = ( 'Total Indexes' => 0 );
my %summary = ( 'items' => {'Total Indexes' => 0} );
my %seen_tbl;
my $q = new Quoter();
@@ -4972,51 +4974,49 @@ sub main {
print_all_keys($keys, $tbl, \%seen_tbl) if $keys;
print_all_keys($fks, $tbl, \%seen_tbl) if $fks;
}
else {
PTDEBUG && _d('Getting duplicate keys on',
$tbl->{db}, $tbl->{tbl});
if ( $keys ) {
$dk->get_duplicate_keys(
$keys,
clustered_key => $clustered_key,
tbl_info => $tbl,
callback => \&print_duplicate_key,
%tp_opts,
# get_duplicate_keys() ignores these args but passes them
# to the callback:
dbh => $dbh,
is_fk => 0,
o => $o,
ks => $ks,
tp => $tp,
q => $q,
seen_tbl => \%seen_tbl,
summary => \%summary,
);
}
if ( $fks ) {
$dk->get_duplicate_fks(
$fks,
tbl_info => $tbl,
callback => \&print_duplicate_key,
%tp_opts,
# get_duplicate_fks() ignores these args but passes them
# to the callback:
dbh => $dbh,
is_fk => 1,
o => $o,
ks => $ks,
tp => $tp,
q => $q,
seen_tbl => \%seen_tbl,
summary => \%summary,
);
}
PTDEBUG && _d('Getting duplicate keys on',
$tbl->{db}, $tbl->{tbl});
if ( $keys ) {
$dk->get_duplicate_keys(
$keys,
clustered_key => $clustered_key,
tbl_info => $tbl,
callback => \&print_duplicate_key,
%tp_opts,
# get_duplicate_keys() ignores these args but passes them
# to the callback:
dbh => $dbh,
is_fk => 0,
o => $o,
ks => $ks,
tp => $tp,
q => $q,
seen_tbl => \%seen_tbl,
summary => \%summary,
);
}
if ( $fks ) {
$dk->get_duplicate_fks(
$fks,
tbl_info => $tbl,
callback => \&print_duplicate_key,
%tp_opts,
# get_duplicate_fks() ignores these args but passes them
# to the callback:
dbh => $dbh,
is_fk => 1,
o => $o,
ks => $ks,
tp => $tp,
q => $q,
seen_tbl => \%seen_tbl,
summary => \%summary,
);
}
# Always count Total Keys so print_key_summary won't die
# because %summary is empty.
$summary{'Total Indexes'} += (scalar keys %$keys)
$summary{items}->{'Total Indexes'} += (scalar keys %$keys)
+ (scalar keys %$fks)
}
};
@@ -5044,7 +5044,8 @@ sub print_all_keys {
printf $hdr_fmt, "$db.$tbl";
printf $hdr_fmt, ('#' x $hdr_width);
}
foreach my $key ( values %$keys ) {
# Print keys sorted by name (easier to test)
foreach my $key ( sort {$a->{name} cmp $b->{name}} values %$keys ) {
print "\n# $key->{name} ($key->{colnames})";
}
print "\n";
@@ -5069,6 +5070,10 @@ sub print_duplicate_key {
my $summary = $args{summary};
my $struct = $tp->parse($args{tbl_info}->{ddl});
if ($dupe->{ddl} =~ /FULLTEXT/) {
$summary->{has_fulltext_dupe}++;
}
if ( !$seen_tbl->{"$db$tbl"}++ ) {
printf $hdr_fmt, ('#' x $hdr_width);
printf $hdr_fmt, "$db.$tbl";
@@ -5111,7 +5116,7 @@ sub print_duplicate_key {
print "\n";
if ( $o->get('summary') && $summary ) {
$summary->{'Total Duplicate Indexes'} += 1;
$summary->{'items'}->{'Total Duplicate Indexes'} += 1;
my ($size, $chosen_key) = $ks->get_key_size(
name => $dupe->{key},
cols => $dupe->{cols},
@@ -5128,7 +5133,7 @@ sub print_duplicate_key {
$size ||= 0;
# Create Size Duplicate Keys summary even if there's no valid keys.
$summary->{'Size Duplicate Indexes'} += $size;
$summary->{'items'}->{'Size Duplicate Indexes'} += $size;
if ( $size ) {
if ( $chosen_key && $chosen_key ne $dupe->{key} ) {
@@ -5143,14 +5148,19 @@ sub print_duplicate_key {
sub print_key_summary {
my ( %summary ) = @_;
my $items = $summary{items};
printf $hdr_fmt, ('#' x $hdr_width);
printf $hdr_fmt, 'Summary of indexes';
printf $hdr_fmt, ('#' x $hdr_width);
print "\n";
my $max_item = max(map { length($_) } keys %summary);
my $line_fmt = "# %-${max_item}s %-s\n";
foreach my $item ( sort keys %summary ) {
printf $line_fmt, $item, $summary{$item};
my $max_item = max(map { length($_) } keys %$items);
my $line_fmt = "# %-${max_item}s %-s";
foreach my $item ( sort keys %$items ) {
printf $line_fmt, $item, $items->{$item};
if ( $item eq 'Size Duplicate Indexes' && $summary{has_fulltext_dupe} ) {
print ' (not including FULLTEXT indexes)';
}
print "\n";
}
return;
}
@@ -5220,6 +5230,10 @@ It also looks for duplicate foreign keys. A duplicate foreign key covers the
same columns as another in the same table, and references the same parent
table.
The output ends with a short summary that includes an estimate of the total
size, in bytes, that the duplicate indexes are using. This is calculated by
multiplying the index length by the number of rows in their respective tables.
=head1 OPTIONS
This tool accepts additional command-line arguments. Refer to the
@@ -5607,6 +5621,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-duplicate-key-checker 2.2.13
pt-duplicate-key-checker 2.2.14
=cut

View File

@@ -1620,6 +1620,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-fifo-split 2.2.13
pt-fifo-split 2.2.14
=cut

View File

@@ -35,7 +35,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -4991,6 +4991,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-find 2.2.13
pt-find 2.2.14
=cut

View File

@@ -2211,6 +2211,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-fingerprint 2.2.13
pt-fingerprint 2.2.14
=cut

View File

@@ -37,7 +37,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -4559,6 +4559,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-fk-error-logger 2.2.13
pt-fk-error-logger 2.2.14
=cut

View File

@@ -38,7 +38,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -5286,13 +5286,16 @@ sub main {
) {
eval {
my $next_interval = $get_next_interval->();
if ( time >= $next_interval ) {
# save current time in variable to avoid race condition
# https://bugs.launchpad.net/percona-toolkit/+bug/1406390
my $time = time;
if ( $time >= $next_interval ) {
do { $next_interval = $get_next_interval->() }
until $next_interval > time;
until $next_interval > $time;
PTDEBUG && _d("Missed last interval; next interval:",
ts($next_interval));
}
sleep $next_interval - time;
sleep $next_interval - $time;
PTDEBUG && _d('Woke up at', ts(time));
# Connect or reconnect if necessary.
@@ -5419,13 +5422,16 @@ sub check_delay {
PTDEBUG && _d('Checking slave', $dp->as_string($dsn));
my $next_interval = $get_next_interval->();
if ( time >= $next_interval ) {
# save current time in variable to avoid race condition
# https://bugs.launchpad.net/percona-toolkit/+bug/1406390
my $time = time;
if ( $time >= $next_interval ) {
do { $next_interval = $get_next_interval->() }
until $next_interval > time;
until $next_interval > $time;
PTDEBUG && _d("Missed last interval; next interval:",
ts($next_interval));
}
sleep $next_interval - time;
sleep $next_interval - $time;
PTDEBUG && _d('Woke up at', ts(time));
my ($delay, $hostname, $master_server_id) = $get_delay->($sth);
@@ -6225,6 +6231,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-heartbeat 2.2.13
pt-heartbeat 2.2.14
=cut

View File

@@ -45,7 +45,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -7555,6 +7555,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-index-usage 2.2.13
pt-index-usage 2.2.14
=cut

View File

@@ -1125,7 +1125,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-ioprofile 2.2.13
pt-ioprofile 2.2.14
=cut

View File

@@ -47,7 +47,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -8254,6 +8254,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-kill 2.2.13
pt-kill 2.2.14
=cut

View File

@@ -801,7 +801,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-mext 2.2.13
pt-mext 2.2.14
=cut

View File

@@ -3088,7 +3088,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-mysql-summary 2.2.13
pt-mysql-summary 2.2.14
=cut

View File

@@ -55,7 +55,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -7970,6 +7970,7 @@ use sigtrap 'handler', \&sig_int, 'normal-signals';
my $exit_status = 0;
my $oktorun = 1;
my $dont_interrupt_now = 0;
my @drop_trigger_sqls;
my @triggers_not_dropped;
@@ -7983,6 +7984,7 @@ sub main {
$oktorun = 1;
@drop_trigger_sqls = ();
@triggers_not_dropped = ();
$dont_interrupt_now = 0;
my %stats = (
INSERT => 0,
@@ -10252,6 +10254,11 @@ sub drop_swap {
"RENAME TABLE $new_tbl->{name} TO $orig_tbl->{name}",
);
# we don't want to be interrupted during the swap!
# since it might leave original table dropped
# https://bugs.launchpad.net/percona-toolkit/+bug/1368244
$dont_interrupt_now = 1;
foreach my $sql ( @sqls ) {
PTDEBUG && _d($sql);
print $sql, "\n" if $o->get('print');
@@ -10269,6 +10276,8 @@ sub drop_swap {
}
}
$dont_interrupt_now = 0;
if ( $o->get('execute') ) {
print ts("Dropped and swapped tables OK.\n");
}
@@ -10667,6 +10676,11 @@ sub ts {
# Catches signals so we can exit gracefully.
sub sig_int {
my ( $signal ) = @_;
if ( $dont_interrupt_now ) {
# we're in the middle of something that shouldn't be interrupted
PTDEBUG && _d("Received Signal: \"$signal\" in middle of critical operation. Continuing anyway.");
return;
}
$oktorun = 0; # flag for cleanup tasks
print STDERR "# Exiting on SIG$signal.\n";
# restore terminal to normal state in case CTL+C issued while
@@ -11525,7 +11539,7 @@ To change the defaults, specify the new values like:
--tries create_triggers:5:0.5,drop_triggers:5:0.5
That makes the tool try C<create_triggers> and C<drop_triggers> 2 times
That makes the tool try C<create_triggers> and C<drop_triggers> 5 times
with a 0.5 second wait between tries. So the format is:
operation:tries:wait[,operation:tries:wait]
@@ -11807,6 +11821,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-online-schema-change 2.2.13
pt-online-schema-change 2.2.14
=cut

View File

@@ -895,7 +895,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-pmp 2.2.13
pt-pmp 2.2.14
=cut

View File

@@ -64,7 +64,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -13186,6 +13186,10 @@ sub main {
# Open the next file.
my ($fh, $filename, $filesize) = $next_file->();
if ( $fh ) {
my $fileno = fileno $fh;
if ($fileno == 0) {
print "Reading from STDIN ...\n";
}
PTDEBUG && _d('Reading', $filename);
PTDEBUG && _d('File size:', $filesize);
# catch if user is trying to use an uncoverted (raw) binlog # issue 1377888
@@ -16624,6 +16628,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-query-digest 2.2.13
pt-query-digest 2.2.14
=cut

View File

@@ -2414,6 +2414,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-show-grants 2.2.13
pt-show-grants 2.2.14
=cut

View File

@@ -1243,7 +1243,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-sift 2.2.13
pt-sift 2.2.14
=cut

View File

@@ -40,7 +40,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -4876,6 +4876,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-slave-delay 2.2.13
pt-slave-delay 2.2.14
=cut

View File

@@ -3778,6 +3778,7 @@ sub main {
node => $root,
print_node => $print_node,
MasterSlave => $ms,
resolve_address => $o->get('resolve-address'),
);
return 0;
@@ -3823,7 +3824,7 @@ sub print_slaves {
sub print_node_hostname {
my ( %args ) = @_;
my ($ms, $node, $level) = @args{qw(MasterSlave node level)};
my ($ms, $node, $level, $resolve_address) = @args{qw(MasterSlave node level resolve_address)};
die "I need a node" unless $node;
$level ||= 0;
@@ -3833,15 +3834,16 @@ sub print_node_hostname {
my $prefix = $level ? (' ' x (($level-1)*3) . '+- ') : '';
PTDEBUG && _d('level', $level, 'host', $host);
print "$prefix$host\n";
print_host($prefix, $host, $resolve_address);
return;
}
sub print_node_summary {
my ( %args ) = @_;
my ($ms, $node, $level)
= @args{qw(MasterSlave node level)};
my ($ms, $node, $level, $resolve_address)
= @args{qw(MasterSlave node level resolve_address)};
die "I need a node" unless $node;
$level ||= 0;
@@ -3851,7 +3853,7 @@ sub print_node_summary {
PTDEBUG && _d('level', $level, 'host', $host);
print "$prefix$host\n";
print_host($prefix, $host, $resolve_address);
my $dbh = $node->{dbh};
if ( !$dbh ) {
@@ -3923,6 +3925,28 @@ sub print_node_summary {
return;
}
sub print_host {
my ($prefix, $host, $resolve_address) = @_;
my $hostname;
# resolve address to hostname if user requested it
if($resolve_address) {
use Socket;
my $without_port = $host;
$without_port =~ s/:\d*$//; # strip port from ip address
my $packed = inet_aton($without_port);
if ($packed) {
$hostname = gethostbyaddr($packed, AF_INET);
}
}
if ($hostname) {
print "$prefix$host ($hostname)\n";
}
else {
print "$prefix$host\n";
}
}
sub _d {
my ($package, undef, $line) = caller 0;
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
@@ -4155,6 +4179,16 @@ about each slave, like:
=back
=item --resolve-address
Resolve ip-address to hostname. Report will print both IP and hostname.
Example:
10.10.7.14 (dbase1.sample.net)
Might delay runtime a few seconds.
=item --set-vars
type: Array
@@ -4342,6 +4376,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-slave-find 2.2.13
pt-slave-find 2.2.14
=cut

View File

@@ -41,7 +41,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -5944,6 +5944,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-slave-restart 2.2.13
pt-slave-restart 2.2.14
=cut

View File

@@ -857,7 +857,7 @@ collect() {
have_oprofile="yes"
fi
elif [ "$CMD_STRACE" -a "$OPT_COLLECT_STRACE" -a "$mysqld_pid" ]; then
$CMD_STRACE -T -s 0 -f -p $mysqld_pid > "${DEST}/$d-strace" &
$CMD_STRACE -T -s 0 -f -p $mysqld_pid -o "$d/$p-strace" &
local strace_pid=$!
fi
@@ -1000,7 +1000,7 @@ collect() {
wait_for_subshells $OPT_RUN_TIME
kill_all_subshells
for file in "$d/$p-"*; do
if [ -z "$(grep -v '^TS ' --max-count 1 "$file")" ]; then
if [ -z "$(grep -v '^TS ' --max-count 10 "$file")" ]; then
log "Removing empty file $file";
rm "$file"
fi
@@ -2241,7 +2241,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-stalk 2.2.13
pt-stalk 2.2.14
=cut

View File

@@ -2696,7 +2696,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-summary 2.2.13
pt-summary 2.2.14
=cut

View File

@@ -57,7 +57,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -10867,6 +10867,7 @@ sub check_repl_table {
}
}
# USE the correct db (probably the repl db, but maybe --replicate-database).
use_repl_db(%args);
@@ -10888,6 +10889,7 @@ sub check_repl_table {
. "You need to create the table.\n";
}
# We used to check the table privs here, but:
# https://bugs.launchpad.net/percona-toolkit/+bug/916168
@@ -10974,6 +10976,18 @@ sub check_repl_table {
}
}
if ( $o->get('binary-index') ) {
PTDEBUG && _d('--binary-index : checking if replicate table has binary type columns');
my $create_table = $tp->get_create_table( $dbh, $db, $tbl );
if ( $create_table !~ /lower_boundary`?\s+BLOB/si
|| $create_table !~ /upper_boundary`?\s+BLOB/si )
{
die "--binary-index was specified but the current checksum table ($db.$tbl) uses"
." TEXT columns. To use BLOB columns, drop the current checksum table, then recreate"
." it by specifying --create-replicate-table --binary-index.";
}
}
return; # success, repl table is ready to go
}
@@ -11132,6 +11146,10 @@ sub create_repl_table {
my $sql = $o->read_para_after(__FILE__, qr/MAGIC_create_replicate/);
$sql =~ s/CREATE TABLE checksums/CREATE TABLE IF NOT EXISTS $repl_table/;
$sql =~ s/;$//;
if ( $o->get('binary-index') ) {
$sql =~ s/`?lower_boundary`?\s+TEXT/`lower_boundary` BLOB/is;
$sql =~ s/`?upper_boundary`?\s+TEXT/`upper_boundary` BLOB/is;
}
PTDEBUG && _d($dbh, $sql);
eval {
$dbh->do($sql);
@@ -11808,6 +11826,15 @@ Check that the C<binlog_format> is the same on all servers.
See "Replicas using row-based replication" under L<"LIMITATIONS">.
=item --binary-index
This option modifies the behavior of L<"--create-replicate-table"> such that the
replicate table's upper and lower boundary columns are created with the BLOB
data type.
This is useful in cases where you have trouble checksuming tables with keys that
include a binary data type or that have non-standard character sets.
See L<"--replicate">.
=item --check-interval
type: time; default: 1; group: Throttle
@@ -12342,22 +12369,24 @@ Write checksum results to this table. The replicate table must have this
structure (MAGIC_create_replicate):
CREATE TABLE checksums (
db char(64) NOT NULL,
tbl char(64) NOT NULL,
chunk int NOT NULL,
chunk_time float NULL,
chunk_index varchar(200) NULL,
lower_boundary text NULL,
upper_boundary text NULL,
this_crc char(40) NOT NULL,
this_cnt int NOT NULL,
master_crc char(40) NULL,
master_cnt int NULL,
ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
db CHAR(64) NOT NULL,
tbl CHAR(64) NOT NULL,
chunk INT NOT NULL,
chunk_time FLOAT NULL,
chunk_index VARCHAR(200) NULL,
lower_boundary TEXT NULL,
upper_boundary TEXT NULL,
this_crc CHAR(40) NOT NULL,
this_cnt INT NOT NULL,
master_crc CHAR(40) NULL,
master_cnt INT NULL,
ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (db, tbl, chunk),
INDEX ts_db_tbl (ts, db, tbl)
) ENGINE=InnoDB;
Note: lower_boundary and upper_boundary data type can be BLOB. See L<"--binary-index">.
By default, L<"--[no]create-replicate-table"> is true, so the database and
the table specified by this option are created automatically if they do not
exist.
@@ -12788,6 +12817,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-table-checksum 2.2.13
pt-table-checksum 2.2.14
=cut

View File

@@ -55,7 +55,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -11039,6 +11039,12 @@ sub disconnect {
my $dbh = $host->{$thing};
next unless $dbh;
delete $dsn_for{$dbh};
# The following is for when misc_dbh loses
# connection due to timeout. Since it has nothing
# to commit we avoid reporting an error.
if ( $thing eq 'misc_dbh' && !$dbh->ping() ) {
next;
}
$dbh->commit() unless $dbh->{AutoCommit};
$dbh->disconnect();
PTDEBUG && _d('Disconnected dbh', $dbh);
@@ -12225,6 +12231,8 @@ type: Hash
Ignore this comma-separated list of databases.
(system databases such as B<information_schema> and B<performance_schema> are ignored by default)
=item --ignore-engines
type: Hash; default: FEDERATED,MRG_MyISAM
@@ -12239,6 +12247,12 @@ Ignore this comma-separated list of tables.
Table names may be qualified with the database name.
=item --ignore-tables-regex
type: string; group: Filter
Ignore tables whose names match the Perl regex.
=item --[no]index-hint
default: yes
@@ -12775,6 +12789,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-table-sync 2.2.13
pt-table-sync 2.2.14
=cut

View File

@@ -7571,6 +7571,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-table-usage 2.2.13
pt-table-usage 2.2.14
=cut

View File

@@ -61,7 +61,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -5858,7 +5858,7 @@ sub report_unreported_classes {
class => $class,
reasons => ["$reason, but hasn't been reported yet"],
);
$class = { reported => 1 };
$class->{reported} = 1;
};
if ( $EVAL_ERROR ) {
$success = 1;
@@ -5872,11 +5872,11 @@ sub report_unreported_classes {
sub report_if_ready {
my ($self, %args) = @_;
my $class = $args{class};
my $max_examples = $self->max_class_size;
my $max_examples = $self->max_examples;
my $max_class_size = $self->max_class_size;
my @report_reasons;
if ( scalar keys %{$class->{unique_queries}} >= $self->max_class_size ) {
if ( scalar keys %{$class->{unique_queries}} >= $max_class_size ) {
push @report_reasons, "it's full (--max-class-size)";
}
@@ -5888,15 +5888,15 @@ sub report_if_ready {
push @report_reasons, "there are $max_examples warning diffs";
}
if ( scalar @{$class->{row_diffs}} >= $self->max_examples ) {
if ( scalar @{$class->{row_diffs}} >= $max_examples ) {
push @report_reasons, "there are $max_examples row diffs";
}
if ( scalar @{$class->{errors}} >= $self->max_examples ) {
if ( scalar @{$class->{errors}} >= $max_examples ) {
push @report_reasons, "there are $max_examples query errors";
}
if ( scalar @{$class->{failures}} >= $self->max_examples ) {
if ( scalar @{$class->{failures}} >= $max_examples ) {
push @report_reasons, "there are $max_examples failed queries";
}
@@ -5906,7 +5906,7 @@ sub report_if_ready {
class => $class,
reasons => \@report_reasons,
);
$class = { reported => 1 };
$class->{reported} = 1;
}
return;
@@ -5917,6 +5917,11 @@ sub report_class {
my $class = $args{class};
my $reasons = $args{reasons};
if ( $class->{reported} ) {
PTDEBUG && _d('Class already reported');
return;
}
PTDEBUG && _d('Reporting class', $class->{id}, $class->{fingerprint});
$self->_print_class_header(
@@ -6304,7 +6309,11 @@ sub save {
else {
my $rows;
if ( my $sth = $results->{sth} ) {
if ( $event->{arg} =~ m/(?:^\s*SELECT|(?:\*\/\s*SELECT))/i ) {
# Only fetch rows of select statements
# *except* when they are directed INTO
# a file or a variable. (issue lp:1421781)
if ( $event->{arg} =~ m/(?:^\s*SELECT|(?:\*\/\s*SELECT))/i
&& $event->{arg} !~ /INTO\s*(?:OUTFILE|DUMPFILE|@)/ ) {
$rows = $sth->fetchall_arrayref();
}
eval {
@@ -10120,9 +10129,11 @@ sub save_and_report_results {
ignore_warnings => $ignore_warnings,
);
# Only SELECT statements return rows.
# Only SELECT statements return rows, *except* when they are directed
# INTO a file or a variable.
my $row_diffs;
if ( $event->{arg} =~ m/(?:^\s*SELECT|(?:\*\/\s*SELECT))/i ) {
if ( $event->{arg} =~ m/(?:^\s*SELECT|(?:\*\/\s*SELECT))/i
&& $event->{arg} !~ m/INTO\s*(?:OUTFILE|DUMPFILE|@)/i ) {
$row_diffs = diff_rows(
sth1 => $results1->{sth},
sth2 => $results2->{sth},
@@ -10608,6 +10619,8 @@ C<0.5> is worse than C<0.1>, and so the query will be reported.
=head2 READ-ONLY
By default, pt-upgrade only executes C<SELECT> and C<SET> statements.
(This does not include 'SELECT...INTO' statements, which do not return
rows but dump output to a file or variable.)
If you're using recreatable test or development servers and wish to
compare write statements too (e.g. C<INSERT>, C<UPDATE>, C<DELETE>),
then specify C<--no-read-only>. If using a binary log, you must
@@ -11290,6 +11303,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-upgrade 2.2.13
pt-upgrade 2.2.14
=cut

View File

@@ -44,7 +44,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';
@@ -6145,6 +6145,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-variable-advisor 2.2.13
pt-variable-advisor 2.2.14
=cut

View File

@@ -3251,6 +3251,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-visual-explain 2.2.13
pt-visual-explain 2.2.14
=cut

View File

@@ -1,3 +1,26 @@
percona-toolkit (2.2.14) unstable; urgency=low
* Fixed bug 1402730 pt-duplicate-key-checker seems useless with MySQL 5.6
* Fixed bug 1415646 pt-duplicate-key-checker documentation does not explain how Size Duplicate Indexes is calculated
* Fixed bug 1406390 pt-heartbeat crashes with sleep argument error
* Fixed bug 1368244 pt-online-schema-change --alter-foreign-keys-method=drop-swap is not atomic
* FIxed bug 1417864 pt-online-schema-change documentation, the interpretation of --tries create_triggers:5:0.5,drop_triggers:5:0.5 is wrong
* Fixed bug 1404313 pt-query-digest: specifying a file that doesn't exist as log causes the tool to wait for STDIN instead of giving an error
* Feature 1418446 pt-slave-find resolve IP addresses option
* Fixed bug 1417558 pt-stalk with --collect-strace output doesn't go to an YYYY_MM_DD_HH_mm_ss-strace file
* Fixed bug 1425478 pt-stalk removes non-empty files that start with empty line
* Fixed bug 925781 pt-table-checksum checksum error when default-character-set = utf8
* Fixed bug 1381280 pt-table-checksum fails on BINARY field in PK
* Feature 1439842 pt-table-sync lacks --ignore-tables-regex option
* Fixed bug 1401399 pt-table-sync fails to close one db handle
* Fixed bug 1442277 pt-table-sync-ignores system databases but doc doesn't clarify this
* Fixed bug 1421781 pt-upgrade fails on SELECT ... INTO queries
* Fixed bug 1421405 pt-upgrade fails to aggregate queries based on fingerprint
* Fixed bug 1439348 pt-upgrade erroneously reports number of diffs
* Fixed bug 1421025 rpm missing dependency on perl-TermReadKey for --ask-pass
-- Percona Toolkit Developers <toolkit-dev@percona.com> Fri, 10 Apr 2015 08:38:24 +0000
percona-toolkit (2.2.13) unstable; urgency=low
* Feature 1391240: pt-kill added query fingerprint hash to output

View File

@@ -9,7 +9,7 @@ URL: http://www.percona.com/software/percona-toolkit/
Source: percona-toolkit-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
Requires: perl(DBI) >= 1.13, perl(DBD::mysql) >= 1.0, perl(Time::HiRes), perl(IO::Socket::SSL), perl(Digest::MD5)
Requires: perl(DBI) >= 1.13, perl(DBD::mysql) >= 1.0, perl(Time::HiRes), perl(IO::Socket::SSL), perl(Digest::MD5), perl(Term::ReadKey)
AutoReq: no
%description

View File

@@ -41,7 +41,7 @@ master_doc = 'index'
# General information about the project.
project = u'Percona Toolkit'
copyright = u'2013, Percona LLC and/or its affiliates'
copyright = u'2015, Percona LLC and/or its affiliates'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -50,7 +50,7 @@ copyright = u'2013, Percona LLC and/or its affiliates'
# The short X.Y version.
version = '2.2'
# The full version, including alpha/beta/rc tags.
release = '2.2.13'
release = '2.2.14'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -179,12 +179,12 @@ htmlhelp_basename = 'PerconaToolkitdoc'
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'PerconaToolkit.tex', u'Percona Toolkit Documentation',
u'Percona Ireland Ltd', 'manual'),
u'2015, Percona LLC and/or its affiliates', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
latex_logo = 'percona-logo.jpg'
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
@@ -212,5 +212,5 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'perconatoolkit', u'Percona Toolkit Documentation',
[u'Percona Ireland Ltd'], 1)
[u'2015, Percona LLC and/or its affiliates'], 1)
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

File diff suppressed because one or more lines are too long

View File

@@ -31,7 +31,7 @@ div.document {
margin: 0 auto;
overflow: hidden;
padding: 30px 0;
width: 960px;
width: 1000px;
}
div.documentwrapper {
@@ -42,7 +42,8 @@ div.documentwrapper {
div.bodywrapper {
margin: 10 0 0 0px;
width: 660px;
padding-right: 12px;
width: 700px;
float:right;
}
@@ -50,6 +51,7 @@ div.body {
background-color: #fff;
color: #333333;
padding: 0 0 20px;
width: 712px;
}
{%- if theme_rightsidebar|tobool %}
@@ -64,9 +66,9 @@ div.footer {
/* padding: 9px 0 9px 0; */
/* text-align: center; */
/* font-size: 75%; */
font: 80% "Lucida Grande",Verdana,Lucida,Helvetica,Arial,sans-serif;
background: none repeat scroll 0 0 #333333;
border-top: 2px solid #D95200;
/*font: 80% "Lucida Grande",Verdana,Lucida,Helvetica,Arial,sans-serif; */
/*background: none repeat scroll 0 0 #333333;*/
/*border-top: 2px solid #D95200;*/
overflow: hidden;
}
@@ -83,7 +85,7 @@ div.related {
border: 1px solid #E0E0E0;
clear: both;
padding: 10px;
width: 635px;
width: 690px;
margin-bottom: 5px;
}
@@ -93,10 +95,10 @@ div.related a {
div.sphinxsidebar {
margin-left: 0px;
margin-right: 30px;
margin-right: 20px;
color: #333333;
font-family: Arial,Helvetica,sans-serif;
width: 260px;
width: 250px;
{%- if theme_stickysidebar|tobool %}
top: 30px;
bottom: 0;

File diff suppressed because it is too large Load Diff

View File

@@ -557,6 +557,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
Percona Toolkit v2.2.13 released 2015-01-23
Percona Toolkit v2.2.14 released 2015-04-10
=cut

View File

@@ -1,6 +1,63 @@
Release Notes
*************
v2.2.14 released 2015-04-14
===========================
Percona Toolkit 2.2.14 has been released. This release contains two new features and seventeen bug fixes.
New Features:
* pt-slave-find can now resolve the IP address and show the slave's hostname. This can be done with the new ``--resolve-address`` option.
* pt-table-sync can now ignore the tables whose names match specific Perl regex with the ``--ignore-tables-regex`` option.
Bugs Fixed:
* Fixed bug 925781: Inserting non-BMP characters into a column with utf8 charset would cause the ``Incorrect string value`` error when running the pt-table-checksum.
* Fixed bug 1368244: pt-online-schema-change ``--alter-foreign-keys-method=drop-swap`` was not atomic and thus it could be interrupted. Fixed by disabling common interrupt signals during the critical drop-rename phase.
* Fixed bug 1381280: pt-table-checksum was failing on ``BINARY`` field in Primary Key. Fixed by implementing new ``--binary-index`` flag to optionally create checksum table using BLOB data type.
* Fixed bug 1421405: Running pt-upgrade against a log with many identical (or similar) queries was producing repeated sections with the same fingerprint.
* Fixed bug 1402730: pt-duplicate-key-checker was not checking for duplicate keys when ``--verbose`` option was set.
* Fixed bug 1406390: A race condition was causing pt-heartbeat to crash with sleep argument error.
* Fixed bug 1417558: pt-stalk when used along with ``--collect-strace`` didn't write the strace output to the expected destination file.
* Fixed bug 1421025: Missing dependency for ``perl-TermReadKey`` RPM package was causing toolkit commands to fail when they were run with ``--ask-pass`` option.
* Fixed bug 1421781: pt-upgrade would fail when log contained ``SELECT...INTO`` queries. Fixed by ignoring/skipping those queries.
* Fixed bug 1425478: pt-stalk was removing non-empty files that were starting with an empty line.
* Fixed bug 1419098: Fixed bad formatting in the pt-table-checksum documentation.
Changelog
---------
* Fixed bug 1402730 pt-duplicate-key-checker seems useless with MySQL 5.6
* Fixed bug 1415646 pt-duplicate-key-checker documentation does not explain how Size Duplicate Indexes is calculated
* Fixed bug 1406390 pt-heartbeat crashes with sleep argument error
* Fixed bug 1368244 pt-online-schema-change --alter-foreign-keys-method=drop-swap is not atomic
* FIxed bug 1417864 pt-online-schema-change documentation, the interpretation of --tries create_triggers:5:0.5,drop_triggers:5:0.5 is wrong
* Fixed bug 1404313 pt-query-digest: specifying a file that doesn't exist as log causes the tool to wait for STDIN instead of giving an error
* Feature 1418446 pt-slave-find resolve IP addresses option
* Fixed bug 1417558 pt-stalk with --collect-strace output doesn't go to an YYYY_MM_DD_HH_mm_ss-strace file
* Fixed bug 1425478 pt-stalk removes non-empty files that start with empty line
* Fixed bug 925781 pt-table-checksum checksum error when default-character-set = utf8
* Fixed bug 1381280 pt-table-checksum fails on BINARY field in PK
* Feature 1439842 pt-table-sync lacks --ignore-tables-regex option
* Fixed bug 1401399 pt-table-sync fails to close one db handle
* Fixed bug 1442277 pt-table-sync-ignores system databases but doc doesn't clarify this
* Fixed bug 1421781 pt-upgrade fails on SELECT ... INTO queries
* Fixed bug 1421405 pt-upgrade fails to aggregate queries based on fingerprint
* Fixed bug 1439348 pt-upgrade erroneously reports number of diffs
* Fixed bug 1421025 rpm missing dependency on perl-TermReadKey for --ask-pass
v2.2.13 released 2015-01-26
===========================

View File

@@ -18,7 +18,7 @@
# ###########################################################################
package Percona::Toolkit;
our $VERSION = '2.2.13';
our $VERSION = '2.2.14';
use strict;
use warnings FATAL => 'all';

View File

@@ -128,9 +128,11 @@ sub save {
}
else {
# Save rows, if any (i.e. if it's a SELECT statement).
# *except* if it's a SELECT...INTO (issue lp:1421781)
my $rows;
if ( my $sth = $results->{sth} ) {
if ( $event->{arg} =~ m/(?:^\s*SELECT|(?:\*\/\s*SELECT))/i ) {
if ( $event->{arg} =~ m/(?:^\s*SELECT|(?:\*\/\s*SELECT))/i
&& $event->{arg} !~ /INTO\s*(?:OUTFILE|DUMPFILE|@)/ ) {
$rows = $sth->fetchall_arrayref();
}
eval {

View File

@@ -220,7 +220,7 @@ sub report_unreported_classes {
class => $class,
reasons => ["$reason, but hasn't been reported yet"],
);
$class = { reported => 1 };
$class->{reported} = 1;
};
if ( $EVAL_ERROR ) {
$success = 1;
@@ -234,11 +234,11 @@ sub report_unreported_classes {
sub report_if_ready {
my ($self, %args) = @_;
my $class = $args{class};
my $max_examples = $self->max_class_size;
my $max_examples = $self->max_examples;
my $max_class_size = $self->max_class_size;
my @report_reasons;
if ( scalar keys %{$class->{unique_queries}} >= $self->max_class_size ) {
if ( scalar keys %{$class->{unique_queries}} >= $max_class_size ) {
push @report_reasons, "it's full (--max-class-size)";
}
@@ -250,15 +250,15 @@ sub report_if_ready {
push @report_reasons, "there are $max_examples warning diffs";
}
if ( scalar @{$class->{row_diffs}} >= $self->max_examples ) {
if ( scalar @{$class->{row_diffs}} >= $max_examples ) {
push @report_reasons, "there are $max_examples row diffs";
}
if ( scalar @{$class->{errors}} >= $self->max_examples ) {
if ( scalar @{$class->{errors}} >= $max_examples ) {
push @report_reasons, "there are $max_examples query errors";
}
if ( scalar @{$class->{failures}} >= $self->max_examples ) {
if ( scalar @{$class->{failures}} >= $max_examples ) {
push @report_reasons, "there are $max_examples failed queries";
}
@@ -268,7 +268,7 @@ sub report_if_ready {
class => $class,
reasons => \@report_reasons,
);
$class = { reported => 1 };
$class->{reported} = 1;
}
return;
@@ -279,6 +279,11 @@ sub report_class {
my $class = $args{class};
my $reasons = $args{reasons};
if ( $class->{reported} ) {
PTDEBUG && _d('Class already reported');
return;
}
PTDEBUG && _d('Reporting class', $class->{id}, $class->{fingerprint});
$self->_print_class_header(

View File

@@ -142,11 +142,24 @@ $sb->load_file('master', 't/lib/samples/dupekeys/simple_dupe_bug_1217013.sql', '
ok(
no_diff(
sub { pt_duplicate_key_checker::main(@args, qw(-t test.domains)) },
"$sample/simple_dupe_bug_1217013.txt"),
sub { pt_duplicate_key_checker::main(@args, qw(-t test.domains -v)) },
"$sample/simple_dupe_bug_1217013.txt", keep_output=>1),
'Exact unique dupes (bug 1217013)'
) or diag($test_diff);
# #############################################################################
# Same thing, but added --verbose option to test for:
# https://bugs.launchpad.net/percona-toolkit/+bug/1402730
# #############################################################################
ok(
no_diff(
sub { pt_duplicate_key_checker::main(@args, qw(-t test.domains --verbose)) },
"$sample/simple_dupe_bug_1217013.txt", keep_output=>1),
q[--verbose option doesn't skip dupes reporting (bug 1402730)]
) or diag($test_diff);
# #############################################################################
# Done.
# #############################################################################

View File

@@ -41,10 +41,10 @@ $sb->load_file('master', 't/pt-duplicate-key-checker/samples/issue_331.sql', 'te
ok(
no_diff(
sub { pt_duplicate_key_checker::main(@args, qw(-d issue_331)) },
't/pt-duplicate-key-checker/samples/issue_331.txt',
't/pt-duplicate-key-checker/samples/issue_331.txt'
),
'Issue 331 crash on fks'
);
) or diag($test_diff);
# #############################################################################
# Done.

View File

@@ -2,14 +2,14 @@
# issue_331.issue_331_t2
# ########################################################################
# FOREIGN KEY fk_1 (`id`) REFERENCES `issue_331`.`issue_331_t1` (`t1_id`) is a duplicate of FOREIGN KEY fk_2 (`id`) REFERENCES `issue_331`.`issue_331_t1` (`t1_id`)
# FOREIGN KEY fk_2 (`id`) REFERENCES `issue_331`.`issue_331_t1` (`t1_id`) is a duplicate of FOREIGN KEY fk_1 (`id`) REFERENCES `issue_331`.`issue_331_t1` (`t1_id`)
# Key definitions:
# CONSTRAINT `fk_1` FOREIGN KEY (`id`) REFERENCES `issue_331_t1` (`t1_id`)
# CONSTRAINT `fk_2` FOREIGN KEY (`id`) REFERENCES `issue_331_t1` (`t1_id`)
# CONSTRAINT `fk_1` FOREIGN KEY (`id`) REFERENCES `issue_331_t1` (`t1_id`)
# Column types:
# `id` bigint(20) not null default '0'
# To remove this duplicate foreign key, execute:
ALTER TABLE `issue_331`.`issue_331_t2` DROP FOREIGN KEY `fk_1`;
ALTER TABLE `issue_331`.`issue_331_t2` DROP FOREIGN KEY `fk_2`;
# MySQL uses the PRIMARY index for this foreign key constraint

View File

@@ -2,15 +2,19 @@
# test.domains
# ########################################################################
# Uniqueness of domain ignored because unique_key_domain is a duplicate constraint
# domain is a duplicate of unique_key_domain
# PRIMARY (`id`)
# domain (`domain`)
# unique_key_domain (`domain`)
# Uniqueness of unique_key_domain ignored because domain is a duplicate constraint
# unique_key_domain is a duplicate of domain
# Key definitions:
# UNIQUE KEY `domain` (`domain`),
# UNIQUE KEY `unique_key_domain` (`domain`)
# UNIQUE KEY `domain` (`domain`),
# Column types:
# `domain` varchar(175) collate utf8_bin not null
# To remove this duplicate index, execute:
ALTER TABLE `test`.`domains` DROP INDEX `domain`;
ALTER TABLE `test`.`domains` DROP INDEX `unique_key_domain`;
# ########################################################################
# Summary of indexes

View File

@@ -43,7 +43,7 @@ elsif ( !$slave2_dbh ) {
plan skip_all => 'Cannot connect to second sandbox slave';
}
else {
plan tests => 9;
plan tests => 10;
}
my @args = ('h=127.0.0.1,P=12345,u=msandbox,p=msandbox');
@@ -67,6 +67,17 @@ my $expected = <<EOF;
EOF
is($output, $expected, 'Master with slave and slave of slave');
###############################################################################
# Test --resolve-hostname option (we don't know the hostname of the test
# machine so we settle for any non null string)
###############################################################################
$output = `$trunk/bin/pt-slave-find -h 127.0.0.1 -P 12345 -u msandbox -p msandbox --report-format hostname --resolve-address`;
like (
$output,
qr/127\.0\.0\.1:12345\s+\(\w+\)/s,
"--resolve-address option"
) or diag($output);
# #############################################################################
# Until MasterSlave::find_slave_hosts() is improved to overcome the problems
# with SHOW SLAVE HOSTS, this test won't work.
@@ -146,6 +157,7 @@ ok(
"Summary report format",
);
# #############################################################################
# Done.
# #############################################################################

View File

@@ -68,7 +68,7 @@ $sb->wait_for_slaves();
# then starts it again.
# TEST_WISHLIST PLUGIN_WISHLIST: do this with a plugin to the tool itself,
# not in this unreliable fashion.
system("$trunk/util/wait-to-exec '$scripts/wait-for-chunk.sh 12345 sakila city 1' '$scripts/exec-wait-exec.sh 12347 \"stop slave sql_thread\" 2 \"start slave sql_thread\"' 3 >/dev/null &");
system("$trunk/util/wait-to-exec '$scripts/wait-for-chunk.sh 12345 sakila city 1' '$scripts/exec-wait-exec.sh 12347 \"stop slave sql_thread\" 2 \"start slave sql_thread\"' 4 >/dev/null &");
$output = output(
sub { pt_table_checksum::main(@args, qw(-d sakila)); },

View File

@@ -0,0 +1,66 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use File::Basename;
use File::Temp qw(tempdir);
$ENV{PERCONA_TOOLKIT_TEST_USE_DSN_NAMES} = 1;
$ENV{PRETTY_RESULTS} = 1;
use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-upgrade";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $dbh1 = $sb->get_dbh_for('host1');
if ( !$dbh1 ) {
plan skip_all => 'Cannot connect to sandbox host1';
}
my $host1_dsn = $sb->dsn_for('host1');
my $tmpdir = tempdir("/tmp/pt-upgrade.$PID.XXXXXX", CLEANUP => 1);
my $samples = "$trunk/t/pt-upgrade/samples";
my $lib_samples = "$trunk/t/lib/samples";
my $exit_status = 0;
my $output;
# #############################################################################
# genlog
# #############################################################################
`rm -f /tmp/test_select_into_*.log`;
$output = output(
sub {
$exit_status = pt_upgrade::main($host1_dsn, '--save-results', $tmpdir,
qw(--type rawlog),
"$samples/select_into.log",
)},
stderr => 1,
);
is(
$exit_status,
0,
"Does not fail on SELECT...INTO statements"
);
# #############################################################################
# Done.
# #############################################################################
$sb->wipe_clean($dbh1);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
done_testing;

View File

@@ -0,0 +1,2 @@
type=rawlog
max-examples=3

View File

@@ -0,0 +1,9 @@
select @@port
select @@port
select @@port
select @@port
select @@port
select @@port
select @@port
select @@port
select @@port

View File

@@ -0,0 +1,75 @@
#-----------------------------------------------------------------------
# Logs
#-----------------------------------------------------------------------
File: ...
Size: 126
#-----------------------------------------------------------------------
# Hosts
#-----------------------------------------------------------------------
host1:
DSN: h=127.1,P=12345
hostname: ...
MySQL: ...
host2:
DSN: h=127.1,P=12348
hostname: ...
MySQL: ...
########################################################################
# Query class 3530F787A2430DC8
########################################################################
Reporting class because there are 3 row diffs.
Total queries 3
Unique queries 3
Discarded queries 0
select @@port
##
## Row diffs: 3
##
-- 1.
@ row 1
< 12345
> 12348
select @@port
-- 2.
@ row 1
< 12345
> 12348
select @@port
-- 3.
@ row 1
< 12345
> 12348
select @@port
#-----------------------------------------------------------------------
# Stats
#-----------------------------------------------------------------------
failed_queries 0
not_select 0
queries_filtered 0
queries_no_diffs 0
queries_read 9
queries_with_diffs 9
queries_with_errors 0

View File

@@ -0,0 +1,4 @@
SELECT 1 INTO @foo;
SELECT * FROM sakila.actor INTO OUTFILE '/tmp/test_select_into_1.log';
SELECT actor_id,first_name FROM sakila.actor LIMIT 1 INTO DUMPFILE '/tmp/test_select_into_2.log';

View File

@@ -168,7 +168,7 @@ fi
BUILD=${BUILD:-1}
if [ $BUILD -eq 1 ]; then
cd $BRANCH/config/sphinx-build
make html
make html && make latexpdf
exit_status=$(( exit_status | $? ))
fi