mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
Merge branch '3.0' into PMM-1905_drop_ntoreturn_if_negative
This commit is contained in:
@@ -2,8 +2,10 @@ Changelog for Percona Toolkit
|
||||
|
||||
v3.0.7
|
||||
|
||||
* Feature PT-644 : Added --mysql-only option to pt-stalk for RDS
|
||||
* Fixed Bug PT-244 : pt-online-schema-change --data-dir option broken for partitioned table
|
||||
* Feature PT-633 : Added --mysql-only option to pt-stalk for RDS
|
||||
* Fixed bug PT-1256: pt-table-sync does not use the character set for the table it is synchronizing
|
||||
* Fixed bug PT-1455: pt-osc is stuck when the table that is being altered is filtered out in the slave
|
||||
* Fixed bug PMM-1905: Explain fails if encounters negative "ntoreturn"
|
||||
|
||||
v3.0.6 released 2017-12-20
|
||||
|
@@ -5373,15 +5373,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -5598,6 +5599,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -5634,7 +5675,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -4711,15 +4711,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -4936,6 +4937,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -4972,7 +5013,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -3775,15 +3775,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -4000,6 +4001,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -4036,7 +4077,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -4328,15 +4328,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -4553,6 +4554,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -4589,7 +4630,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -4379,15 +4379,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -4604,6 +4605,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -4640,7 +4681,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
57
bin/pt-find
57
bin/pt-find
@@ -3093,15 +3093,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -3318,6 +3319,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -3354,7 +3395,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -3280,15 +3280,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -3505,6 +3506,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -3541,7 +3582,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -4980,15 +4980,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -5205,6 +5206,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -5241,7 +5282,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -5777,15 +5777,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -6002,6 +6003,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -6038,7 +6079,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
57
bin/pt-kill
57
bin/pt-kill
@@ -6185,15 +6185,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -6410,6 +6411,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -6446,7 +6487,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -4281,7 +4281,8 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
#TODO REMOVE DEBUG
|
||||
print STDERR "1> Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
@@ -5001,7 +5002,7 @@ sub wait {
|
||||
my $lag = $get_lag->($lagged_slaves[$i]->{cxn});
|
||||
PTDEBUG && _d($lagged_slaves[$i]->{cxn}->name(),
|
||||
'slave lag:', $lag);
|
||||
if ( !defined $lag || $lag > $max_lag ) {
|
||||
if ( defined $lag && $lag > $max_lag ) {
|
||||
$lagged_slaves[$i]->{lag} = $lag;
|
||||
}
|
||||
else {
|
||||
@@ -7413,15 +7414,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -7638,6 +7640,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -7674,7 +7716,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
@@ -8693,7 +8735,8 @@ sub main {
|
||||
# to stop lagging. If any replica is stopped, the tool
|
||||
# waits forever until the replica is started."
|
||||
# https://bugs.launchpad.net/percona-toolkit/+bug/1402051
|
||||
PTDEBUG && _d('Cannot connect to', $cxn->name(), ':',
|
||||
#TODO REMOVE DEBUG
|
||||
PTDEBUG && _d('2> Cannot connect to', $cxn->name(), ':',
|
||||
$EVAL_ERROR);
|
||||
# Make ReplicaLagWaiter::wait() report slave is stopped.
|
||||
return undef;
|
||||
@@ -9134,7 +9177,8 @@ sub main {
|
||||
}
|
||||
};
|
||||
|
||||
if ( $slaves && scalar @$slaves ) {
|
||||
my $table_is_replicated;
|
||||
if ( $slaves && scalar @$slaves && $table_is_replicated) {
|
||||
foreach my $slave (@$slaves) {
|
||||
my ($pr, $pr_first_report);
|
||||
if ( $o->get('progress') ) {
|
||||
@@ -12843,7 +12887,7 @@ Default character set.
|
||||
|
||||
=item * D
|
||||
|
||||
dsn: database; copy: yes
|
||||
dsn: database; copy: no
|
||||
|
||||
Database for the old and new table.
|
||||
|
||||
@@ -12994,6 +13038,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-online-schema-change 3.0.6
|
||||
pt-online-schema-change 3.0.7
|
||||
|
||||
=cut
|
||||
|
@@ -12446,15 +12446,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -12671,6 +12672,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -12707,7 +12748,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -3597,15 +3597,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -3822,6 +3823,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -3858,7 +3899,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -4306,15 +4306,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -4531,6 +4532,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -4567,7 +4608,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -797,15 +797,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -1022,6 +1023,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -1058,7 +1099,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -9215,15 +9215,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -9440,6 +9441,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -9476,7 +9517,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -4086,15 +4086,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -4311,6 +4312,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -4347,7 +4388,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -4504,15 +4504,16 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -4729,6 +4730,46 @@ sub get_instance_id {
|
||||
}
|
||||
|
||||
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
|
||||
sub pingback {
|
||||
my (%args) = @_;
|
||||
my @required_args = qw(url instances);
|
||||
@@ -4765,7 +4806,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
8
config/deb/postinst
Normal file
8
config/deb/postinst
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -e /etc/percona-toolkit/.percona.toolkit.uuid ]; then
|
||||
mkdir -p /etc/percona-toolkit
|
||||
perl -e 'printf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;' > /etc/percona-toolkit/.percona.toolkit.uuid
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
@@ -42,6 +42,11 @@ find $RPM_BUILD_ROOT -type f -name 'percona-toolkit.pod' -exec rm -f {} ';'
|
||||
rm -rf $RPM_BUILD_ROOT/usr/share/perl5
|
||||
chmod -R u+w $RPM_BUILD_ROOT/*
|
||||
|
||||
%post
|
||||
if [ ! -e /etc/percona-toolkit/.percona.toolkit.uuid ]; then
|
||||
mkdir -p /etc/percona-toolkit
|
||||
perl -e 'printf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;' > /etc/percona-toolkit/.percona.toolkit.uuid
|
||||
fi
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
@@ -48,6 +48,14 @@ eval {
|
||||
require HTTP::Micro;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
# Return the version check file used to keep track of
|
||||
# MySQL instance that have been checked and when. Some
|
||||
# systems use random tmp dirs; we don't want that else
|
||||
@@ -55,13 +63,6 @@ eval {
|
||||
# per system is the goal, so prefer global sys dirs first.
|
||||
{
|
||||
my $file = 'percona-version-check';
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
my @vc_dirs = (
|
||||
'/etc/percona',
|
||||
'/etc/percona-toolkit',
|
||||
'/tmp',
|
||||
"$home",
|
||||
);
|
||||
|
||||
sub version_check_file {
|
||||
foreach my $dir ( @vc_dirs ) {
|
||||
@@ -326,6 +327,49 @@ sub get_instance_id {
|
||||
return $name, $id;
|
||||
}
|
||||
|
||||
|
||||
# This function has been implemented solely to be able to count individual
|
||||
# Toolkit users for statistics. It uses a random UUID, no client info is
|
||||
# being gathered nor stored
|
||||
sub get_uuid {
|
||||
my $uuid_file = '/.percona-toolkit.uuid';
|
||||
foreach my $dir (@vc_dirs) {
|
||||
my $filename = $dir.$uuid_file;
|
||||
my $uuid=_read_uuid($filename);
|
||||
return $uuid if $uuid;
|
||||
}
|
||||
|
||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||
my $uuid = _generate_uuid();
|
||||
|
||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
||||
print $fh $uuid;
|
||||
close $fh;
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
}
|
||||
|
||||
sub _read_uuid {
|
||||
my $filename = shift;
|
||||
my $fh;
|
||||
|
||||
eval {
|
||||
open($fh, '<:encoding(UTF-8)', $filename);
|
||||
};
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
my $uuid;
|
||||
eval { $uuid = <$fh>; };
|
||||
return if ($EVAL_ERROR);
|
||||
|
||||
chomp $uuid;
|
||||
return $uuid;
|
||||
}
|
||||
|
||||
# #############################################################################
|
||||
# Protocol handlers
|
||||
# #############################################################################
|
||||
@@ -387,7 +431,7 @@ sub pingback {
|
||||
my $client_content = encode_client_response(
|
||||
items => $items,
|
||||
versions => $versions,
|
||||
general_id => md5_hex( hostname() ),
|
||||
general_id => get_uuid(),
|
||||
);
|
||||
|
||||
my $client_response = {
|
||||
|
@@ -201,7 +201,7 @@ is_deeply(
|
||||
# Former Pingback tests
|
||||
# #############################################################################
|
||||
|
||||
my $general_id = md5_hex( hostname() );
|
||||
my $general_id = VersionCheck::get_uuid();
|
||||
my $master_id; # the instance ID, _not_ 12345 etc.
|
||||
my $slave1_id; # the instance ID, _not_ 12346 etc.
|
||||
my ($mysql_ver, $mysql_distro);
|
||||
@@ -679,6 +679,22 @@ foreach my $tool ( @vc_tools ) {
|
||||
);
|
||||
}
|
||||
|
||||
my $should_remove_uuid_file;
|
||||
my $home_uuid_file = $ENV{"HOME"} . "/.percona-toolkit.uuid";
|
||||
|
||||
if ( ! -e $home_uuid_file ) {
|
||||
$should_remove_uuid_file = 1;
|
||||
}
|
||||
|
||||
my $uuid = VersionCheck::get_uuid();
|
||||
is (
|
||||
length($uuid),
|
||||
36,
|
||||
"Have a valid UUID4",
|
||||
);
|
||||
|
||||
unlink $home_uuid_file if $should_remove_uuid_file;
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
@@ -165,7 +165,7 @@ else {
|
||||
}
|
||||
$master_dbh->do("USE pt_osc");
|
||||
$master_dbh->do("TRUNCATE TABLE t");
|
||||
$master_dbh->do("LOAD DATA LOCAL INFILE '$trunk/t/pt-online-schema-change/samples/basic_no_fks.data' INTO TABLE t");
|
||||
$master_dbh->do("LOAD DATA INFILE '$trunk/t/pt-online-schema-change/samples/basic_no_fks.data' INTO TABLE t");
|
||||
$master_dbh->do("ANALYZE TABLE t");
|
||||
$sb->wait_for_slaves();
|
||||
|
||||
@@ -215,7 +215,7 @@ is(
|
||||
|
||||
$master_dbh->do("USE pt_osc");
|
||||
$master_dbh->do("TRUNCATE TABLE t");
|
||||
$master_dbh->do("LOAD DATA LOCAL INFILE '$trunk/t/pt-online-schema-change/samples/basic_no_fks.data' INTO TABLE t");
|
||||
$master_dbh->do("LOAD DATA INFILE '$trunk/t/pt-online-schema-change/samples/basic_no_fks.data' INTO TABLE t");
|
||||
$master_dbh->do("ANALYZE TABLE t");
|
||||
$sb->wait_for_slaves();
|
||||
|
||||
|
@@ -46,6 +46,11 @@ my $exit_status;
|
||||
my $sample = "t/pt-online-schema-change/samples/";
|
||||
|
||||
$sb->load_file('master', "$sample/issue-1646713.sql");
|
||||
my $num_rows = 1000;
|
||||
my $master_port = 12345;
|
||||
|
||||
$master_dbh->do("FLUSH TABLES");
|
||||
$sb->wait_for_slaves();
|
||||
|
||||
sub start_thread {
|
||||
my ($dsn_opts, $sleep_time) = @_;
|
||||
@@ -53,14 +58,18 @@ sub start_thread {
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $dbh = $sb->get_dbh_for('master');
|
||||
diag("Thread started: Sleeping $sleep_time seconds before updating the PK field for row with id=1 in test.sbtest");
|
||||
sleep($sleep_time);
|
||||
# We need to lock the tables to prevent osc to really start before we are able to write the row to the table
|
||||
$dbh->do("LOCK TABLES `test`.`o1` WRITE");
|
||||
select(undef, undef, undef, $sleep_time);
|
||||
$dbh->do("UPDATE `test`.`o1` SET id=0 WHERE id=1");
|
||||
$dbh->do("UNLOCK TABLES");
|
||||
diag("Row updated");
|
||||
}
|
||||
my $thr = threads->create('start_thread', $dsn_opts, 1);
|
||||
my $thr = threads->create('start_thread', $dsn_opts, 0.50);
|
||||
$thr->detach();
|
||||
threads->yield();
|
||||
|
||||
|
||||
diag("Starting osc. A row will be updated in a different thread.");
|
||||
my $dir = tempdir( CLEANUP => 1 );
|
||||
$output = output(
|
||||
@@ -71,6 +80,7 @@ $output = output(
|
||||
),
|
||||
},
|
||||
);
|
||||
diag($output);
|
||||
|
||||
like(
|
||||
$output,
|
||||
|
94
t/pt-online-schema-change/pt-1455.t
Normal file
94
t/pt-online-schema-change/pt-1455.t
Normal file
@@ -0,0 +1,94 @@
|
||||
#!/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 threads;
|
||||
use threads::shared;
|
||||
use Thread::Semaphore;
|
||||
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More;
|
||||
|
||||
use Data::Dumper;
|
||||
use PerconaTest;
|
||||
use Sandbox;
|
||||
use SqlModes;
|
||||
use File::Temp qw/ tempdir /;
|
||||
|
||||
plan tests => 3;
|
||||
|
||||
require "$trunk/bin/pt-online-schema-change";
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
|
||||
my $master_dbh = $sb->get_dbh_for("master");
|
||||
my $master_dsn = $sb->dsn_for("master");
|
||||
|
||||
my $slave1_dbh = $sb->get_dbh_for("slave1");
|
||||
my $slave1_dsn = $sb->dsn_for("slave1");
|
||||
|
||||
# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
|
||||
# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the
|
||||
# tool will die.
|
||||
my @args = (qw(--set-vars innodb_lock_wait_timeout=3));
|
||||
my $output;
|
||||
my $exit_status;
|
||||
|
||||
diag("Setting replication filters on slave 2");
|
||||
$sb->load_file('slave2', "t/pt-online-schema-change/samples/pt-1455_slave.sql");
|
||||
diag("Setting replication filters on slave 1");
|
||||
$sb->load_file('slave1', "t/pt-online-schema-change/samples/pt-1455_slave.sql");
|
||||
diag("Setting replication filters on master");
|
||||
$sb->load_file('master', "t/pt-online-schema-change/samples/pt-1455_master.sql",undef, no_wait => 1);
|
||||
diag("replication filters set");
|
||||
|
||||
my $num_rows = 1000;
|
||||
my $master_port = 12345;
|
||||
|
||||
diag("Loading $num_rows into the table. This might take some time.");
|
||||
diag(`util/mysql_random_data_load_linux_amd64 --host=127.1 --port=$master_port --user=msandbox --password=msandbox employees t1 $num_rows`);
|
||||
diag("$num_rows rows loaded. Starting tests.");
|
||||
|
||||
$master_dbh->do("FLUSH TABLES");
|
||||
|
||||
($output, $exit_status) = full_output(
|
||||
sub { pt_online_schema_change::main(@args, "$master_dsn,D=employees,t=t1",
|
||||
'--execute', '--no-check-replication-filters',
|
||||
'--alter', "engine=innodb",
|
||||
),
|
||||
},
|
||||
stderr => 1,
|
||||
);
|
||||
|
||||
is(
|
||||
$exit_status,
|
||||
0,
|
||||
"PT-1455 Successfully altered. Exit status = 0",
|
||||
);
|
||||
|
||||
like(
|
||||
$output,
|
||||
qr/Successfully altered/s,
|
||||
"PT-1455 Got successfully altered message.",
|
||||
);
|
||||
|
||||
$master_dbh->do("DROP DATABASE IF EXISTS employees");
|
||||
|
||||
diag("Resetting replication filters on slave 2");
|
||||
$sb->load_file('slave2', "t/pt-online-schema-change/samples/pt-1455_reset_slave.sql");
|
||||
diag("Resetting replication filters on slave 1");
|
||||
$sb->load_file('slave1', "t/pt-online-schema-change/samples/pt-1455_reset_slave.sql");
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
$sb->wipe_clean($master_dbh);
|
||||
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||
done_testing;
|
@@ -2,40 +2,12 @@ DROP DATABASE IF EXISTS `test`;
|
||||
CREATE DATABASE IF NOT EXISTS `test`;
|
||||
USE test;
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.7.14-8, for debian-linux-gnu (x86_64)
|
||||
--
|
||||
-- Host: localhost Database: test
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 5.7.14-8-log
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `sbtest`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `o1`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `o1` (
|
||||
`id` int
|
||||
(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id` int (10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1100001 DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
|
||||
|
||||
--
|
||||
-- Dumping data for table `sbtest`
|
||||
--
|
||||
|
||||
LOCK TABLES `o1` WRITE;
|
||||
/*!40000 ALTER TABLE `o1` DISABLE KEYS */;
|
||||
@@ -140,16 +112,4 @@ INSERT INTO `o1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),
|
||||
(980),(981),(982),(983),(984),(985),(986),(987),(988),(989),
|
||||
(990),(991),(992),(993),(994),(995),(996),(997),(998),(999),
|
||||
(10000);
|
||||
/*!40000 ALTER TABLE `o1` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2017-03-14 15:19:26
|
||||
|
8
t/pt-online-schema-change/samples/pt-1455_master.sql
Normal file
8
t/pt-online-schema-change/samples/pt-1455_master.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
DROP DATABASE IF EXISTS employees;
|
||||
CREATE DATABASE employees;
|
||||
-- This table should be replicated
|
||||
CREATE TABLE employees.t1 (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
f2 INT
|
||||
) ENGINE=InnoDB;
|
||||
|
@@ -0,0 +1,6 @@
|
||||
STOP SLAVE;
|
||||
CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB = ();
|
||||
CHANGE REPLICATION FILTER REPLICATE_IGNORE_TABLE = ();
|
||||
CHANGE REPLICATION FILTER REPLICATE_WILD_IGNORE_TABLE = ();
|
||||
RESET SLAVE;
|
||||
START SLAVE;
|
6
t/pt-online-schema-change/samples/pt-1455_slave.sql
Normal file
6
t/pt-online-schema-change/samples/pt-1455_slave.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
STOP SLAVE;
|
||||
CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB = (`ignored_db`);
|
||||
CHANGE REPLICATION FILTER REPLICATE_IGNORE_TABLE = (`idb1`.`it1`, `idb1`.`it2`);
|
||||
CHANGE REPLICATION FILTER REPLICATE_WILD_IGNORE_TABLE = ('employees.eit%');
|
||||
RESET SLAVE;
|
||||
START SLAVE;
|
Reference in New Issue
Block a user