Compare commits
5 Commits
release-v3
...
3.5.1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bf4a095c69 | ||
![]() |
ddd0fcfaf9 | ||
![]() |
ce14fbceba | ||
![]() |
a0930a4e64 | ||
![]() |
4a33e5e52b |
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,5 +0,0 @@
|
||||
- [ ] The contributed code is licensed under GPL v2.0
|
||||
- [ ] Contributor Licence Agreement (CLA) is signed
|
||||
- [ ] util/update-modules has been ran
|
||||
- [ ] Documention updated
|
||||
- [ ] Test suite update
|
40
.github/workflows/toolkit.yml
vendored
@@ -1,40 +0,0 @@
|
||||
name: toolkit
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "3.x" ]
|
||||
pull_request:
|
||||
branches: [ "3.x" ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
- name: Install make
|
||||
run: sudo apt-get update && sudo apt-get -y install make
|
||||
- name: Build
|
||||
run: cd src/go; make linux-amd64; cd ../../
|
||||
|
||||
- name: Build the Docker image
|
||||
run: echo "FROM oraclelinux:9-slim" > Dockerfile; echo "COPY bin/* /usr/bin/" >> Dockerfile; docker build . --file Dockerfile --tag percona-toolkit:${{ github.sha }}
|
||||
- name: Run Trivy vulnerability scanner
|
||||
uses: aquasecurity/trivy-action@0.8.0
|
||||
with:
|
||||
image-ref: 'percona-toolkit:${{ github.sha }}'
|
||||
format: 'table'
|
||||
exit-code: '1'
|
||||
ignore-unfixed: true
|
||||
vuln-type: 'os,library'
|
||||
severity: 'CRITICAL,HIGH'
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v3.1.2
|
||||
with:
|
||||
name: binaries
|
||||
path: bin/*
|
33
Changelog
@@ -1,38 +1,5 @@
|
||||
Changelog for Percona Toolkit
|
||||
|
||||
v3.5.2 release 2023-03-28
|
||||
|
||||
* Improvement PT-188: Use percona.checksums in examples
|
||||
* Improvement PT-2141: Fix tests for pt-archiver
|
||||
* Improvement PT-2149: Fix tests for pt-mext
|
||||
* Improvement PT-2150: Fix tests for pt-mysql-summary
|
||||
* Improvement PT-2152: Fix tests for pt-show-grants
|
||||
* Improvement PT-2155: Fix tests for pt-upgrade
|
||||
* Improvement PT-2156: Fix tests for lib
|
||||
* Improvement PT-2159: Fix tests for pt-duplicate-key-checker
|
||||
* Improvement PT-2160: Fix tests for pt-online-schema-change
|
||||
* Improvement PT-2161: Fix tests for pt-slave-restart
|
||||
* Improvement PT-2164: pt-k8s-debug-collector does not have version flag
|
||||
* Improvement PT-2165: Actual Version, GoVersion, and Build for Go tools
|
||||
* Fixed bug PT-215: Documentation fix
|
||||
* Fixed bug PT-1059: LP #1093972: Tools can't parse index names containing newlines
|
||||
* Fixed bug PT-1389: LP #1637859: [pt-variable-advisor] Docs Typos
|
||||
* Fixed bug PT-1594: Need correction in the Documentation - pt-mysql-summary
|
||||
* Fixed bug PT-1595: percona toolkit docs still reference Maatkit
|
||||
* Fixed bug PT-1642: Update PT docs to reference bug reporting location as Percona JIRA
|
||||
* Fixed bug PT-1683: List of supported distributions in the docs is outdated
|
||||
* Fixed bug PT-1700: pt-table-checksum REPLICATION_STOPPED exit status not documented
|
||||
* Fixed bug PT-1927: pt-k8s-debug-collector requires mysql client
|
||||
* Fixed bug PT-1930: pt-k8s-debug-collector should not attempt collecting PXC information when running against PSMDB
|
||||
* Fixed bug PT-2084: Changes from PT-80 broke previous pt-stalk functionality (Thanks Agustín Gallego)
|
||||
* Fixed bug PT-2102: pt-mysql-summary should support !include* in config files (Thanks Yoann La Cancellera)
|
||||
* Fixed bug PT-2110: Incorrect PTDEBUG output with --ignore-engines option (Thanks Kazuya Yokogawa)
|
||||
* Fixed bug PT-2114: Incorrect casting of BIT columns by pt-archiver
|
||||
* Fixed bug PT-2116: pt-osc --null-to-not-null description is wrong (Thanks Yoann La Cancellera)
|
||||
* Fixed bug PT-2120: pt-stalk with --system-only displaying "MYSQL_ONLY:" message on the screen
|
||||
* Fixed bug PT-2123: pt-archiver gives error "Wide character in print at /usr/bin/pt-archiver line 6815" when using --bulk-insert while using character set alias
|
||||
* Fixed bug PT-2187: CVEs reported in Percona Toolkit version 5.3.1 related to GO.
|
||||
|
||||
v3.5.1 release 2023-01-23
|
||||
|
||||
* Feature PT-2134: Add support for PostgreSQL and MySQL operators in pt-k8s-debug-collector
|
||||
|
@@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
|
||||
|
||||
WriteMakefile(
|
||||
NAME => 'Percona::Toolkit',
|
||||
VERSION => '3.5.2',
|
||||
VERSION => '3.5.1',
|
||||
EXE_FILES => [ <bin/*> ],
|
||||
MAN1PODS => {
|
||||
'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p',
|
||||
|
@@ -1285,7 +1285,7 @@ reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-align>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -1364,6 +1364,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-align 3.5.2
|
||||
pt-align 3.5.1
|
||||
|
||||
=cut
|
||||
|
123
bin/pt-archiver
@@ -45,7 +45,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -1958,7 +1958,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -2139,7 +2139,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
my $key_ddl = $key;
|
||||
@@ -2149,7 +2150,7 @@ sub get_keys {
|
||||
$key =~ s/USING HASH/USING BTREE/;
|
||||
}
|
||||
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
@@ -3220,7 +3221,7 @@ sub generate_cmp_where {
|
||||
push @clause, "($val IS NULL OR $quo $type $val)";
|
||||
}
|
||||
elsif ( $type =~ m/>/ ) {
|
||||
push @clause, "(($val IS NULL AND $quo IS NOT NULL) OR ($quo $cmp $val))";
|
||||
push @clause, "($val IS NULL AND $quo IS NOT NULL) OR ($quo $cmp $val)";
|
||||
}
|
||||
else { # If $type =~ m/</ ) {
|
||||
push @clauses, "(($val IS NOT NULL AND $quo IS NULL) OR ($quo $cmp $val))";
|
||||
@@ -3673,7 +3674,6 @@ sub get_slaves {
|
||||
dsn => $dsn,
|
||||
slave_user => $o->got('slave-user') ? $o->get('slave-user') : '',
|
||||
slave_password => $o->got('slave-password') ? $o->get('slave-password') : '',
|
||||
slaves => $args{slaves},
|
||||
callback => sub {
|
||||
my ( $dsn, $dbh, $level, $parent ) = @_;
|
||||
return unless $level;
|
||||
@@ -3750,29 +3750,16 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d("Slave password set");
|
||||
}
|
||||
|
||||
my $dbh = $args->{dbh};
|
||||
|
||||
DBH: {
|
||||
if ( !defined $dbh ) {
|
||||
foreach my $known_slave ( @{$args->{slaves}} ) {
|
||||
if ($known_slave->{dsn}->{h} eq $slave_dsn->{h} and
|
||||
$known_slave->{dsn}->{P} eq $slave_dsn->{P} ) {
|
||||
$dbh = $known_slave->{dbh};
|
||||
last DBH;
|
||||
}
|
||||
}
|
||||
|
||||
eval {
|
||||
$dbh = $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), ": ", $EVAL_ERROR, "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
|
||||
my $sql = 'SELECT @@SERVER_ID';
|
||||
@@ -4600,7 +4587,7 @@ sub connect {
|
||||
my $dp = $self->{DSNParser};
|
||||
|
||||
my $dbh = $self->{dbh};
|
||||
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
|
||||
if ( !$dbh || !$dbh->ping() ) {
|
||||
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
|
||||
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
|
||||
$self->{asked_for_pass} = 1;
|
||||
@@ -4629,20 +4616,19 @@ sub connect {
|
||||
sub set_dbh {
|
||||
my ($self, $dbh) = @_;
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname, $connection_id) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} && $self->{dbh_set} == $connection_id) {
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} ) {
|
||||
PTDEBUG && _d($dbh, 'Already set dbh');
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
if ( $hostname ) {
|
||||
$self->{hostname} = $hostname;
|
||||
}
|
||||
@@ -4657,7 +4643,7 @@ sub set_dbh {
|
||||
}
|
||||
|
||||
$self->{dbh} = $dbh;
|
||||
$self->{dbh_set} = $connection_id;
|
||||
$self->{dbh_set} = 1;
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
@@ -4783,17 +4769,6 @@ sub DESTROY {
|
||||
return;
|
||||
}
|
||||
|
||||
sub _ping() {
|
||||
my ( $self, $dbh ) = @_;
|
||||
if (!$dbh->ping()) {
|
||||
return 0;
|
||||
}
|
||||
my $sql = 'SELECT CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($connection_id) = $dbh->selectrow_array($sql);
|
||||
return $self->{dbh_set} == $connection_id;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
@@ -6122,9 +6097,6 @@ $Data::Dumper::Quotekeys = 0;
|
||||
use Percona::Toolkit;
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
# We need SQL types in order to properly handle BIT columns in WHERE clause
|
||||
use DBI qw(:sql_types);
|
||||
|
||||
# Global variables; as few as possible.
|
||||
my $oktorun = 1;
|
||||
my $txn_cnt = 0;
|
||||
@@ -6628,9 +6600,7 @@ sub main {
|
||||
. ($o->get('replace') ? ' REPLACE' : '')
|
||||
. ($o->get('ignore') ? ' IGNORE' : '')
|
||||
. " INTO TABLE $dst->{db_tbl}"
|
||||
. ($got_charset ? "CHARACTER SET $got_charset" :
|
||||
( $src->{info}->{charset} && $src->{info}->{charset} =~ /utf/ ?
|
||||
"CHARACTER SET utf8mb4" : "" ))
|
||||
. ($got_charset ? "CHARACTER SET $got_charset" : "")
|
||||
. "("
|
||||
. join(",", map { $q->quote($_) } @{$ins_stmt->{cols}} )
|
||||
. ")";
|
||||
@@ -6807,10 +6777,6 @@ sub main {
|
||||
require File::Temp;
|
||||
$bulkins_file = File::Temp->new( SUFFIX => 'pt-archiver' )
|
||||
or die "Cannot open temp file: $OS_ERROR\n";
|
||||
if ( !$charset && $src->{info}->{charset}
|
||||
&& $src->{info}->{charset} =~ /utf/ ) {
|
||||
binmode($bulkins_file, ':utf8')
|
||||
}
|
||||
binmode($bulkins_file, $charset)
|
||||
or die "Cannot set $charset as an encoding for the bulk-insert "
|
||||
. "file: $OS_ERROR";
|
||||
@@ -6894,15 +6860,7 @@ sub main {
|
||||
}
|
||||
if ( !$o->get('no-delete') ) {
|
||||
my $success = do_with_retries($o, 'deleting', sub {
|
||||
# We have to make exception for BIT column, see PT-2114
|
||||
for my $i (0 .. $#del_slice) {
|
||||
if ($src->{info}->{type_for}->{$del_stmt->{cols}[$del_slice[$i]]} eq 'bit') {
|
||||
$del_row->bind_param($i + 1, oct('0b' . unpack('B*', @{$row}[$del_slice[$i]])), SQL_INTEGER);
|
||||
} else {
|
||||
$del_row->bind_param($i + 1, @{$row}[$del_slice[$i]]);
|
||||
}
|
||||
}
|
||||
$del_row->execute();
|
||||
$del_row->execute(@{$row}[@del_slice]);
|
||||
PTDEBUG && _d('Deleted', $del_row->rows, 'rows');
|
||||
$statistics{DELETE} += $del_row->rows;
|
||||
});
|
||||
@@ -7005,17 +6963,10 @@ sub main {
|
||||
}
|
||||
if ( !$o->get('no-delete') ) {
|
||||
my $success = do_with_retries($o, 'bulk_deleting', sub {
|
||||
# We have to make exception for BIT column, see PT-2114
|
||||
for my $i (0 .. $#bulkdel_slice) {
|
||||
if ($src->{info}->{type_for}->{$del_stmt->{cols}[$bulkdel_slice[$i]]} eq 'bit') {
|
||||
$del_row->bind_param($i + 1, oct('0b' . unpack('B*', @{$first_row}[$bulkdel_slice[$i]])), SQL_INTEGER);
|
||||
$del_row->bind_param($i + $#bulkdel_slice + 2, oct('0b' . unpack('B*', @{$lastrow}[$bulkdel_slice[$i]])), SQL_INTEGER);
|
||||
} else {
|
||||
$del_row->bind_param($i + 1, @{$first_row}[$bulkdel_slice[$i]]);
|
||||
$del_row->bind_param($i + $#bulkdel_slice + 2, @{$lastrow}[$bulkdel_slice[$i]]);
|
||||
}
|
||||
}
|
||||
$del_row->execute();
|
||||
$del_row->execute(
|
||||
@{$first_row}[@bulkdel_slice],
|
||||
@{$lastrow}[@bulkdel_slice],
|
||||
);
|
||||
PTDEBUG && _d('Bulk deleted', $del_row->rows, 'rows');
|
||||
$statistics{DELETE} += $del_row->rows;
|
||||
});
|
||||
@@ -7425,7 +7376,7 @@ server. Before using this tool, please:
|
||||
=head1 DESCRIPTION
|
||||
|
||||
pt-archiver is the tool I use to archive tables as described in
|
||||
L<https://web.archive.org/web/20071014031743/http://www.xaprb.com/blog/2006/05/02/how-to-write-efficient-archiving-and-purging-jobs-in-sql>. The goal is a low-impact, forward-only
|
||||
L<http://tinyurl.com/mysql-archiving>. The goal is a low-impact, forward-only
|
||||
job to nibble old data out of the table without impacting OLTP queries much.
|
||||
You can insert the data into another table, which need not be on the same
|
||||
server. You can also write it to a file in a format suitable for LOAD DATA
|
||||
@@ -7908,7 +7859,7 @@ Pause archiving if the slave given by L<"--check-slave-lag"> lags.
|
||||
|
||||
This option causes pt-archiver to look at the slave every time it's about
|
||||
to fetch another row. If the slave's lag is greater than the option's value,
|
||||
or if the slave isn't running (so its lag is NULL), pt-archiver sleeps
|
||||
or if the slave isn't running (so its lag is NULL), pt-table-checksum sleeps
|
||||
for L<"--check-interval"> seconds and then looks at the lag again. It repeats
|
||||
until the slave is caught up, then proceeds to fetch and archive the row.
|
||||
|
||||
@@ -8700,7 +8651,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-archiver>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -8778,6 +8729,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-archiver 3.5.2
|
||||
pt-archiver 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -43,7 +43,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -2368,7 +2368,7 @@ sub connect {
|
||||
my $dp = $self->{DSNParser};
|
||||
|
||||
my $dbh = $self->{dbh};
|
||||
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
|
||||
if ( !$dbh || !$dbh->ping() ) {
|
||||
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
|
||||
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
|
||||
$self->{asked_for_pass} = 1;
|
||||
@@ -2397,20 +2397,19 @@ sub connect {
|
||||
sub set_dbh {
|
||||
my ($self, $dbh) = @_;
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname, $connection_id) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} && $self->{dbh_set} == $connection_id) {
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} ) {
|
||||
PTDEBUG && _d($dbh, 'Already set dbh');
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
if ( $hostname ) {
|
||||
$self->{hostname} = $hostname;
|
||||
}
|
||||
@@ -2425,7 +2424,7 @@ sub set_dbh {
|
||||
}
|
||||
|
||||
$self->{dbh} = $dbh;
|
||||
$self->{dbh_set} = $connection_id;
|
||||
$self->{dbh_set} = 1;
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
@@ -2551,17 +2550,6 @@ sub DESTROY {
|
||||
return;
|
||||
}
|
||||
|
||||
sub _ping() {
|
||||
my ( $self, $dbh ) = @_;
|
||||
if (!$dbh->ping()) {
|
||||
return 0;
|
||||
}
|
||||
my $sql = 'SELECT CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($connection_id) = $dbh->selectrow_array($sql);
|
||||
return $self->{dbh_set} == $connection_id;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
@@ -5938,7 +5926,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-config-diff>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -6011,6 +5999,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-config-diff 3.5.2
|
||||
pt-config-diff 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -42,7 +42,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -2712,7 +2712,7 @@ sub connect {
|
||||
my $dp = $self->{DSNParser};
|
||||
|
||||
my $dbh = $self->{dbh};
|
||||
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
|
||||
if ( !$dbh || !$dbh->ping() ) {
|
||||
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
|
||||
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
|
||||
$self->{asked_for_pass} = 1;
|
||||
@@ -2741,20 +2741,19 @@ sub connect {
|
||||
sub set_dbh {
|
||||
my ($self, $dbh) = @_;
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname, $connection_id) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} && $self->{dbh_set} == $connection_id) {
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} ) {
|
||||
PTDEBUG && _d($dbh, 'Already set dbh');
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
if ( $hostname ) {
|
||||
$self->{hostname} = $hostname;
|
||||
}
|
||||
@@ -2769,7 +2768,7 @@ sub set_dbh {
|
||||
}
|
||||
|
||||
$self->{dbh} = $dbh;
|
||||
$self->{dbh_set} = $connection_id;
|
||||
$self->{dbh_set} = 1;
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
@@ -2895,17 +2894,6 @@ sub DESTROY {
|
||||
return;
|
||||
}
|
||||
|
||||
sub _ping() {
|
||||
my ( $self, $dbh ) = @_;
|
||||
if (!$dbh->ping()) {
|
||||
return 0;
|
||||
}
|
||||
my $sql = 'SELECT CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($connection_id) = $dbh->selectrow_array($sql);
|
||||
return $self->{dbh_set} == $connection_id;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
@@ -5714,7 +5702,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-deadlock-logger>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -5788,6 +5776,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-deadlock-logger 3.5.2
|
||||
pt-deadlock-logger 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -38,7 +38,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -5618,7 +5618,7 @@ reading from files.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-diskstats>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -5692,6 +5692,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-diskstats 3.5.2
|
||||
pt-diskstats 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -39,7 +39,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -345,7 +345,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -526,7 +526,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
my $key_ddl = $key;
|
||||
@@ -536,7 +537,7 @@ sub get_keys {
|
||||
$key =~ s/USING HASH/USING BTREE/;
|
||||
}
|
||||
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
@@ -5712,7 +5713,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-duplicate-key-checker>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -5786,6 +5787,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-duplicate-key-checker 3.5.2
|
||||
pt-duplicate-key-checker 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -1634,7 +1634,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-fifo-split>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -1708,6 +1708,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-fifo-split 3.5.2
|
||||
pt-fifo-split 3.5.1
|
||||
|
||||
=cut
|
||||
|
13
bin/pt-find
@@ -35,7 +35,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -1897,7 +1897,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -2078,7 +2078,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
my $key_ddl = $key;
|
||||
@@ -2088,7 +2089,7 @@ sub get_keys {
|
||||
$key =~ s/USING HASH/USING BTREE/;
|
||||
}
|
||||
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
@@ -5127,7 +5128,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-find>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -5201,6 +5202,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-find 3.5.2
|
||||
pt-find 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -2198,7 +2198,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-fingerprint>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -2271,6 +2271,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-fingerprint 3.5.2
|
||||
pt-fingerprint 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -37,7 +37,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -1866,7 +1866,7 @@ sub connect {
|
||||
my $dp = $self->{DSNParser};
|
||||
|
||||
my $dbh = $self->{dbh};
|
||||
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
|
||||
if ( !$dbh || !$dbh->ping() ) {
|
||||
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
|
||||
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
|
||||
$self->{asked_for_pass} = 1;
|
||||
@@ -1895,20 +1895,19 @@ sub connect {
|
||||
sub set_dbh {
|
||||
my ($self, $dbh) = @_;
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname, $connection_id) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} && $self->{dbh_set} == $connection_id) {
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} ) {
|
||||
PTDEBUG && _d($dbh, 'Already set dbh');
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
if ( $hostname ) {
|
||||
$self->{hostname} = $hostname;
|
||||
}
|
||||
@@ -1923,7 +1922,7 @@ sub set_dbh {
|
||||
}
|
||||
|
||||
$self->{dbh} = $dbh;
|
||||
$self->{dbh_set} = $connection_id;
|
||||
$self->{dbh_set} = 1;
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
@@ -2049,17 +2048,6 @@ sub DESTROY {
|
||||
return;
|
||||
}
|
||||
|
||||
sub _ping() {
|
||||
my ( $self, $dbh ) = @_;
|
||||
if (!$dbh->ping()) {
|
||||
return 0;
|
||||
}
|
||||
my $sql = 'SELECT CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($connection_id) = $dbh->selectrow_array($sql);
|
||||
return $self->{dbh_set} == $connection_id;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
@@ -4702,7 +4690,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-fk-error-logger>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -4775,6 +4763,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-fk-error-logger 3.5.2
|
||||
pt-fk-error-logger 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -44,7 +44,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -170,7 +170,6 @@ sub get_slaves {
|
||||
dsn => $dsn,
|
||||
slave_user => $o->got('slave-user') ? $o->get('slave-user') : '',
|
||||
slave_password => $o->got('slave-password') ? $o->get('slave-password') : '',
|
||||
slaves => $args{slaves},
|
||||
callback => sub {
|
||||
my ( $dsn, $dbh, $level, $parent ) = @_;
|
||||
return unless $level;
|
||||
@@ -247,29 +246,16 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d("Slave password set");
|
||||
}
|
||||
|
||||
my $dbh = $args->{dbh};
|
||||
|
||||
DBH: {
|
||||
if ( !defined $dbh ) {
|
||||
foreach my $known_slave ( @{$args->{slaves}} ) {
|
||||
if ($known_slave->{dsn}->{h} eq $slave_dsn->{h} and
|
||||
$known_slave->{dsn}->{P} eq $slave_dsn->{P} ) {
|
||||
$dbh = $known_slave->{dbh};
|
||||
last DBH;
|
||||
}
|
||||
}
|
||||
|
||||
eval {
|
||||
$dbh = $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), ": ", $EVAL_ERROR, "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
|
||||
my $sql = 'SELECT @@SERVER_ID';
|
||||
@@ -3638,7 +3624,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -3819,7 +3805,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
my $key_ddl = $key;
|
||||
@@ -3829,7 +3816,7 @@ sub get_keys {
|
||||
$key =~ s/USING HASH/USING BTREE/;
|
||||
}
|
||||
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
@@ -7397,7 +7384,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-heartbeat>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -7473,6 +7460,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-heartbeat 3.5.2
|
||||
pt-heartbeat 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -45,7 +45,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -3149,7 +3149,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -3330,7 +3330,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
my $key_ddl = $key;
|
||||
@@ -3340,7 +3341,7 @@ sub get_keys {
|
||||
$key =~ s/USING HASH/USING BTREE/;
|
||||
}
|
||||
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
@@ -7657,7 +7658,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-index-usage>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -7731,6 +7732,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-index-usage 3.5.2
|
||||
pt-index-usage 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -1053,7 +1053,7 @@ This tool requires the Bourne shell (F</bin/sh>).
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-ioprofile>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -1132,7 +1132,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-ioprofile 3.5.2
|
||||
pt-ioprofile 3.5.1
|
||||
|
||||
=cut
|
||||
|
||||
|
81
bin/pt-kill
@@ -47,7 +47,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -3012,7 +3012,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -3193,7 +3193,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
my $key_ddl = $key;
|
||||
@@ -3203,7 +3204,7 @@ sub get_keys {
|
||||
$key =~ s/USING HASH/USING BTREE/;
|
||||
}
|
||||
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
@@ -3950,7 +3951,6 @@ sub get_slaves {
|
||||
dsn => $dsn,
|
||||
slave_user => $o->got('slave-user') ? $o->get('slave-user') : '',
|
||||
slave_password => $o->got('slave-password') ? $o->get('slave-password') : '',
|
||||
slaves => $args{slaves},
|
||||
callback => sub {
|
||||
my ( $dsn, $dbh, $level, $parent ) = @_;
|
||||
return unless $level;
|
||||
@@ -4027,29 +4027,16 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d("Slave password set");
|
||||
}
|
||||
|
||||
my $dbh = $args->{dbh};
|
||||
|
||||
DBH: {
|
||||
if ( !defined $dbh ) {
|
||||
foreach my $known_slave ( @{$args->{slaves}} ) {
|
||||
if ($known_slave->{dsn}->{h} eq $slave_dsn->{h} and
|
||||
$known_slave->{dsn}->{P} eq $slave_dsn->{P} ) {
|
||||
$dbh = $known_slave->{dbh};
|
||||
last DBH;
|
||||
}
|
||||
}
|
||||
|
||||
eval {
|
||||
$dbh = $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), ": ", $EVAL_ERROR, "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
|
||||
my $sql = 'SELECT @@SERVER_ID';
|
||||
@@ -5415,7 +5402,7 @@ sub connect {
|
||||
my $dp = $self->{DSNParser};
|
||||
|
||||
my $dbh = $self->{dbh};
|
||||
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
|
||||
if ( !$dbh || !$dbh->ping() ) {
|
||||
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
|
||||
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
|
||||
$self->{asked_for_pass} = 1;
|
||||
@@ -5444,20 +5431,19 @@ sub connect {
|
||||
sub set_dbh {
|
||||
my ($self, $dbh) = @_;
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname, $connection_id) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} && $self->{dbh_set} == $connection_id) {
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} ) {
|
||||
PTDEBUG && _d($dbh, 'Already set dbh');
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
if ( $hostname ) {
|
||||
$self->{hostname} = $hostname;
|
||||
}
|
||||
@@ -5472,7 +5458,7 @@ sub set_dbh {
|
||||
}
|
||||
|
||||
$self->{dbh} = $dbh;
|
||||
$self->{dbh_set} = $connection_id;
|
||||
$self->{dbh_set} = 1;
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
@@ -5598,17 +5584,6 @@ sub DESTROY {
|
||||
return;
|
||||
}
|
||||
|
||||
sub _ping() {
|
||||
my ( $self, $dbh ) = @_;
|
||||
if (!$dbh->ping()) {
|
||||
return 0;
|
||||
}
|
||||
my $sql = 'SELECT CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($connection_id) = $dbh->selectrow_array($sql);
|
||||
return $self->{dbh_set} == $connection_id;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
@@ -8685,7 +8660,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-kill>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -8759,6 +8734,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-kill 3.5.2
|
||||
pt-kill 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -729,7 +729,7 @@ This tool requires the Bourne shell (F</bin/sh>) and the seq program.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-mext>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -808,7 +808,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-mext 3.5.2
|
||||
pt-mext 3.5.1
|
||||
|
||||
=cut
|
||||
|
||||
|
@@ -878,17 +878,11 @@ find_my_cnf_file() {
|
||||
if [ "$port" ]; then
|
||||
cnf_file="$(grep --max-count 1 "/mysqld.*--port=$port" "$file" \
|
||||
| awk 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }')"
|
||||
|
||||
if [ -n "$cnf_file" ]; then
|
||||
echo "$cnf_file"
|
||||
return
|
||||
fi
|
||||
else
|
||||
cnf_file="$(grep --max-count 1 '/mysqld' "$file" \
|
||||
| awk 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }')"
|
||||
fi
|
||||
|
||||
cnf_file="$(grep --max-count 1 '/mysqld' "$file" \
|
||||
| awk 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }')"
|
||||
|
||||
|
||||
if [ -z "$cnf_file" ]; then
|
||||
if [ -e "/etc/my.cnf" ]; then
|
||||
cnf_file="/etc/my.cnf"
|
||||
@@ -1191,12 +1185,7 @@ collect_encrypted_tables() {
|
||||
}
|
||||
|
||||
collect_encrypted_tablespaces() {
|
||||
local version="$1"
|
||||
if [ "$version" '<' "8.0" ]; then
|
||||
$CMD_MYSQL $EXT_ARGV --table -ss -e "SELECT SPACE, NAME, SPACE_TYPE from INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES where FLAG&8192 = 8192;"
|
||||
else
|
||||
$CMD_MYSQL $EXT_ARGV --table -ss -e "SELECT SPACE, NAME, SPACE_TYPE from INFORMATION_SCHEMA.INNODB_TABLESPACES where FLAG&8192 = 8192;"
|
||||
fi
|
||||
$CMD_MYSQL $EXT_ARGV --table -ss -e "SELECT SPACE, NAME, SPACE_TYPE from INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES where FLAG&8192 = 8192;"
|
||||
}
|
||||
|
||||
|
||||
@@ -1425,25 +1414,6 @@ pretty_print_cnf_file () {
|
||||
}
|
||||
}' "$file"
|
||||
|
||||
while read line; do
|
||||
echo $line | grep -q '!include'
|
||||
if [ $? -eq 0 ]; then
|
||||
clause=$(echo -n $line | tr -s ' ' | cut -d ' ' -f 1)
|
||||
include=$(echo -n $line | tr -s ' ' | cut -d ' ' -f 2)
|
||||
|
||||
if [ "x$include" != "x" -a -d "${include}" -a "x$clause" = 'x!includedir' ]; then
|
||||
for subfile in $(find -L "$include" -type f -maxdepth 1 -name *.cnf ); do
|
||||
echo "# $subfile"
|
||||
pretty_print_cnf_file $subfile
|
||||
done
|
||||
elif [ -f "$include" -a "$clause" = '!include' ]; then
|
||||
echo "# $include"
|
||||
pretty_print_cnf_file $include
|
||||
fi
|
||||
fi
|
||||
|
||||
done < "$file"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2551,9 +2521,8 @@ report_mysql_summary () {
|
||||
local encrypted_tables=""
|
||||
local encrypted_tablespaces=""
|
||||
if [ "${OPT_LIST_ENCRYPTED_TABLES}" = 'yes' ]; then
|
||||
local mysql_version="$(get_var version "$dir/mysql-variables")"
|
||||
encrypted_tables="$(collect_encrypted_tables)"
|
||||
encrypted_tablespaces="$(collect_encrypted_tablespaces ${mysql_version})"
|
||||
encrypted_tablespaces="$(collect_encrypted_tablespaces)"
|
||||
fi
|
||||
|
||||
format_keyring_plugins "$keyring_plugins" "$encrypted_tables"
|
||||
@@ -2884,7 +2853,7 @@ The third column is the value from the first snapshot, divided by Uptime and
|
||||
then fuzzy-rounded, so it represents approximately how quickly the counter is
|
||||
growing per-second over the uptime of the server.
|
||||
|
||||
The fourth column is the incremental difference from the first and second
|
||||
The third column is the incremental difference from the first and second
|
||||
snapshot, divided by the difference in uptime and then fuzzy-rounded. Therefore,
|
||||
it shows how quickly the counter is growing per second at the time the report
|
||||
was generated.
|
||||
@@ -3246,7 +3215,7 @@ On BSD systems, it may require a mounted procfs.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-mysql-summary>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -3325,7 +3294,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-mysql-summary 3.5.2
|
||||
pt-mysql-summary 3.5.1
|
||||
|
||||
=cut
|
||||
|
||||
|
@@ -56,7 +56,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -3102,7 +3102,7 @@ sub generate_cmp_where {
|
||||
push @clause, "($val IS NULL OR $quo $type $val)";
|
||||
}
|
||||
elsif ( $type =~ m/>/ ) {
|
||||
push @clause, "(($val IS NULL AND $quo IS NOT NULL) OR ($quo $cmp $val))";
|
||||
push @clause, "($val IS NULL AND $quo IS NOT NULL) OR ($quo $cmp $val)";
|
||||
}
|
||||
else { # If $type =~ m/</ ) {
|
||||
push @clauses, "(($val IS NOT NULL AND $quo IS NULL) OR ($quo $cmp $val))";
|
||||
@@ -3328,7 +3328,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -3509,7 +3509,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
my $key_ddl = $key;
|
||||
@@ -3519,7 +3520,7 @@ sub get_keys {
|
||||
$key =~ s/USING HASH/USING BTREE/;
|
||||
}
|
||||
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
@@ -3954,7 +3955,7 @@ sub connect {
|
||||
my $dp = $self->{DSNParser};
|
||||
|
||||
my $dbh = $self->{dbh};
|
||||
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
|
||||
if ( !$dbh || !$dbh->ping() ) {
|
||||
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
|
||||
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
|
||||
$self->{asked_for_pass} = 1;
|
||||
@@ -3983,20 +3984,19 @@ sub connect {
|
||||
sub set_dbh {
|
||||
my ($self, $dbh) = @_;
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname, $connection_id) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} && $self->{dbh_set} == $connection_id) {
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} ) {
|
||||
PTDEBUG && _d($dbh, 'Already set dbh');
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
if ( $hostname ) {
|
||||
$self->{hostname} = $hostname;
|
||||
}
|
||||
@@ -4011,7 +4011,7 @@ sub set_dbh {
|
||||
}
|
||||
|
||||
$self->{dbh} = $dbh;
|
||||
$self->{dbh_set} = $connection_id;
|
||||
$self->{dbh_set} = 1;
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
@@ -4137,17 +4137,6 @@ sub DESTROY {
|
||||
return;
|
||||
}
|
||||
|
||||
sub _ping() {
|
||||
my ( $self, $dbh ) = @_;
|
||||
if (!$dbh->ping()) {
|
||||
return 0;
|
||||
}
|
||||
my $sql = 'SELECT CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($connection_id) = $dbh->selectrow_array($sql);
|
||||
return $self->{dbh_set} == $connection_id;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
@@ -4236,7 +4225,6 @@ sub get_slaves {
|
||||
dsn => $dsn,
|
||||
slave_user => $o->got('slave-user') ? $o->get('slave-user') : '',
|
||||
slave_password => $o->got('slave-password') ? $o->get('slave-password') : '',
|
||||
slaves => $args{slaves},
|
||||
callback => sub {
|
||||
my ( $dsn, $dbh, $level, $parent ) = @_;
|
||||
return unless $level;
|
||||
@@ -4313,29 +4301,16 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d("Slave password set");
|
||||
}
|
||||
|
||||
my $dbh = $args->{dbh};
|
||||
|
||||
DBH: {
|
||||
if ( !defined $dbh ) {
|
||||
foreach my $known_slave ( @{$args->{slaves}} ) {
|
||||
if ($known_slave->{dsn}->{h} eq $slave_dsn->{h} and
|
||||
$known_slave->{dsn}->{P} eq $slave_dsn->{P} ) {
|
||||
$dbh = $known_slave->{dbh};
|
||||
last DBH;
|
||||
}
|
||||
}
|
||||
|
||||
eval {
|
||||
$dbh = $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), ": ", $EVAL_ERROR, "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
|
||||
my $sql = 'SELECT @@SERVER_ID';
|
||||
@@ -8850,7 +8825,6 @@ sub main {
|
||||
my $slaves =$ms->get_slaves(
|
||||
dbh => $cxn->dbh(),
|
||||
dsn => $cxn->dsn(),
|
||||
slaves => $slaves,
|
||||
make_cxn => sub {
|
||||
return $make_cxn->(
|
||||
@_,
|
||||
@@ -12785,9 +12759,9 @@ exist.
|
||||
=item --null-to-not-null
|
||||
|
||||
Allows MODIFYing a column that allows NULL values to one that doesn't allow
|
||||
them. The existing rows which contain NULL values will be converted to the default value
|
||||
based on datatype, e.g. 0 for number datatypes, '' for string datatypes.
|
||||
New rows will use the user defined default value if specified for the column.
|
||||
them. The rows which contain NULL values will be converted to the defined
|
||||
default value. If no explicit DEFAULT value is given MySQL will assign a default
|
||||
value based on datatype, e.g. 0 for number datatypes, '' for string datatypes.
|
||||
|
||||
=item --only-same-schema-fks
|
||||
|
||||
@@ -13411,9 +13385,9 @@ REPLICATION SLAVE and REPLICATION CLIENT privileges.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-online-schema-change>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Please report bugs at L<https://bugs.launchpad.net/percona-toolkit>.
|
||||
Include the following information in your bug report:
|
||||
|
||||
=over
|
||||
@@ -13493,6 +13467,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-online-schema-change 3.5.2
|
||||
pt-online-schema-change 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -822,7 +822,7 @@ on the command line.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-pmp>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -901,7 +901,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-pmp 3.5.2
|
||||
pt-pmp 3.5.1
|
||||
|
||||
=cut
|
||||
|
||||
|
@@ -64,7 +64,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -8894,7 +8894,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -9075,7 +9075,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
my $key_ddl = $key;
|
||||
@@ -9085,7 +9086,7 @@ sub get_keys {
|
||||
$key =~ s/USING HASH/USING BTREE/;
|
||||
}
|
||||
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
@@ -10538,7 +10539,6 @@ sub get_slaves {
|
||||
dsn => $dsn,
|
||||
slave_user => $o->got('slave-user') ? $o->get('slave-user') : '',
|
||||
slave_password => $o->got('slave-password') ? $o->get('slave-password') : '',
|
||||
slaves => $args{slaves},
|
||||
callback => sub {
|
||||
my ( $dsn, $dbh, $level, $parent ) = @_;
|
||||
return unless $level;
|
||||
@@ -10615,29 +10615,16 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d("Slave password set");
|
||||
}
|
||||
|
||||
my $dbh = $args->{dbh};
|
||||
|
||||
DBH: {
|
||||
if ( !defined $dbh ) {
|
||||
foreach my $known_slave ( @{$args->{slaves}} ) {
|
||||
if ($known_slave->{dsn}->{h} eq $slave_dsn->{h} and
|
||||
$known_slave->{dsn}->{P} eq $slave_dsn->{P} ) {
|
||||
$dbh = $known_slave->{dbh};
|
||||
last DBH;
|
||||
}
|
||||
}
|
||||
|
||||
eval {
|
||||
$dbh = $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), ": ", $EVAL_ERROR, "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
|
||||
my $sql = 'SELECT @@SERVER_ID';
|
||||
@@ -16788,7 +16775,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-query-digest>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -16990,6 +16977,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-query-digest 3.5.2
|
||||
pt-query-digest 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -2599,9 +2599,9 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-show-grants>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Please report bugs at L<https://bugs.launchpad.net/percona-toolkit>.
|
||||
Include the following information in your bug report:
|
||||
|
||||
=over
|
||||
@@ -2673,6 +2673,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-show-grants 3.5.2
|
||||
pt-show-grants 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -1170,7 +1170,7 @@ they will be fetched from the Internet if curl is available.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-sift>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -1249,7 +1249,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-sift 3.5.2
|
||||
pt-sift 3.5.1
|
||||
|
||||
=cut
|
||||
|
||||
|
@@ -40,7 +40,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -4987,7 +4987,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-slave-delay>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -5061,6 +5061,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-slave-delay 3.5.2
|
||||
pt-slave-delay 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -2306,7 +2306,6 @@ sub get_slaves {
|
||||
dsn => $dsn,
|
||||
slave_user => $o->got('slave-user') ? $o->get('slave-user') : '',
|
||||
slave_password => $o->got('slave-password') ? $o->get('slave-password') : '',
|
||||
slaves => $args{slaves},
|
||||
callback => sub {
|
||||
my ( $dsn, $dbh, $level, $parent ) = @_;
|
||||
return unless $level;
|
||||
@@ -2383,29 +2382,16 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d("Slave password set");
|
||||
}
|
||||
|
||||
my $dbh = $args->{dbh};
|
||||
|
||||
DBH: {
|
||||
if ( !defined $dbh ) {
|
||||
foreach my $known_slave ( @{$args->{slaves}} ) {
|
||||
if ($known_slave->{dsn}->{h} eq $slave_dsn->{h} and
|
||||
$known_slave->{dsn}->{P} eq $slave_dsn->{P} ) {
|
||||
$dbh = $known_slave->{dbh};
|
||||
last DBH;
|
||||
}
|
||||
}
|
||||
|
||||
eval {
|
||||
$dbh = $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), ": ", $EVAL_ERROR, "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
|
||||
my $sql = 'SELECT @@SERVER_ID';
|
||||
@@ -4521,7 +4507,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-slave-find>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -4595,6 +4581,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-slave-find 3.5.2
|
||||
pt-slave-find 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -41,7 +41,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -2717,7 +2717,6 @@ sub get_slaves {
|
||||
dsn => $dsn,
|
||||
slave_user => $o->got('slave-user') ? $o->get('slave-user') : '',
|
||||
slave_password => $o->got('slave-password') ? $o->get('slave-password') : '',
|
||||
slaves => $args{slaves},
|
||||
callback => sub {
|
||||
my ( $dsn, $dbh, $level, $parent ) = @_;
|
||||
return unless $level;
|
||||
@@ -2794,29 +2793,16 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d("Slave password set");
|
||||
}
|
||||
|
||||
my $dbh = $args->{dbh};
|
||||
|
||||
DBH: {
|
||||
if ( !defined $dbh ) {
|
||||
foreach my $known_slave ( @{$args->{slaves}} ) {
|
||||
if ($known_slave->{dsn}->{h} eq $slave_dsn->{h} and
|
||||
$known_slave->{dsn}->{P} eq $slave_dsn->{P} ) {
|
||||
$dbh = $known_slave->{dbh};
|
||||
last DBH;
|
||||
}
|
||||
}
|
||||
|
||||
eval {
|
||||
$dbh = $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), ": ", $EVAL_ERROR, "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
|
||||
my $sql = 'SELECT @@SERVER_ID';
|
||||
@@ -6172,7 +6158,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-slave-restart>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -6246,6 +6232,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-slave-restart 3.5.2
|
||||
pt-slave-restart 3.5.1
|
||||
|
||||
=cut
|
||||
|
28
bin/pt-stalk
@@ -1276,16 +1276,11 @@ slave_status() {
|
||||
local outfile=$1
|
||||
local mysql_version=$2
|
||||
|
||||
if [ "${mysql_version}" '<' "8.1" ]; then
|
||||
local sql="SHOW SLAVE STATUS\G"
|
||||
if [ "${mysql_version}" '<' "5.7" ]; then
|
||||
local sql="SHOW SLAVE STATUS\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
else
|
||||
local sql="SHOW REPLICA STATUS\G"
|
||||
fi
|
||||
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
if [ "${mysql_version}" '>' "5.6" ]; then
|
||||
local sql="SELECT * FROM performance_schema.replication_connection_configuration JOIN performance_schema.replication_applier_configuration USING(channel_name)\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
@@ -1570,11 +1565,8 @@ stalk() {
|
||||
# Start collecting, maybe.
|
||||
# ##################################################################
|
||||
log "Collect $ITER triggered"
|
||||
if [ "$OPT_MYSQL_ONLY" ]; then
|
||||
log "MYSQL_ONLY: $OPT_MYSQL_ONLY"
|
||||
elif [ "$OPT_SYSTEM_ONLY" ]; then
|
||||
log "SYSTEM_ONLY: $OPT_SYSTEM_ONLY"
|
||||
fi
|
||||
log "MYSQL_ONLY: $OPT_MYSQL_ONLY"
|
||||
log "SYSTEM_ONLY: $OPT_SYSTEM_ONLY"
|
||||
|
||||
# Send email to whomever that collect has been triggered.
|
||||
if [ "$OPT_NOTIFY_BY_EMAIL" ]; then
|
||||
@@ -1675,10 +1667,6 @@ stalk() {
|
||||
main() {
|
||||
trap sigtrap SIGHUP SIGINT SIGTERM
|
||||
|
||||
if [ "$OPT_SYSTEM_ONLY" ] && [ "$OPT_MYSQL_ONLY" ]; then
|
||||
log 'Both options --system-only and --mysql-only specified, collecting only disk-space, hostname, output, and trigger metrics';
|
||||
fi
|
||||
|
||||
# Note: $$ is the parent's PID, but we're a child proc.
|
||||
# Bash 4 has $BASHPID but we can't rely on that. Consequently,
|
||||
# we don't know our own PID. See the usage of $! below.
|
||||
@@ -2484,7 +2472,7 @@ This tool requires Bash v3 or newer. Certain options require other programs:
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-stalk>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -2564,7 +2552,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-stalk 3.5.2
|
||||
pt-stalk 3.5.1
|
||||
|
||||
=cut
|
||||
|
||||
|
@@ -2690,7 +2690,7 @@ This tool requires the Bourne shell (F</bin/sh>).
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-summary>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -2769,7 +2769,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-summary 3.5.2
|
||||
pt-summary 3.5.1
|
||||
|
||||
=cut
|
||||
|
||||
|
@@ -58,7 +58,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -3673,7 +3673,7 @@ sub connect {
|
||||
my $dp = $self->{DSNParser};
|
||||
|
||||
my $dbh = $self->{dbh};
|
||||
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
|
||||
if ( !$dbh || !$dbh->ping() ) {
|
||||
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
|
||||
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
|
||||
$self->{asked_for_pass} = 1;
|
||||
@@ -3702,20 +3702,19 @@ sub connect {
|
||||
sub set_dbh {
|
||||
my ($self, $dbh) = @_;
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname, $connection_id) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} && $self->{dbh_set} == $connection_id) {
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} ) {
|
||||
PTDEBUG && _d($dbh, 'Already set dbh');
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
if ( $hostname ) {
|
||||
$self->{hostname} = $hostname;
|
||||
}
|
||||
@@ -3730,7 +3729,7 @@ sub set_dbh {
|
||||
}
|
||||
|
||||
$self->{dbh} = $dbh;
|
||||
$self->{dbh_set} = $connection_id;
|
||||
$self->{dbh_set} = 1;
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
@@ -3856,17 +3855,6 @@ sub DESTROY {
|
||||
return;
|
||||
}
|
||||
|
||||
sub _ping() {
|
||||
my ( $self, $dbh ) = @_;
|
||||
if (!$dbh->ping()) {
|
||||
return 0;
|
||||
}
|
||||
my $sql = 'SELECT CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($connection_id) = $dbh->selectrow_array($sql);
|
||||
return $self->{dbh_set} == $connection_id;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
@@ -4528,7 +4516,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -4709,7 +4697,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
my $key_ddl = $key;
|
||||
@@ -4719,7 +4708,7 @@ sub get_keys {
|
||||
$key =~ s/USING HASH/USING BTREE/;
|
||||
}
|
||||
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
@@ -5000,7 +4989,7 @@ sub generate_cmp_where {
|
||||
push @clause, "($val IS NULL OR $quo $type $val)";
|
||||
}
|
||||
elsif ( $type =~ m/>/ ) {
|
||||
push @clause, "(($val IS NULL AND $quo IS NOT NULL) OR ($quo $cmp $val))";
|
||||
push @clause, "($val IS NULL AND $quo IS NOT NULL) OR ($quo $cmp $val)";
|
||||
}
|
||||
else { # If $type =~ m/</ ) {
|
||||
push @clauses, "(($val IS NOT NULL AND $quo IS NULL) OR ($quo $cmp $val))";
|
||||
@@ -5199,7 +5188,6 @@ sub get_slaves {
|
||||
dsn => $dsn,
|
||||
slave_user => $o->got('slave-user') ? $o->get('slave-user') : '',
|
||||
slave_password => $o->got('slave-password') ? $o->get('slave-password') : '',
|
||||
slaves => $args{slaves},
|
||||
callback => sub {
|
||||
my ( $dsn, $dbh, $level, $parent ) = @_;
|
||||
return unless $level;
|
||||
@@ -5276,29 +5264,16 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d("Slave password set");
|
||||
}
|
||||
|
||||
my $dbh = $args->{dbh};
|
||||
|
||||
DBH: {
|
||||
if ( !defined $dbh ) {
|
||||
foreach my $known_slave ( @{$args->{slaves}} ) {
|
||||
if ($known_slave->{dsn}->{h} eq $slave_dsn->{h} and
|
||||
$known_slave->{dsn}->{P} eq $slave_dsn->{P} ) {
|
||||
$dbh = $known_slave->{dbh};
|
||||
last DBH;
|
||||
}
|
||||
}
|
||||
|
||||
eval {
|
||||
$dbh = $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), ": ", $EVAL_ERROR, "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
|
||||
my $sql = 'SELECT @@SERVER_ID';
|
||||
@@ -13035,7 +13010,6 @@ with these flags:
|
||||
TABLE_DIFF 16 At least one diff was found
|
||||
SKIP_CHUNK 32 At least one chunk was skipped
|
||||
SKIP_TABLE 64 At least one table was skipped
|
||||
REPLICATION_STOPPED 128 Replica is down or stopped
|
||||
|
||||
If any flag is set, the exit status will be non-zero. Use the bitwise C<AND>
|
||||
operation to check for a particular flag. For example, if C<$exit_status & 16>
|
||||
@@ -14076,7 +14050,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-table-checksum>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -14155,6 +14129,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-table-checksum 3.5.2
|
||||
pt-table-checksum 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -55,7 +55,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -2877,7 +2877,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -3058,7 +3058,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
my $key_ddl = $key;
|
||||
@@ -3068,7 +3069,7 @@ sub get_keys {
|
||||
$key =~ s/USING HASH/USING BTREE/;
|
||||
}
|
||||
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
@@ -6516,7 +6517,7 @@ sub generate_cmp_where {
|
||||
push @clause, "($val IS NULL OR $quo $type $val)";
|
||||
}
|
||||
elsif ( $type =~ m/>/ ) {
|
||||
push @clause, "(($val IS NULL AND $quo IS NOT NULL) OR ($quo $cmp $val))";
|
||||
push @clause, "($val IS NULL AND $quo IS NOT NULL) OR ($quo $cmp $val)";
|
||||
}
|
||||
else { # If $type =~ m/</ ) {
|
||||
push @clauses, "(($val IS NOT NULL AND $quo IS NULL) OR ($quo $cmp $val))";
|
||||
@@ -6715,7 +6716,6 @@ sub get_slaves {
|
||||
dsn => $dsn,
|
||||
slave_user => $o->got('slave-user') ? $o->get('slave-user') : '',
|
||||
slave_password => $o->got('slave-password') ? $o->get('slave-password') : '',
|
||||
slaves => $args{slaves},
|
||||
callback => sub {
|
||||
my ( $dsn, $dbh, $level, $parent ) = @_;
|
||||
return unless $level;
|
||||
@@ -6792,29 +6792,16 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d("Slave password set");
|
||||
}
|
||||
|
||||
my $dbh = $args->{dbh};
|
||||
|
||||
DBH: {
|
||||
if ( !defined $dbh ) {
|
||||
foreach my $known_slave ( @{$args->{slaves}} ) {
|
||||
if ($known_slave->{dsn}->{h} eq $slave_dsn->{h} and
|
||||
$known_slave->{dsn}->{P} eq $slave_dsn->{P} ) {
|
||||
$dbh = $known_slave->{dbh};
|
||||
last DBH;
|
||||
}
|
||||
}
|
||||
|
||||
eval {
|
||||
$dbh = $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), ": ", $EVAL_ERROR, "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
|
||||
my $sql = 'SELECT @@SERVER_ID';
|
||||
@@ -11807,11 +11794,11 @@ Make slave1 have the same data as its replication master:
|
||||
|
||||
Resolve differences that L<pt-table-checksum> found on all slaves of master1:
|
||||
|
||||
pt-table-sync --execute --replicate percona.checksum master1
|
||||
pt-table-sync --execute --replicate test.checksum master1
|
||||
|
||||
Same as above but only resolve differences on slave1:
|
||||
|
||||
pt-table-sync --execute --replicate percona.checksum \
|
||||
pt-table-sync --execute --replicate test.checksum \
|
||||
--sync-to-master slave1
|
||||
|
||||
Sync master2 in a master-master replication configuration, where master2's copy
|
||||
@@ -13052,7 +13039,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-table-sync>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -13114,7 +13101,7 @@ This existing literature mostly addressed how to find the differences between
|
||||
the tables, not how to resolve them once found. I needed a tool that would not
|
||||
only find them efficiently, but would then resolve them. I first began thinking
|
||||
about how to improve the technique further with my article
|
||||
L<https://web.archive.org/web/20071018105253/http://www.xaprb.com/blog/2007/03/05/an-algorithm-to-find-and-resolve-data-differences-between-mysql-tables/>,
|
||||
L<http://tinyurl.com/mysql-data-diff-algorithm>,
|
||||
where I discussed a number of problems with the Maxia/Coelho "bottom-up"
|
||||
algorithm. After writing that article, I began to write this tool. I wanted to
|
||||
actually implement their algorithm with some improvements so I was sure I
|
||||
@@ -13132,8 +13119,8 @@ also my own work.
|
||||
|
||||
Another tool that can synchronize tables is the SQLyog Job Agent from webyog.
|
||||
Thanks to Rohit Nadhani, SJA's author, for the conversations about the general
|
||||
techniques. There is a comparison of pt-table-sync and SJA at
|
||||
L<https://web.archive.org/web/20070919024435/http://www.xaprb.com/blog/2007/04/05/mysql-table-sync-vs-sqlyog-job-agent/>
|
||||
techniques. There is a comparison of pt-table-sync and SJA at
|
||||
L<http://tinyurl.com/maatkit-vs-sqlyog>
|
||||
|
||||
Thanks to the following people and organizations for helping in many ways:
|
||||
|
||||
@@ -13178,6 +13165,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-table-sync 3.5.2
|
||||
pt-table-sync 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -8446,7 +8446,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-table-usage>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -8519,6 +8519,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-table-usage 3.5.2
|
||||
pt-table-usage 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -61,7 +61,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -2539,7 +2539,7 @@ sub connect {
|
||||
my $dp = $self->{DSNParser};
|
||||
|
||||
my $dbh = $self->{dbh};
|
||||
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
|
||||
if ( !$dbh || !$dbh->ping() ) {
|
||||
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
|
||||
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
|
||||
$self->{asked_for_pass} = 1;
|
||||
@@ -2568,20 +2568,19 @@ sub connect {
|
||||
sub set_dbh {
|
||||
my ($self, $dbh) = @_;
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname, $connection_id) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} && $self->{dbh_set} == $connection_id) {
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} ) {
|
||||
PTDEBUG && _d($dbh, 'Already set dbh');
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
if ( $hostname ) {
|
||||
$self->{hostname} = $hostname;
|
||||
}
|
||||
@@ -2596,7 +2595,7 @@ sub set_dbh {
|
||||
}
|
||||
|
||||
$self->{dbh} = $dbh;
|
||||
$self->{dbh_set} = $connection_id;
|
||||
$self->{dbh_set} = 1;
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
@@ -2722,17 +2721,6 @@ sub DESTROY {
|
||||
return;
|
||||
}
|
||||
|
||||
sub _ping() {
|
||||
my ( $self, $dbh ) = @_;
|
||||
if (!$dbh->ping()) {
|
||||
return 0;
|
||||
}
|
||||
my $sql = 'SELECT CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($connection_id) = $dbh->selectrow_array($sql);
|
||||
return $self->{dbh_set} == $connection_id;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
@@ -11454,7 +11442,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-upgrade>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -11528,6 +11516,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-upgrade 3.5.2
|
||||
pt-upgrade 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -44,7 +44,7 @@ BEGIN {
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
@@ -5489,7 +5489,7 @@ pt-variable-advisor examines C<SHOW VARIABLES> for bad values and settings
|
||||
according to the L<"RULES"> described below. It reports on variables that
|
||||
match the rules, so you can find bad settings in your MySQL server.
|
||||
|
||||
At the time of this release, pt-variable-advisor only examines
|
||||
At the time of this release, pt-variable-advisor only examples
|
||||
C<SHOW VARIABLES>, but other input sources are planned like C<SHOW STATUS>
|
||||
and C<SHOW SLAVE STATUS>.
|
||||
|
||||
@@ -6253,7 +6253,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-variable-advisor>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -6326,6 +6326,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-variable-advisor 3.5.2
|
||||
pt-variable-advisor 3.5.1
|
||||
|
||||
=cut
|
||||
|
@@ -699,7 +699,7 @@ sub index_access {
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/OptionParser.pm
|
||||
# t/lib/OptionParser.t
|
||||
# See https://github.com/percona/percona-toolkit for more information.
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
{
|
||||
package OptionParser;
|
||||
@@ -1810,7 +1810,7 @@ if ( PTDEBUG ) {
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/DSNParser.pm
|
||||
# t/lib/DSNParser.t
|
||||
# See https://github.com/percona/percona-toolkit for more information.
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
{
|
||||
package DSNParser;
|
||||
@@ -2255,7 +2255,7 @@ sub _d {
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/Daemon.pm
|
||||
# t/lib/Daemon.t
|
||||
# See https://github.com/percona/percona-toolkit for more information.
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
{
|
||||
package Daemon;
|
||||
@@ -3234,7 +3234,7 @@ installed in any reasonably new version of Perl.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-visual-explain>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Include the following information in your bug report:
|
||||
@@ -3308,6 +3308,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-visual-explain 3.5.2
|
||||
pt-visual-explain 3.5.1
|
||||
|
||||
=cut
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg width="162" height="140" viewBox="0 0 162 140" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M131.446 87.9231C148.661 76.6669 154.283 53.7221 143.868 35.6906C138.642 26.6448 130.209 20.1698 120.118 17.4549C110.76 14.9442 101.005 15.9773 92.4039 20.314L80.6672 0L56.3049 42.1896L0 139.711H161.346L131.446 87.9231ZM117.367 27.786C124.707 29.7442 130.809 34.4533 134.606 41.0123C142.078 53.9383 138.197 70.3361 126.076 78.625L97.7737 29.6C103.876 26.6688 110.748 26.0321 117.367 27.786ZM80.6792 21.4071L142.798 128.995H106.459L62.4916 52.9052L80.6672 21.4192L80.6792 21.4071ZM18.5601 129.007L56.3169 63.6328L94.0737 129.007H18.5601Z" fill="#FF7E1A"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 671 B |
BIN
config/sphinx-build/_static/percona-logo.jpg
Normal file
After Width: | Height: | Size: 54 KiB |
@@ -1,9 +1,12 @@
|
||||
<svg width="520" height="451" viewBox="0 0 520 451" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M423.631 283.376C479.103 247.116 497.253 173.155 463.684 115.024C446.863 85.8662 419.673 64.9845 387.145 56.265C357.008 48.1741 325.531 51.4826 297.826 65.4793L260 0L181.483 135.988L0 450.285H520L423.631 283.376ZM378.25 89.5766C401.894 95.8741 421.57 111.056 433.825 132.195C457.912 173.866 445.399 226.719 406.336 253.414L315.1 95.4103C334.755 85.9589 356.925 83.8976 378.25 89.5766ZM260 69.0145L460.2 415.767H343.063L201.406 170.496L259.99 69.0248L260 69.0145ZM59.8002 415.767L181.472 205.075L303.144 415.767H59.8002Z" fill="url(#paint0_linear_552_15)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_552_15" x1="58.6494" y1="460.228" x2="444.575" y2="74.3019" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FC3519"/>
|
||||
<stop offset="1" stop-color="#F0D136"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<svg width="74" height="74" viewBox="0 0 74 74" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="37" cy="37" r="37" fill="url(#paint0_linear)"/>
|
||||
<path d="M37.5003 58C49.3744 58 59 48.3743 59 36.5C59 24.6257 49.3744 15 37.5003 15C25.6261 15 16 24.6257 16 36.5C16 36.6671 16.0019 36.8338 16.0057 37H16V67.4672C18.744 69.3622 21.7566 70.896 24.969 72H25V53.9948C28.5225 56.5161 32.8381 58 37.5003 58Z" fill="white"/>
|
||||
<path d="M50 36.5C50 43.4036 44.4037 49 37.5001 49C30.5966 49 25 43.4036 25 36.5C25 29.5964 30.5966 24 37.5001 24C44.4037 24 50 29.5964 50 36.5Z" fill="#FCB42F"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear" x1="37" y1="0" x2="37" y2="74" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FBB32F"/>
|
||||
<stop offset="0.504739" stop-color="#C11511"/>
|
||||
<stop offset="1" stop-color="#C11411"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 901 B After Width: | Height: | Size: 878 B |
BIN
config/sphinx-build/_static/percona_favicon.ico
Normal file
After Width: | Height: | Size: 894 B |
@@ -12,13 +12,13 @@ html_theme_options = {
|
||||
'base_url': 'http://bashtage.github.io/sphinx-material/',
|
||||
'repo_url': 'https://github.com/percona/percona-toolkit',
|
||||
'repo_name': 'percona/percona-toolkit',
|
||||
'color_accent': 'cyan',
|
||||
'color_primary': 'blue-grey',
|
||||
'color_accent': 'grey',
|
||||
'color_primary': 'orange',
|
||||
'globaltoc_collapse': True,
|
||||
'version_dropdown': True
|
||||
}
|
||||
html_logo = '../_static/percona-logo.svg'
|
||||
html_favicon = '../_static/percona-favicon.ico'
|
||||
html_favicon = '../_static/percona_favicon.ico'
|
||||
pygments_style = 'emacs'
|
||||
gitstamp_fmt = "%b %d, %Y"
|
||||
# Specify the text pattern that won't be copied with the code block contents
|
||||
|
@@ -50,7 +50,7 @@ copyright = u'2023, Percona LLC and/or its affiliates'
|
||||
# The short X.Y version.
|
||||
version = '3.5'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '3.5.2'
|
||||
release = '3.5.1'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
@@ -203,7 +203,7 @@ htmlhelp_basename = 'PerconaToolkitdoc'
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'PerconaToolkit.tex', u'Percona Toolkit Documentation',
|
||||
u'2023, Percona LLC and/or its affiliates', 'manual'),
|
||||
u'2022, Percona LLC and/or its affiliates', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
@@ -237,5 +237,5 @@ latex_toplevel_sectioning = 'part'
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'perconatoolkit', u'Percona Toolkit Documentation',
|
||||
[u'2023, Percona LLC and/or its affiliates'], 1)
|
||||
[u'2022, Percona LLC and/or its affiliates'], 1)
|
||||
]
|
||||
|
BIN
config/sphinx-build/percona-logo.jpg
Normal file
After Width: | Height: | Size: 54 KiB |
@@ -41,10 +41,10 @@ You can also download the packages from the
|
||||
`Percona web site <https://www.percona.com/downloads/percona-toolkit/>`_
|
||||
and install it using tools like ``dpkg`` and ``rpm``,
|
||||
depending on your system.
|
||||
For example, to download the package for Debian 11 ("bullseye"),
|
||||
For example, to download the package for Debian 8 ("jessie"),
|
||||
run the following::
|
||||
|
||||
wget https://downloads.percona.com/downloads/percona-toolkit/3.5.1/binary/debian/bullseye/x86_64/percona-toolkit_3.5.1-2.bullseye_amd64.deb
|
||||
wget https://www.percona.com/downloads/percona-toolkit/3.0.3/binary/debian/jessie/x86_64/percona-toolkit_3.0.3-1.jessie_amd64.deb
|
||||
|
||||
If you want to download a specific tool, use the following address:
|
||||
http://www.percona.com/get
|
||||
|
@@ -575,6 +575,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
Percona Toolkit v3.5.2 released 2023-03-28
|
||||
Percona Toolkit v3.5.1 released 2023-01-23
|
||||
|
||||
=cut
|
||||
|
@@ -122,7 +122,7 @@ Usage
|
||||
|
||||
``pt-k8s-debug-collector <flags>``
|
||||
|
||||
Supported Flags
|
||||
Supported Flags:
|
||||
================
|
||||
|
||||
``--resource``
|
||||
@@ -157,18 +157,12 @@ Path to kubeconfig. Default configuration be used if none specified
|
||||
|
||||
Port to use when collecting database-specific summaries. By default, 3306 will be used for PXC and MySQL, 27017 for MongoDB, and 5432 for PostgreSQL
|
||||
|
||||
``--version``
|
||||
|
||||
Print version info
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
- Installed, configured, and available in PATH ``kubectl``
|
||||
- Installed, configured, and available in PATH ``pt-mysql-summary`` for PXC and MySQL
|
||||
- Installed, configured, and available in PATH ``mysql`` for PXC and MySQL
|
||||
- Installed, configured, and available in PATH ``pt-mongodb-summary`` for MongoDB
|
||||
- Installed, configured, and available in PATH ``psql`` for PostgreSQL
|
||||
|
||||
Known Issues
|
||||
============
|
||||
@@ -184,4 +178,4 @@ On Kubernetes 1.21 - 1.24 warning is printed:
|
||||
metadata:
|
||||
resourceVersion: ""
|
||||
|
||||
This warning is harmless and does not affect data collection. We will remove podsecuritypolicies once everyone upgrade to Kubernetes 1.25 or newer. Before that we advise to ignore this warning.
|
||||
This warning is harmless and does not affect data collection. We will remove podsecuritypolicies once everyone upgrade to Kubernetes 1.25 or newer. Before that we advise to ignore this warning.
|
@@ -1,50 +1,7 @@
|
||||
Percona Toolkit
|
||||
***************
|
||||
|
||||
v3.5.2 released 2023-03-28
|
||||
==============================
|
||||
|
||||
Improvements
|
||||
------------------------------------------------------------
|
||||
|
||||
* :jirabug:`PT-188`: Use percona.checksums in examples
|
||||
* :jirabug:`PT-2141`: Fix tests for pt-archiver
|
||||
* :jirabug:`PT-2149`: Fix tests for pt-mext
|
||||
* :jirabug:`PT-2150`: Fix tests for pt-mysql-summary
|
||||
* :jirabug:`PT-2152`: Fix tests for pt-show-grants
|
||||
* :jirabug:`PT-2155`: Fix tests for pt-upgrade
|
||||
* :jirabug:`PT-2156`: Fix tests for lib
|
||||
* :jirabug:`PT-2159`: Fix tests for pt-duplicate-key-checker
|
||||
* :jirabug:`PT-2160`: Fix tests for pt-online-schema-change
|
||||
* :jirabug:`PT-2161`: Fix tests for pt-slave-restart
|
||||
* :jirabug:`PT-2164`: pt-k8s-debug-collector does not have version flag
|
||||
* :jirabug:`PT-2165`: Actual Version, GoVersion, and Build for Go tools
|
||||
|
||||
Bugs Fixed
|
||||
------------
|
||||
|
||||
* :jirabug:`PT-215`: Documentation fix
|
||||
* :jirabug:`PT-1059`: LP #1093972: Tools can't parse index names containing newlines
|
||||
* :jirabug:`PT-1389`: LP #1637859: [pt-variable-advisor] Docs Typos
|
||||
* :jirabug:`PT-1594`: Need correction in the Documentation - pt-mysql-summary
|
||||
* :jirabug:`PT-1595`: percona toolkit docs still reference Maatkit
|
||||
* :jirabug:`PT-1642`: Update PT docs to reference bug reporting location as Percona JIRA
|
||||
* :jirabug:`PT-1683`: List of supported distributions in the docs is outdated
|
||||
* :jirabug:`PT-1700`: pt-table-checksum REPLICATION_STOPPED exit status not documented
|
||||
* :jirabug:`PT-1927`: pt-k8s-debug-collector requires mysql client
|
||||
* :jirabug:`PT-1930`: pt-k8s-debug-collector should not attempt collecting PXC information when running against PSMDB
|
||||
* :jirabug:`PT-2084`: Changes from PT-80 broke previous pt-stalk functionality (Thanks to Agustín Gallego for reporting this issue)
|
||||
* :jirabug:`PT-2102`: pt-mysql-summary should support !include* in config files (Thanks to Yoann La Cancellera for reporting this issue)
|
||||
* :jirabug:`PT-2110`: Incorrect PTDEBUG output with --ignore-engines option (Thanks to Kazuya Yokogawa for reporting this issue)
|
||||
* :jirabug:`PT-2114`: Incorrect casting of BIT columns by pt-archiver
|
||||
* :jirabug:`PT-2116`: pt-osc --null-to-not-null description is wrong (Thanks to Yoann La Cancellera for reporting this issue)
|
||||
* :jirabug:`PT-2120`: pt-stalk with --system-only displaying "MYSQL_ONLY:" message on the screen
|
||||
* :jirabug:`PT-2123`: pt-archiver gives error "Wide character in print at /usr/bin/pt-archiver line 6815" when using --bulk-insert while using character set alias
|
||||
* :jirabug:`PT-2187`: CVEs reported in Percona Toolkit version 5.3.1 related to GO
|
||||
|
||||
|
||||
v3.5.1 released 2023-01-23
|
||||
==============================
|
||||
|
||||
New Features
|
||||
------------------------------------------------------------
|
||||
|
@@ -1,48 +0,0 @@
|
||||
.. _PT-3.5.2:
|
||||
|
||||
================================================================================
|
||||
*Percona Toolkit* 3.5.2
|
||||
================================================================================
|
||||
|
||||
:Date: March 28, 2023
|
||||
:Installation: `Installing Percona Toolkit <https://www.percona.com/doc/percona-toolkit/LATEST/installation.html>`_
|
||||
|
||||
|
||||
Improvements
|
||||
================================================================================
|
||||
|
||||
* :jirabug:`PT-188`: Use percona.checksums in examples
|
||||
* :jirabug:`PT-2141`: Fix tests for pt-archiver
|
||||
* :jirabug:`PT-2149`: Fix tests for pt-mext
|
||||
* :jirabug:`PT-2150`: Fix tests for pt-mysql-summary
|
||||
* :jirabug:`PT-2152`: Fix tests for pt-show-grants
|
||||
* :jirabug:`PT-2155`: Fix tests for pt-upgrade
|
||||
* :jirabug:`PT-2156`: Fix tests for lib
|
||||
* :jirabug:`PT-2159`: Fix tests for pt-duplicate-key-checker
|
||||
* :jirabug:`PT-2160`: Fix tests for pt-online-schema-change
|
||||
* :jirabug:`PT-2161`: Fix tests for pt-slave-restart
|
||||
* :jirabug:`PT-2164`: pt-k8s-debug-collector does not have version flag
|
||||
* :jirabug:`PT-2165`: Actual Version, GoVersion, and Build for Go tools
|
||||
|
||||
Bugs Fixed
|
||||
================================================================================
|
||||
|
||||
* :jirabug:`PT-215`: Documentation fix
|
||||
* :jirabug:`PT-1059`: LP #1093972: Tools can't parse index names containing newlines
|
||||
* :jirabug:`PT-1389`: LP #1637859: [pt-variable-advisor] Docs Typos
|
||||
* :jirabug:`PT-1594`: Need correction in the Documentation - pt-mysql-summary
|
||||
* :jirabug:`PT-1595`: percona toolkit docs still reference Maatkit
|
||||
* :jirabug:`PT-1642`: Update PT docs to reference bug reporting location as Percona JIRA
|
||||
* :jirabug:`PT-1683`: List of supported distributions in the docs is outdated
|
||||
* :jirabug:`PT-1700`: pt-table-checksum REPLICATION_STOPPED exit status not documented
|
||||
* :jirabug:`PT-1927`: pt-k8s-debug-collector requires mysql client
|
||||
* :jirabug:`PT-1930`: pt-k8s-debug-collector should not attempt collecting PXC information when running against PSMDB
|
||||
* :jirabug:`PT-2084`: Changes from PT-80 broke previous pt-stalk functionality (Thanks Agustín Gallego)
|
||||
* :jirabug:`PT-2102`: pt-mysql-summary should support !include* in config files (Thanks Yoann La Cancellera)
|
||||
* :jirabug:`PT-2110`: Incorrect PTDEBUG output with --ignore-engines option (Thanks Kazuya Yokogawa)
|
||||
* :jirabug:`PT-2114`: Incorrect casting of BIT columns by pt-archiver
|
||||
* :jirabug:`PT-2116`: pt-osc --null-to-not-null description is wrong (Thanks Yoann La Cancellera)
|
||||
* :jirabug:`PT-2120`: pt-stalk with --system-only displaying "MYSQL_ONLY:" message on the screen
|
||||
* :jirabug:`PT-2123`: pt-archiver gives error "Wide character in print at /usr/bin/pt-archiver line 6815" when using --bulk-insert while using character set alias
|
||||
* :jirabug:`PT-2187`: CVEs reported in Percona Toolkit version 5.3.1 related to GO
|
||||
|
62
go.mod
@@ -1,31 +1,31 @@
|
||||
module github.com/percona/percona-toolkit
|
||||
|
||||
go 1.20
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/AlekSi/pointer v1.2.0
|
||||
github.com/Masterminds/semver v1.5.0
|
||||
github.com/Masterminds/semver v1.4.2
|
||||
github.com/alecthomas/kingpin v2.2.6+incompatible
|
||||
github.com/alecthomas/kong v0.7.1
|
||||
github.com/go-ini/ini v1.67.0
|
||||
github.com/golang/mock v1.6.0
|
||||
github.com/alecthomas/kong v0.5.0
|
||||
github.com/go-ini/ini v1.66.4
|
||||
github.com/golang/mock v1.4.4
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/hashicorp/go-version v1.6.0
|
||||
github.com/hashicorp/go-version v1.4.0
|
||||
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef
|
||||
github.com/lib/pq v1.10.7
|
||||
github.com/lib/pq v1.10.4
|
||||
github.com/mattn/go-shellwords v1.0.12
|
||||
github.com/montanaflynn/stats v0.7.0
|
||||
github.com/montanaflynn/stats v0.6.6
|
||||
github.com/pborman/getopt v1.1.0
|
||||
github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible
|
||||
github.com/sirupsen/logrus v1.9.0
|
||||
github.com/stretchr/testify v1.8.2
|
||||
go.mongodb.org/mongo-driver v1.11.3
|
||||
golang.org/x/crypto v0.7.0
|
||||
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
|
||||
github.com/sirupsen/logrus v1.8.1
|
||||
github.com/stretchr/testify v1.7.0
|
||||
go.mongodb.org/mongo-driver v1.9.0
|
||||
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29
|
||||
golang.org/x/exp v0.0.0-20221114191408-850992195362
|
||||
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
|
||||
k8s.io/api v0.26.3
|
||||
k8s.io/api v0.23.5
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -37,31 +37,31 @@ require (
|
||||
github.com/go-stack/stack v1.8.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/go-cmp v0.5.9 // indirect
|
||||
github.com/google/go-cmp v0.5.8 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/compress v1.16.3 // indirect
|
||||
github.com/klauspost/compress v1.15.1 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.11 // indirect
|
||||
github.com/tklauser/numcpus v0.6.0 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.10 // indirect
|
||||
github.com/tklauser/numcpus v0.4.0 // indirect
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||
github.com/xdg-go/scram v1.1.2 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
github.com/xdg-go/scram v1.1.1 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.3 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
golang.org/x/net v0.8.0 // indirect
|
||||
golang.org/x/sync v0.1.0 // indirect
|
||||
golang.org/x/sys v0.6.0 // indirect
|
||||
golang.org/x/term v0.6.0 // indirect
|
||||
golang.org/x/text v0.8.0 // indirect
|
||||
golang.org/x/net v0.4.0 // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||
golang.org/x/sys v0.3.0 // indirect
|
||||
golang.org/x/term v0.3.0 // indirect
|
||||
golang.org/x/text v0.5.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/apimachinery v0.26.3 // indirect
|
||||
k8s.io/klog/v2 v2.90.1 // indirect
|
||||
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||
k8s.io/apimachinery v0.23.5 // indirect
|
||||
k8s.io/klog/v2 v2.60.1 // indirect
|
||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
|
||||
)
|
||||
|
97
go.sum
@@ -4,8 +4,6 @@ github.com/AlekSi/pointer v1.2.0/go.mod h1:gZGfd3dpW4vEc/UlyfKKi1roIqcCgwOIvb0tS
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc=
|
||||
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
|
||||
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
|
||||
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
|
||||
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
|
||||
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
||||
@@ -13,8 +11,6 @@ github.com/alecthomas/kingpin v2.2.6+incompatible h1:5svnBTFgJjZvGKyYBtMB0+m5wvr
|
||||
github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE=
|
||||
github.com/alecthomas/kong v0.5.0 h1:u8Kdw+eeml93qtMZ04iei0CFYve/WPcA5IFh+9wSskE=
|
||||
github.com/alecthomas/kong v0.5.0/go.mod h1:uzxf/HUh0tj43x1AyJROl3JT7SgsZ5m+icOv1csRhc0=
|
||||
github.com/alecthomas/kong v0.7.1 h1:azoTh0IOfwlAX3qN9sHWTxACE2oV8Bg2gAwBsMwDQY4=
|
||||
github.com/alecthomas/kong v0.7.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U=
|
||||
github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 h1:8Uy0oSf5co/NZXje7U1z8Mpep++QJOldL2hs/sBQf48=
|
||||
github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
|
||||
@@ -40,8 +36,6 @@ github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSy
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/go-ini/ini v1.66.4 h1:dKjMqkcbkzfddhIhyglTPgMoJnkvmG+bSLrU9cTHc5M=
|
||||
github.com/go-ini/ini v1.66.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
|
||||
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
|
||||
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
|
||||
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
|
||||
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
|
||||
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
@@ -62,8 +56,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
|
||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
|
||||
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
@@ -86,8 +78,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
|
||||
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||
@@ -101,8 +91,6 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4=
|
||||
github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
|
||||
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb28sjiS3i7tcKCkflWFEkHfuAgM=
|
||||
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
@@ -114,8 +102,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
|
||||
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
github.com/klauspost/compress v1.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A=
|
||||
github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||
github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY=
|
||||
github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
@@ -124,8 +110,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
|
||||
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
|
||||
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
|
||||
@@ -141,8 +125,6 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||
github.com/montanaflynn/stats v0.6.6 h1:Duep6KMIDpY4Yo11iFsvyqJDyfzLF9+sndUKT+v64GQ=
|
||||
github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU=
|
||||
github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
@@ -168,15 +150,11 @@ github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKl
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
|
||||
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
||||
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
@@ -184,68 +162,46 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
|
||||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
|
||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw=
|
||||
github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk=
|
||||
github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM=
|
||||
github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI=
|
||||
github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o=
|
||||
github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ=
|
||||
github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms=
|
||||
github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||
github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs=
|
||||
github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E=
|
||||
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
|
||||
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
|
||||
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
|
||||
github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM=
|
||||
github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs=
|
||||
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
|
||||
github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
|
||||
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
|
||||
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk=
|
||||
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
|
||||
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
go.mongodb.org/mongo-driver v1.9.0 h1:f3aLGJvQmBl8d9S40IL+jEyBC6hfLPbJjv9t5hEM9ck=
|
||||
go.mongodb.org/mongo-driver v1.9.0/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY=
|
||||
go.mongodb.org/mongo-driver v1.11.3 h1:Ql6K6qYHEzB6xvu4+AU0BoRoqf9vFPcc4o7MUIdPW8Y=
|
||||
go.mongodb.org/mongo-driver v1.11.3/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 h1:tkVvjkPTB7pnW3jnid7kNyAMPVWllTNOf/qKDze4p9o=
|
||||
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20221114191408-850992195362 h1:NoHlPRbyl1VFI6FjwHtPQCN7wAMXI6cKcqrmXhOOfBQ=
|
||||
golang.org/x/exp v0.0.0-20221114191408-850992195362/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
|
||||
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
|
||||
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -257,15 +213,10 @@ golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU=
|
||||
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -274,9 +225,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -293,35 +241,22 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
|
||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
|
||||
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
|
||||
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
@@ -333,9 +268,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
|
||||
golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
@@ -383,42 +316,28 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
k8s.io/api v0.23.5 h1:zno3LUiMubxD/V1Zw3ijyKO3wxrhbUF1Ck+VjBvfaoA=
|
||||
k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8=
|
||||
k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=
|
||||
k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=
|
||||
k8s.io/apimachinery v0.23.5 h1:Va7dwhp8wgkUPWsEXk6XglXWU4IKYLKNlv8VkX7SDM0=
|
||||
k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM=
|
||||
k8s.io/apimachinery v0.26.3 h1:dQx6PNETJ7nODU3XPtrwkfuubs6w7sX0M8n61zHIV/k=
|
||||
k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I=
|
||||
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
|
||||
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
|
||||
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
|
||||
k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
|
||||
k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc=
|
||||
k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
|
||||
k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
|
||||
k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
|
||||
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk=
|
||||
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc=
|
||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 h1:xMMXJlJbsU8w3V5N2FLDQ8YgU8s1EoULdbQBcAeNJkY=
|
||||
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs=
|
||||
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y=
|
||||
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
|
46
lib/Cxn.pm
@@ -123,8 +123,7 @@ sub connect {
|
||||
my $dp = $self->{DSNParser};
|
||||
|
||||
my $dbh = $self->{dbh};
|
||||
# We cannot use $dbh->ping() here due to https://github.com/perl5-dbi/DBD-mysql/issues/306
|
||||
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
|
||||
if ( !$dbh || !$dbh->ping() ) {
|
||||
# Ask for password once.
|
||||
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
|
||||
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
|
||||
@@ -154,18 +153,6 @@ sub connect {
|
||||
sub set_dbh {
|
||||
my ($self, $dbh) = @_;
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
# Set stuff for this dbh (i.e. initialize it).
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
# Update the cxn's name. Until we connect, the DSN parts
|
||||
# h and P are used. Once connected, use @@hostname.
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname, $connection_id) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
|
||||
# If we already have a dbh, and that dbh is the same as this dbh,
|
||||
# and the dbh has already been set, then do not re-set the same
|
||||
# dbh. dbh_set is required so that if this obj was created with
|
||||
@@ -173,14 +160,22 @@ sub set_dbh {
|
||||
# created the dbh probably didn't set what we set here. For example,
|
||||
# MasterSlave makes dbhs when finding slaves, but it doesn't set
|
||||
# anything.
|
||||
# Due to https://github.com/perl5-dbi/DBD-mysql/issues/306 we assigning
|
||||
# connection_id to $self->{dbh_set} and compare it with current connection_id.
|
||||
# This is required to set variable values again after disconnect.
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} && $self->{dbh_set} == $connection_id) {
|
||||
if ( $self->{dbh} && $self->{dbh} == $dbh && $self->{dbh_set} ) {
|
||||
PTDEBUG && _d($dbh, 'Already set dbh');
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($dbh, 'Setting dbh');
|
||||
|
||||
# Set stuff for this dbh (i.e. initialize it).
|
||||
$dbh->{FetchHashKeyName} = 'NAME_lc' if $self->{NAME_lc};
|
||||
|
||||
# Update the cxn's name. Until we connect, the DSN parts
|
||||
# h and P are used. Once connected, use @@hostname.
|
||||
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($server_id, $hostname) = $dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($dbh, 'hostname:', $hostname, $server_id);
|
||||
if ( $hostname ) {
|
||||
$self->{hostname} = $hostname;
|
||||
}
|
||||
@@ -196,7 +191,7 @@ sub set_dbh {
|
||||
}
|
||||
|
||||
$self->{dbh} = $dbh;
|
||||
$self->{dbh_set} = $connection_id;
|
||||
$self->{dbh_set} = 1;
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
@@ -348,19 +343,6 @@ sub DESTROY {
|
||||
return;
|
||||
}
|
||||
|
||||
# We have to create a wrapper around $dbh->ping() here due to
|
||||
# https://github.com/perl5-dbi/DBD-mysql/issues/306
|
||||
sub _ping() {
|
||||
my ( $self, $dbh ) = @_;
|
||||
if (!$dbh->ping()) {
|
||||
return 0;
|
||||
}
|
||||
my $sql = 'SELECT CONNECTION_ID() as connection_id';
|
||||
PTDEBUG && _d($dbh, $sql);
|
||||
my ($connection_id) = $dbh->selectrow_array($sql);
|
||||
return $self->{dbh_set} == $connection_id;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
|
@@ -265,7 +265,7 @@ sub fill_in_dsn {
|
||||
}
|
||||
|
||||
# Actually opens a connection, then sets some things on the connection so it is
|
||||
# the way the Percona tools will expect. Tools should NEVER open their own
|
||||
# the way the Maatkit tools will expect. Tools should NEVER open their own
|
||||
# connection or use $dbh->reconnect, or these things will not take place!
|
||||
sub get_dbh {
|
||||
my ( $self, $cxn_string, $user, $pass, $opts ) = @_;
|
||||
|
@@ -87,7 +87,6 @@ sub get_slaves {
|
||||
dsn => $dsn,
|
||||
slave_user => $o->got('slave-user') ? $o->get('slave-user') : '',
|
||||
slave_password => $o->got('slave-password') ? $o->get('slave-password') : '',
|
||||
slaves => $args{slaves},
|
||||
callback => sub {
|
||||
my ( $dsn, $dbh, $level, $parent ) = @_;
|
||||
return unless $level;
|
||||
@@ -186,29 +185,16 @@ sub recurse_to_slaves {
|
||||
PTDEBUG && _d("Slave password set");
|
||||
}
|
||||
|
||||
my $dbh = $args->{dbh};
|
||||
|
||||
DBH: {
|
||||
if ( !defined $dbh ) {
|
||||
foreach my $known_slave ( @{$args->{slaves}} ) {
|
||||
if ($known_slave->{dsn}->{h} eq $slave_dsn->{h} and
|
||||
$known_slave->{dsn}->{P} eq $slave_dsn->{P} ) {
|
||||
$dbh = $known_slave->{dbh};
|
||||
last DBH;
|
||||
}
|
||||
}
|
||||
|
||||
eval {
|
||||
$dbh = $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), ": ", $EVAL_ERROR, "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
$dp->get_cxn_params($slave_dsn), { AutoCommit => 1 });
|
||||
PTDEBUG && _d('Connected to', $dp->as_string($slave_dsn));
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
print STDERR "Cannot connect to ", $dp->as_string($slave_dsn), "\n"
|
||||
or die "Cannot print: $OS_ERROR";
|
||||
return;
|
||||
}
|
||||
|
||||
my $sql = 'SELECT @@SERVER_ID';
|
||||
|
@@ -18,7 +18,7 @@
|
||||
# ###########################################################################
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.5.2';
|
||||
our $VERSION = '3.5.1';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
|
@@ -995,9 +995,9 @@ sub _parse_csv {
|
||||
if ( $args{quoted_values} ) {
|
||||
# If the vals are quoted, then they can contain commas, like:
|
||||
# "hello, world!", 'batman'. If only we could use Text::CSV,
|
||||
# then we wouldn't write yet another csv parser to handle this,
|
||||
# but Percona Toolkit doesn't like package dependencies, so here's
|
||||
# our light implementation of this classic problem.
|
||||
# then I wouldn't write yet another csv parser to handle this,
|
||||
# but Maatkit doesn't like package dependencies, so here's my
|
||||
# light implementation of this classic problem.
|
||||
my $quote_char = '';
|
||||
VAL:
|
||||
foreach my $val ( split(',', $vals) ) {
|
||||
|
@@ -372,7 +372,6 @@ sub verify_test_data {
|
||||
grep { !/tables_priv$/ }
|
||||
grep { !/user$/ }
|
||||
grep { !/proxies_priv$/ }
|
||||
grep { !/global_grants$/ }
|
||||
@{$master->selectcol_arrayref('SHOW TABLES FROM mysql')};
|
||||
my @tables_in_sakila = qw(actor address category city country customer
|
||||
film film_actor film_category film_text inventory
|
||||
|
@@ -197,7 +197,7 @@ sub generate_cmp_where {
|
||||
push @clause, "($val IS NULL OR $quo $type $val)";
|
||||
}
|
||||
elsif ( $type =~ m/>/ ) {
|
||||
push @clause, "(($val IS NULL AND $quo IS NOT NULL) OR ($quo $cmp $val))";
|
||||
push @clause, "($val IS NULL AND $quo IS NOT NULL) OR ($quo $cmp $val)";
|
||||
}
|
||||
else { # If $type =~ m/</ ) {
|
||||
push @clauses, "(($val IS NOT NULL AND $quo IS NULL) OR ($quo $cmp $val))";
|
||||
|
@@ -149,7 +149,7 @@ sub parse {
|
||||
|
||||
my $engine = $self->get_engine($ddl);
|
||||
|
||||
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
|
||||
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
|
||||
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
|
||||
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
|
||||
|
||||
@@ -389,7 +389,8 @@ sub get_keys {
|
||||
my $clustered_key = undef;
|
||||
|
||||
KEY:
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
|
||||
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
|
||||
|
||||
# If you want foreign keys, use get_fks() below.
|
||||
next KEY if $key =~ m/FOREIGN/;
|
||||
|
||||
@@ -406,7 +407,7 @@ sub get_keys {
|
||||
}
|
||||
|
||||
# Determine index type
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
|
||||
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
|
||||
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
|
||||
$type = $type || $special || 'BTREE';
|
||||
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
|
||||
|
@@ -580,16 +580,11 @@ slave_status() {
|
||||
local outfile=$1
|
||||
local mysql_version=$2
|
||||
|
||||
if [ "${mysql_version}" '<' "8.1" ]; then
|
||||
local sql="SHOW SLAVE STATUS\G"
|
||||
if [ "${mysql_version}" '<' "5.7" ]; then
|
||||
local sql="SHOW SLAVE STATUS\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
else
|
||||
local sql="SHOW REPLICA STATUS\G"
|
||||
fi
|
||||
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
if [ "${mysql_version}" '>' "5.6" ]; then
|
||||
local sql="SELECT * FROM performance_schema.replication_connection_configuration JOIN performance_schema.replication_applier_configuration USING(channel_name)\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
@@ -64,17 +64,12 @@ find_my_cnf_file() {
|
||||
# Find the cnf file for the specific port.
|
||||
cnf_file="$(grep --max-count 1 "/mysqld.*--port=$port" "$file" \
|
||||
| awk 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }')"
|
||||
|
||||
if [ -n "$cnf_file" ]; then
|
||||
echo "$cnf_file"
|
||||
return
|
||||
fi
|
||||
else
|
||||
# Find the cnf file for the first mysqld instance.
|
||||
cnf_file="$(grep --max-count 1 '/mysqld' "$file" \
|
||||
| awk 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }')"
|
||||
fi
|
||||
|
||||
cnf_file="$(grep --max-count 1 '/mysqld' "$file" \
|
||||
| awk 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }')"
|
||||
|
||||
|
||||
if [ -z "$cnf_file" ]; then
|
||||
# Cannot autodetect config file, try common locations.
|
||||
if [ -e "/etc/my.cnf" ]; then
|
||||
|
@@ -116,14 +116,9 @@ collect_encrypted_tables() {
|
||||
}
|
||||
|
||||
collect_encrypted_tablespaces() {
|
||||
local version="$1"
|
||||
# I_S.INNODB_[SYS_]TABLESPACES has a "flag" field. Encrypted tablespace has bit 14 set. You can check it with "flag & 8192".
|
||||
# I_S.INNODB_SYS_TABLESPACES has a "flag" field. Encrypted tablespace has bit 14 set. You can check it with "flag & 8192".
|
||||
# And seems like MySQL is capable of bitwise operations. https://dev.mysql.com/doc/refman/5.7/en/bit-functions.html
|
||||
if [ "$version" '<' "8.0" ]; then
|
||||
$CMD_MYSQL $EXT_ARGV --table -ss -e "SELECT SPACE, NAME, SPACE_TYPE from INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES where FLAG&8192 = 8192;"
|
||||
else
|
||||
$CMD_MYSQL $EXT_ARGV --table -ss -e "SELECT SPACE, NAME, SPACE_TYPE from INFORMATION_SCHEMA.INNODB_TABLESPACES where FLAG&8192 = 8192;"
|
||||
fi
|
||||
$CMD_MYSQL $EXT_ARGV --table -ss -e "SELECT SPACE, NAME, SPACE_TYPE from INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES where FLAG&8192 = 8192;"
|
||||
}
|
||||
|
||||
|
||||
@@ -387,25 +382,6 @@ pretty_print_cnf_file () {
|
||||
}
|
||||
}' "$file"
|
||||
|
||||
while read line; do
|
||||
echo $line | grep -q '!include'
|
||||
if [ $? -eq 0 ]; then
|
||||
clause=$(echo -n $line | tr -s ' ' | cut -d ' ' -f 1)
|
||||
include=$(echo -n $line | tr -s ' ' | cut -d ' ' -f 2)
|
||||
|
||||
if [ "x$include" != "x" -a -d "${include}" -a "x$clause" = 'x!includedir' ]; then
|
||||
for subfile in $(find -L "$include" -type f -maxdepth 1 -name *.cnf ); do
|
||||
echo "# $subfile"
|
||||
pretty_print_cnf_file $subfile
|
||||
done
|
||||
elif [ -f "$include" -a "$clause" = '!include' ]; then
|
||||
echo "# $include"
|
||||
pretty_print_cnf_file $include
|
||||
fi
|
||||
fi
|
||||
|
||||
done < "$file"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1604,9 +1580,8 @@ report_mysql_summary () {
|
||||
local encrypted_tables=""
|
||||
local encrypted_tablespaces=""
|
||||
if [ "${OPT_LIST_ENCRYPTED_TABLES}" = 'yes' ]; then
|
||||
local mysql_version="$(get_var version "$dir/mysql-variables")"
|
||||
encrypted_tables="$(collect_encrypted_tables)"
|
||||
encrypted_tablespaces="$(collect_encrypted_tablespaces ${mysql_version})"
|
||||
encrypted_tablespaces="$(collect_encrypted_tablespaces)"
|
||||
fi
|
||||
|
||||
format_keyring_plugins "$keyring_plugins" "$encrypted_tables"
|
||||
|
@@ -57,26 +57,21 @@ plugins_dir_cmd=""
|
||||
plugins_cmd=""
|
||||
keyring_cmd=""
|
||||
|
||||
if [ -z "${DISABLE_KEYRING}" ]; then
|
||||
if [ -e "${BASEDIR}/lib/mysql/plugin/keyring_file.so" ]; then
|
||||
encryption_plugins="${BASEDIR}/lib/mysql/plugin/keyring_file.so"
|
||||
plugins_dir_cmd="--plugin-dir=${BASEDIR}/lib/mysql/plugin/"
|
||||
elif [ -e "${BASEDIR}/lib/plugin/keyring_file.so" ]; then
|
||||
encryption_plugins="keyring_file.so"
|
||||
plugins_dir_cmd="--plugin-dir=${BASEDIR}/lib/plugin/"
|
||||
fi
|
||||
if [ -e "${BASEDIR}/lib/mysql/plugin/keyring_file.so" ]; then
|
||||
encryption_plugins="${BASEDIR}/lib/mysql/plugin/keyring_file.so"
|
||||
fi
|
||||
|
||||
if [ ! -z "$encryption_plugins" ]; then
|
||||
plugins_cmd="--early-plugin-load=${encryption_plugins}"
|
||||
keyring_cmd="--loose-keyring_file_data=/tmp/PORT/data/keyring"
|
||||
fi
|
||||
if [ ! -z "$encryption_plugins" ]; then
|
||||
plugins_cmd="--early-plugin-load=${encryption_plugins}"
|
||||
keyring_cmd="--keyring_file_data=/tmp/PORT/data/keyring"
|
||||
plugins_dir_cmd="--plugin-dir=${BASEDIR}/lib/mysql/plugin/"
|
||||
fi
|
||||
|
||||
init_file="/tmp/PORT/mysql-init"
|
||||
if [ -e $init_file ]; then
|
||||
$BASEDIR/bin/mysqld --defaults-file=/tmp/PORT/my.sandbox.cnf -u root --init-file $init_file $plugins_dir_cmd $plugins_cmd $keyring_cmd &
|
||||
$BASEDIR/bin/mysqld --defaults-file=/tmp/PORT/my.sandbox.cnf -u root --init-file $init_file $plugins_cmd $plugins_dir_cmd $keyring_cmd &
|
||||
else
|
||||
$BASEDIR/bin/mysqld --defaults-file=/tmp/PORT/my.sandbox.cnf $plugins_dir_cmd $plugins_cmd $keyring_cmd > /dev/null 2>&1 &
|
||||
$BASEDIR/bin/mysqld --defaults-file=/tmp/PORT/my.sandbox.cnf $plugins_cmd $plugins_dir_cmd $keyring_cmd > /dev/null 2>&1 &
|
||||
fi
|
||||
cd $PWD
|
||||
|
||||
|
@@ -8,8 +8,8 @@ SET @@GLOBAL.GTID_MODE = ON;
|
||||
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_port=12345, master_user='msandbox', master_password='msandbox', master_auto_position=1 FOR CHANNEL 'masterchan1';
|
||||
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_port=12346, master_user='msandbox', master_password='msandbox', master_auto_position=1 FOR CHANNEL 'masterchan2';
|
||||
-- CHANGE MASTER TO master_host='127.0.0.1', master_port=12346, master_user='msandbox', master_password='msandbox', master_auto_position=1 FOR CHANNEL 'masterchan2';
|
||||
|
||||
START SLAVE for channel 'masterchan1';
|
||||
START SLAVE for channel 'masterchan2';
|
||||
-- START SLAVE for channel 'masterchan2';
|
||||
|
||||
|
@@ -258,7 +258,7 @@ enable_tokudb=''
|
||||
|
||||
|
||||
if [ "$type" != "master" ] && [ "$type" != "slave" ] && [ "$type" != "master-master" ] && [ "$type" != "cluster" ] && [ "$type" != "channels" ]; then
|
||||
die "Invalid sandbox type: $type. Valid types are master, slave, master-master, cluster, and channels."
|
||||
die "Invalid sandbox type: $type. Valid types are master, slave, and master-master."
|
||||
fi
|
||||
|
||||
if [ $port -le 1024 ]; then
|
||||
|
@@ -18,8 +18,6 @@ endif
|
||||
|
||||
GO := go
|
||||
pkgs = $(shell find . -type d -name "pt-*" -exec basename {} \;)
|
||||
# VERSION ?=$(shell git describe --abbrev=0) doesn't always work here, need to use git log
|
||||
VERSION ?=$(shell git log --no-walk --tags --pretty="%H %d" --decorate=short | head -n1 | awk -F'[, ]' '{ print $$4; }')
|
||||
BUILD=$(BUILD_DATE)
|
||||
GOVERSION=$(shell go version | cut --delimiter=" " -f3)
|
||||
GOUTILSDIR ?= $(GOPATH)/bin
|
||||
|
@@ -122,7 +122,7 @@ Usage
|
||||
|
||||
``pt-k8s-debug-collector <flags>``
|
||||
|
||||
Supported Flags
|
||||
Supported Flags:
|
||||
================
|
||||
|
||||
``--resource``
|
||||
@@ -157,18 +157,12 @@ Path to kubeconfig. Default configuration be used if none specified
|
||||
|
||||
Port to use when collecting database-specific summaries. By default, 3306 will be used for PXC and MySQL, 27017 for MongoDB, and 5432 for PostgreSQL
|
||||
|
||||
``--version``
|
||||
|
||||
Print version info
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
- Installed, configured, and available in PATH ``kubectl``
|
||||
- Installed, configured, and available in PATH ``pt-mysql-summary`` for PXC and MySQL
|
||||
- Installed, configured, and available in PATH ``mysql`` for PXC and MySQL
|
||||
- Installed, configured, and available in PATH ``pt-mongodb-summary`` for MongoDB
|
||||
- Installed, configured, and available in PATH ``psql`` for PostgreSQL
|
||||
|
||||
Known Issues
|
||||
============
|
||||
@@ -184,4 +178,4 @@ On Kubernetes 1.21 - 1.24 warning is printed:
|
||||
metadata:
|
||||
resourceVersion: ""
|
||||
|
||||
This warning is harmless and does not affect data collection. We will remove podsecuritypolicies once everyone upgrade to Kubernetes 1.25 or newer. Before that we advise to ignore this warning.
|
||||
This warning is harmless and does not affect data collection. We will remove podsecuritypolicies once everyone upgrade to Kubernetes 1.25 or newer. Before that we advise to ignore this warning.
|
@@ -2,50 +2,26 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/percona/percona-toolkit/src/go/pt-k8s-debug-collector/dumper"
|
||||
)
|
||||
|
||||
const (
|
||||
TOOLNAME = "pt-k8s-debug-collector"
|
||||
)
|
||||
|
||||
// We do not set anything here, these variables are defined by the Makefile
|
||||
var (
|
||||
Build string //nolint
|
||||
GoVersion string //nolint
|
||||
Version string //nolint
|
||||
Commit string //nolint
|
||||
)
|
||||
|
||||
func main() {
|
||||
namespace := ""
|
||||
resource := ""
|
||||
clusterName := ""
|
||||
kubeconfig := ""
|
||||
forwardport := ""
|
||||
version := false
|
||||
|
||||
flag.StringVar(&namespace, "namespace", "", "Namespace for collecting data. If empty data will be collected from all namespaces")
|
||||
flag.StringVar(&resource, "resource", "none", "Collect data, specific to the resource. Supported values: pxc, psmdb, pg, ps, none")
|
||||
flag.StringVar(&clusterName, "cluster", "", "Cluster name")
|
||||
flag.StringVar(&kubeconfig, "kubeconfig", "", "Path to kubeconfig")
|
||||
flag.StringVar(&forwardport, "forwardport", "", "Port to use for port forwarding")
|
||||
flag.BoolVar(&version, "version", false, "Print version")
|
||||
flag.Parse()
|
||||
|
||||
if version {
|
||||
fmt.Println(TOOLNAME)
|
||||
fmt.Printf("Version %s\n", Version)
|
||||
fmt.Printf("Build: %s using %s\n", Build, GoVersion)
|
||||
fmt.Printf("Commit: %s\n", Commit)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if len(clusterName) > 0 {
|
||||
resource += "/" + clusterName
|
||||
}
|
||||
|
@@ -7,7 +7,6 @@ import (
|
||||
"path"
|
||||
"strings"
|
||||
"testing"
|
||||
"regexp"
|
||||
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
@@ -23,7 +22,7 @@ This test requires:
|
||||
|
||||
You can additionally set option FORWARDPORT if you want to use custom port when testing summaries.
|
||||
|
||||
pt-mysql-summary, mysql, psql, and pt-mongodb-summary must be in the PATH.
|
||||
pt-mysql-summary and pt-mongodb-summary must be in the PATH.
|
||||
|
||||
Since running pt-k8s-debug-collector may take long time run go test with increase timeout:
|
||||
go test -timeout 6000s
|
||||
@@ -159,18 +158,3 @@ func TestResourceOption(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Option --version
|
||||
*/
|
||||
func TestVersionOption(t *testing.T) {
|
||||
out, err := exec.Command("../../../bin/pt-k8s-debug-collector", "--version").Output()
|
||||
if err != nil {
|
||||
t.Errorf("error executing pt-k8s-debug-collector --version: %s", err.Error())
|
||||
}
|
||||
// We are using MustCompile here, because hard-coded RE should not fail
|
||||
re := regexp.MustCompile(TOOLNAME + `\n.*Version \d+\.\d+\.\d+\n`)
|
||||
if !re.Match(out) {
|
||||
t.Errorf("pt-k8s-debug-collector --version returns wrong result:\n%s", out)
|
||||
}
|
||||
}
|
||||
|
@@ -45,12 +45,11 @@ const (
|
||||
TOOLNAME = "pt-mongodb-index-check"
|
||||
)
|
||||
|
||||
// We do not set anything here, these variables are defined by the Makefile
|
||||
var (
|
||||
Build string //nolint
|
||||
GoVersion string //nolint
|
||||
Version string //nolint
|
||||
Commit string //nolint
|
||||
Build string = "2020-04-23" //nolint
|
||||
GoVersion string = "1.14.1" //nolint
|
||||
Version string = "3.5.1" //nolint
|
||||
Commit string //nolint
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -38,12 +38,11 @@ const (
|
||||
DEFAULT_SKIPCOLLECTIONS = "system.profile" // comma separated list
|
||||
)
|
||||
|
||||
// We do not set anything here, these variables are defined by the Makefile
|
||||
var (
|
||||
Build string //nolint
|
||||
GoVersion string //nolint
|
||||
Version string //nolint
|
||||
Commit string //nolint
|
||||
Build string = "2020-04-23" //nolint
|
||||
GoVersion string = "1.14.1" //nolint
|
||||
Version string = "3.5.1" //nolint
|
||||
Commit string //nolint
|
||||
)
|
||||
|
||||
type cliOptions struct {
|
||||
|
@@ -55,11 +55,10 @@ const (
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var (
|
||||
// We do not set anything here, these variables are defined by the Makefile
|
||||
Build string //nolint
|
||||
GoVersion string //nolint
|
||||
Version string //nolint
|
||||
Commit string //nolint
|
||||
Build string = "2020-04-23"
|
||||
GoVersion string = "1.14.1"
|
||||
Version string = "3.5.1"
|
||||
Commit string
|
||||
|
||||
defaultConnectionTimeout = 3 * time.Second
|
||||
directConnection = true
|
||||
|
@@ -17,12 +17,11 @@ import (
|
||||
"github.com/percona/percona-toolkit/src/go/pt-pg-summary/templates"
|
||||
)
|
||||
|
||||
// We do not set anything here, these variables are defined by the Makefile
|
||||
var (
|
||||
Build string //nolint
|
||||
GoVersion string //nolint
|
||||
Version string //nolint
|
||||
Commit string //nolint
|
||||
Build string = "2020-04-23" //nolint
|
||||
Commit string //nolint
|
||||
GoVersion string = "1.14.1" //nolint
|
||||
Version string = "3.5.1" //nolint
|
||||
)
|
||||
|
||||
type connOpts struct {
|
||||
|
@@ -1,7 +1,6 @@
|
||||
GO := go
|
||||
pkgs = $(shell basename `git rev-parse --show-toplevel`)
|
||||
# VERSION ?=$(shell git describe --abbrev=0) doesn't always work here, need to use git log
|
||||
VERSION ?=$(shell git log --no-walk --tags --pretty="%H %d" --decorate=short | head -n1 | awk -F'[, ]' '{ print $$4; }')
|
||||
VERSION ?=$(shell git describe --abbrev=0)
|
||||
BUILD ?=$(shell date +%FT%T%z)
|
||||
GOVERSION ?=$(shell go version | cut --delimiter=" " -f3)
|
||||
COMMIT ?=$(shell git rev-parse HEAD)
|
||||
|
@@ -84,11 +84,10 @@ var (
|
||||
"pt-mysql-summary --host=$mysql-host --port=$mysql-port --user=$mysql-user --password=$mysql-pass",
|
||||
}
|
||||
|
||||
// We do not set anything here, these variables are defined by the Makefile
|
||||
Build string //nolint
|
||||
GoVersion string //nolint
|
||||
Version string //nolint
|
||||
Commit string //nolint
|
||||
Build string = "2020-04-23" //nolint
|
||||
GoVersion string = "1.14.1" //nolint
|
||||
Version string = "3.5.1" //nolint
|
||||
Commit string //nolint
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -128,9 +128,9 @@ is(
|
||||
),
|
||||
q{`film_id`, `title`, CRC32(`description`), `release_year`, `language_id`, `original_language_id`,}
|
||||
.q{ `rental_duration`, `rental_rate`, `length`, `replacement_cost`, `rating`, `special_features`,}
|
||||
.q{ UNIX_TIMESTAMP(`last_update`) AS `last_update`, SHA1(CONCAT_WS('#', `film_id`, convert(`title` using utf8mb4),}
|
||||
.q{ UNIX_TIMESTAMP(`last_update`) AS `last_update`, SHA1(CONCAT_WS('#', `film_id`, `title`,}
|
||||
.q{ CRC32(`description`), `release_year`, `language_id`, `original_language_id`, `rental_duration`,}
|
||||
.q{ `rental_rate`, `length`, `replacement_cost`, convert(`rating` using utf8mb4), convert(`special_features` using utf8mb4), }
|
||||
.q{ `rental_rate`, `length`, `replacement_cost`, `rating`, `special_features`, }
|
||||
.q{UNIX_TIMESTAMP(`last_update`), CONCAT(ISNULL(`description`), ISNULL(`release_year`), }
|
||||
.q{ISNULL(`original_language_id`), ISNULL(`length`), ISNULL(`rating`), ISNULL(`special_features`))))},
|
||||
'SHA1 query for sakila.film',
|
||||
@@ -180,7 +180,7 @@ is(
|
||||
tbl => $tbl,
|
||||
func => 'SHA1',
|
||||
),
|
||||
q{`film_id`, `title`, SHA1(CONCAT_WS('%', `film_id`, convert(`title` using utf8mb4)))},
|
||||
q{`film_id`, `title`, SHA1(CONCAT_WS('%', `film_id`, `title`))},
|
||||
'Separator',
|
||||
);
|
||||
|
||||
@@ -191,7 +191,7 @@ is(
|
||||
tbl => $tbl,
|
||||
func => 'SHA1',
|
||||
),
|
||||
q{`film_id`, `title`, SHA1(CONCAT_WS('%', `film_id`, convert(`title` using utf8mb4)))},
|
||||
q{`film_id`, `title`, SHA1(CONCAT_WS('%', `film_id`, `title`))},
|
||||
'Bad separator',
|
||||
);
|
||||
|
||||
@@ -204,7 +204,7 @@ is(
|
||||
cols => [qw(film_id title)],
|
||||
sep => "'''",
|
||||
),
|
||||
q{`film_id`, `title`, SHA1(CONCAT_WS('#', `film_id`, convert(`title` using utf8mb4)))},
|
||||
q{`film_id`, `title`, SHA1(CONCAT_WS('#', `film_id`, `title`))},
|
||||
'Really bad separator',
|
||||
);
|
||||
|
||||
|
@@ -229,9 +229,9 @@ is (
|
||||
function => 'SHA1',
|
||||
tbl_struct => $t,
|
||||
),
|
||||
q{`film_id`, `title`, CRC32(`description`) AS `description`, `release_year`, `language_id`, `original_language_id`, `rental_duration`, `rental_rate`, `length`, `replacement_cost`, `rating`, `special_features`, `last_update` + 0 AS `last_update`, }
|
||||
q{`film_id`, `title`, `description`, `release_year`, `language_id`, `original_language_id`, `rental_duration`, `rental_rate`, `length`, `replacement_cost`, `rating`, `special_features`, `last_update` + 0 AS `last_update`, }
|
||||
. q{SHA1(CONCAT_WS('#', }
|
||||
. q{`film_id`, `title`, CRC32(`description`), `release_year`, `language_id`, }
|
||||
. q{`film_id`, `title`, `description`, `release_year`, `language_id`, }
|
||||
. q{`original_language_id`, `rental_duration`, `rental_rate`, `length`, }
|
||||
. q{`replacement_cost`, `rating`, `special_features`, `last_update` + 0, }
|
||||
. q{CONCAT(ISNULL(`description`), ISNULL(`release_year`), }
|
||||
@@ -245,9 +245,9 @@ is (
|
||||
function => 'FNV_64',
|
||||
tbl_struct => $t,
|
||||
),
|
||||
q{`film_id`, `title`, CRC32(`description`) AS `description`, `release_year`, `language_id`, `original_language_id`, `rental_duration`, `rental_rate`, `length`, `replacement_cost`, `rating`, `special_features`, `last_update` + 0 AS `last_update`, }
|
||||
q{`film_id`, `title`, `description`, `release_year`, `language_id`, `original_language_id`, `rental_duration`, `rental_rate`, `length`, `replacement_cost`, `rating`, `special_features`, `last_update` + 0 AS `last_update`, }
|
||||
. q{FNV_64(}
|
||||
. q{`film_id`, `title`, CRC32(`description`), `release_year`, `language_id`, }
|
||||
. q{`film_id`, `title`, `description`, `release_year`, `language_id`, }
|
||||
. q{`original_language_id`, `rental_duration`, `rental_rate`, `length`, }
|
||||
. q{`replacement_cost`, `rating`, `special_features`, `last_update` + 0)},
|
||||
'FNV_64 query for sakila.film',
|
||||
@@ -490,7 +490,7 @@ is (
|
||||
q{SELECT /*PROGRESS_COMMENT*//*CHUNK_NUM*/ COUNT(*) AS cnt, }
|
||||
. q{COALESCE(RIGHT(MAX(@crc := CONCAT(LPAD(@cnt := @cnt + 1, 16, '0'), }
|
||||
. q{SHA1(CONCAT(@crc, SHA1(CONCAT_WS('#', }
|
||||
. q{`film_id`, `title`, CRC32(`description`), `release_year`, `language_id`, }
|
||||
. q{`film_id`, `title`, `description`, `release_year`, `language_id`, }
|
||||
. q{`original_language_id`, `rental_duration`, `rental_rate`, `length`, }
|
||||
. q{`replacement_cost`, `rating`, `special_features`, `last_update` + 0, }
|
||||
. q{CONCAT(ISNULL(`description`), ISNULL(`release_year`), }
|
||||
@@ -514,7 +514,7 @@ is (
|
||||
q{SELECT /*PROGRESS_COMMENT*//*CHUNK_NUM*/ COUNT(*) AS cnt, }
|
||||
. q{COALESCE(RIGHT(MAX(@crc := CONCAT(LPAD(@cnt := @cnt + 1, 16, '0'), }
|
||||
. q{CONV(CAST(FNV_64(CONCAT(@crc, FNV_64(}
|
||||
. q{`film_id`, `title`, CRC32(`description`), `release_year`, `language_id`, }
|
||||
. q{`film_id`, `title`, `description`, `release_year`, `language_id`, }
|
||||
. q{`original_language_id`, `rental_duration`, `rental_rate`, `length`, }
|
||||
. q{`replacement_cost`, `rating`, `special_features`, `last_update` + 0}
|
||||
. q{))) AS UNSIGNED), 10, 16))), 16), 0) AS crc }
|
||||
@@ -559,7 +559,7 @@ is (
|
||||
. q{SELECT ?, ?, /*CHUNK_NUM*/ ?, COUNT(*) AS cnt, }
|
||||
. q{COALESCE(RIGHT(MAX(@crc := CONCAT(LPAD(@cnt := @cnt + 1, 16, '0'), }
|
||||
. q{SHA1(CONCAT(@crc, SHA1(CONCAT_WS('#', }
|
||||
. q{`film_id`, `title`, CRC32(`description`), `release_year`, `language_id`, }
|
||||
. q{`film_id`, `title`, `description`, `release_year`, `language_id`, }
|
||||
. q{`original_language_id`, `rental_duration`, `rental_rate`, `length`, }
|
||||
. q{`replacement_cost`, `rating`, `special_features`, `last_update` + 0, }
|
||||
. q{CONCAT(ISNULL(`description`), ISNULL(`release_year`), }
|
||||
|
@@ -419,7 +419,7 @@ is_deeply(
|
||||
. '= ? AND (? IS NULL OR `customer_id` >= ?)))',
|
||||
'>' => '((`rental_date` > ?) OR (`rental_date` = ? AND `inventory_id` > ?) OR '
|
||||
. '(`rental_date` = ? AND `inventory_id` = ? AND ((? IS NULL AND `customer_id` IS NOT NULL) '
|
||||
. 'OR (`customer_id` > ?))))',
|
||||
. 'OR (`customer_id` > ?)))',
|
||||
# '((`rental_date` > ?) OR (`rental_date` = ? AND '
|
||||
#. '`inventory_id` > ?) OR (`rental_date` = ? AND `inventory_id` '
|
||||
# . '= ? AND ((? IS NULL AND `customer_id` IS NOT NULL) '
|
||||
@@ -469,7 +469,7 @@ is_deeply(
|
||||
index => 'rental_date',
|
||||
where => '((`rental_date` > ?) OR (`rental_date` = ? AND `inventory_id` > ?) OR '
|
||||
. '(`rental_date` = ? AND `inventory_id` = ? AND ((? IS NULL AND `customer_id` IS NOT NULL) '
|
||||
. 'OR (`customer_id` > ?))))',
|
||||
. 'OR (`customer_id` > ?)))',
|
||||
# '((`rental_date` > ?) OR (`rental_date` = ? AND `inventory_id` > ?)'
|
||||
#. ' OR (`rental_date` = ? AND `inventory_id` = ? AND '
|
||||
#. '((? IS NULL AND `customer_id` IS NOT NULL) OR (`customer_id` > ?))))',
|
||||
@@ -481,7 +481,7 @@ is_deeply(
|
||||
. '= ? AND (? IS NULL OR `customer_id` >= ?)))',
|
||||
'>' => '((`rental_date` > ?) OR (`rental_date` = ? AND `inventory_id` > ?) OR '
|
||||
. '(`rental_date` = ? AND `inventory_id` = ? AND ((? IS NULL AND `customer_id` IS NOT NULL) OR '
|
||||
. '(`customer_id` > ?))))',
|
||||
. '(`customer_id` > ?)))',
|
||||
# '((`rental_date` > ?) OR (`rental_date` = ? AND '
|
||||
#. '`inventory_id` > ?) OR (`rental_date` = ? AND `inventory_id` '
|
||||
#. '= ? AND ((? IS NULL AND `customer_id` IS NOT NULL) '
|
||||
@@ -517,7 +517,7 @@ is_deeply(
|
||||
return_date staff_id last_update)],
|
||||
index => 'rental_date',
|
||||
where => '((`rental_date` > ?) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NOT NULL)'
|
||||
. ' OR (`inventory_id` > ?))) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. ' OR (`inventory_id` > ?)) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` = ?)) AND `customer_id` >= ?))',
|
||||
# '((`rental_date` > ?) OR '
|
||||
#. '(`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NOT NULL) OR (`inventory_id` > ?)))'
|
||||
@@ -528,14 +528,14 @@ is_deeply(
|
||||
rental_date inventory_id inventory_id customer_id)],
|
||||
boundaries => {
|
||||
'>=' => '((`rental_date` > ?) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NOT NULL) OR '
|
||||
. '(`inventory_id` > ?))) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` > ?)) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` = ?)) AND `customer_id` >= ?))',
|
||||
# '((`rental_date` > ?) OR (`rental_date` = ? AND '
|
||||
#. '((? IS NULL AND `inventory_id` IS NOT NULL) OR (`inventory_id` '
|
||||
#. '> ?))) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` '
|
||||
#. 'IS NULL) OR (`inventory_id` = ?)) AND `customer_id` >= ?))',
|
||||
'>' => '((`rental_date` > ?) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NOT NULL) OR '
|
||||
. '(`inventory_id` > ?))) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` > ?)) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` = ?)) AND `customer_id` > ?))',
|
||||
# '((`rental_date` > ?) OR (`rental_date` = ? AND ((? IS NULL '
|
||||
#. 'AND `inventory_id` IS NOT NULL) OR (`inventory_id` > ?))) OR '
|
||||
@@ -572,7 +572,7 @@ is_deeply(
|
||||
return_date staff_id last_update)],
|
||||
index => 'rental_date',
|
||||
where => '((`rental_date` > ?) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NOT NULL) OR '
|
||||
. '(`inventory_id` > ?))) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` > ?)) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` = ?)) AND `customer_id` > ?))',
|
||||
# '((`rental_date` > ?) OR '
|
||||
#. '(`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NOT NULL) OR (`inventory_id` > ?)))'
|
||||
@@ -583,14 +583,14 @@ is_deeply(
|
||||
rental_date inventory_id inventory_id customer_id)],
|
||||
boundaries => {
|
||||
'>=' => '((`rental_date` > ?) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NOT NULL) OR '
|
||||
. '(`inventory_id` > ?))) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` > ?)) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` = ?)) AND `customer_id` >= ?))',
|
||||
# '((`rental_date` > ?) OR (`rental_date` = ? AND '
|
||||
#. '((? IS NULL AND `inventory_id` IS NOT NULL) OR (`inventory_id` '
|
||||
#. '> ?))) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` '
|
||||
#. 'IS NULL) OR (`inventory_id` = ?)) AND `customer_id` >= ?))',
|
||||
'>' => '((`rental_date` > ?) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NOT NULL) OR '
|
||||
. '(`inventory_id` > ?))) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` > ?)) OR (`rental_date` = ? AND ((? IS NULL AND `inventory_id` IS NULL) OR '
|
||||
. '(`inventory_id` = ?)) AND `customer_id` > ?))',
|
||||
# '((`rental_date` > ?) OR (`rental_date` = ? AND ((? IS NULL '
|
||||
#. 'AND `inventory_id` IS NOT NULL) OR (`inventory_id` > ?))) OR '
|
||||
|
@@ -28,18 +28,6 @@ my $tp = new TableParser(Quoter=>$q);
|
||||
my $tbl;
|
||||
my $sample = "t/lib/samples/tables/";
|
||||
|
||||
my $transform_int = undef;
|
||||
# In version 8.0 integer display width is deprecated and not shown in the outputs.
|
||||
# So we need to transform our samples.
|
||||
if ($sandbox_version ge '8.0') {
|
||||
$transform_int = sub {
|
||||
my $txt = slurp_file(shift);
|
||||
$txt =~ s/int\(\d{1,2}\)/int/g;
|
||||
$txt =~ s/utf8/utf8mb3/g;
|
||||
print $txt;
|
||||
};
|
||||
}
|
||||
|
||||
SKIP: {
|
||||
skip "Cannot connect to sandbox master", 2 unless $dbh;
|
||||
skip 'Sandbox master does not have the sakila database', 2
|
||||
@@ -56,14 +44,12 @@ SKIP: {
|
||||
$ddl = $tp->ansi_to_legacy($ddl);
|
||||
$ddl = "$ddl ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8";
|
||||
}
|
||||
|
||||
ok(
|
||||
no_diff(
|
||||
"$ddl\n",
|
||||
$sandbox_version ge '5.1' ? "$sample/sakila.actor"
|
||||
: "$sample/sakila.actor-5.0",
|
||||
cmd_output => 1,
|
||||
transform_sample => $transform_int
|
||||
),
|
||||
"get_create_table(sakila.actor)"
|
||||
);
|
||||
|
@@ -227,9 +227,9 @@ This tool requires Bash v3 or newer.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
|
||||
For a list of known bugs, see L<http://www.percona.com/bugs/pt-stalk>.
|
||||
|
||||
Please report bugs at L<https://jira.percona.com/projects/PT>.
|
||||
Please report bugs at L<https://bugs.launchpad.net/percona-toolkit>.
|
||||
Include the following information in your bug report:
|
||||
|
||||
=over
|
||||
|
@@ -28,7 +28,7 @@ elsif ( !$slave_dbh ) {
|
||||
} elsif ($sandbox_version lt '5.7') {
|
||||
plan skip_all => 'Only on MySQL 5.7+';
|
||||
} else {
|
||||
plan tests => 5;
|
||||
plan tests => 4;
|
||||
}
|
||||
|
||||
my ($master1_dbh, $master1_dsn) = $sb->start_sandbox(
|
||||
@@ -76,19 +76,10 @@ $output = output(
|
||||
sub { $exit_status = pt_archiver::main(@args) },
|
||||
stderr => 1,
|
||||
);
|
||||
diag("Exit status: $exit_status") if ($exit_status);
|
||||
diag($output);
|
||||
|
||||
isnt(
|
||||
is(
|
||||
$exit_status,
|
||||
0,
|
||||
'Must specify a channel name',
|
||||
);
|
||||
|
||||
like (
|
||||
$output,
|
||||
qr/"channel" was not specified/,
|
||||
'Message saying channel name must be specified'
|
||||
'No need of channel name since there is only one master',
|
||||
);
|
||||
|
||||
push @args, ('--channel', 'masterchan1');
|
||||
|
@@ -103,13 +103,9 @@ for my $char ( "\N{KATAKANA LETTER NI}", "\N{U+DF}" ) {
|
||||
my $sql = qq{INSERT INTO `bug_1127450`.`original` VALUES (1, ?)};
|
||||
$utf8_dbh->prepare($sql)->execute($char);
|
||||
|
||||
# We need to have --no-check-charset here, because utf8 that we use in the test file
|
||||
# is alias of utf8mb3 in 5.7 and alias of utf8mb4 in 8.0.
|
||||
# We cannot set this character set explicitly due to Perl limitations.
|
||||
# Changing utf8 to utf8mb4 will break test on 5.7
|
||||
$output = output(
|
||||
sub { pt_archiver::main(qw(--no-ascend --limit 50 --bulk-insert),
|
||||
qw(--bulk-delete --where 1=1 --statistics --charset utf8 --no-check-charset),
|
||||
qw(--bulk-delete --where 1=1 --statistics --charset utf8),
|
||||
'--source', "L=1,D=bug_1127450,t=original,F=$cnf",
|
||||
'--dest', "t=copy") }, stderr => 1
|
||||
);
|
||||
@@ -139,32 +135,6 @@ for my $char ( "\N{KATAKANA LETTER NI}", "\N{U+DF}" ) {
|
||||
"Warns about the UTF-8 bug in DBD::mysql::VERSION lt '4', quiet otherwise"
|
||||
);
|
||||
}
|
||||
|
||||
# #############################################################################
|
||||
# PT-2123: pt-archiver gives error "Wide character in print at
|
||||
# /usr/bin/pt-archiver line 6815" when using --bulk-insert
|
||||
# #############################################################################
|
||||
$sb->load_file('master', 't/pt-archiver/samples/pt-2123.sql');
|
||||
|
||||
$dbh->do('set names "utf8mb4"');
|
||||
my $original_rows = $dbh->selectall_arrayref('select col2 from pt_2123.t1 where col1=5');
|
||||
|
||||
$output = output(
|
||||
sub { pt_archiver::main(
|
||||
'--source', 'L=1,h=127.1,P=12345,D=pt_2123,t=t1,u=msandbox,p=msandbox,A=utf8mb4',
|
||||
'--dest', 'L=1,h=127.1,P=12345,D=pt_2123,t=t2,u=msandbox,p=msandbox,A=utf8mb4',
|
||||
qw(--where col1=5 --bulk-insert --limit=100 --purge))
|
||||
},
|
||||
);
|
||||
|
||||
my $archived_rows = $dbh->selectall_arrayref('select col2 from pt_2123.t2');
|
||||
|
||||
is_deeply(
|
||||
$original_rows,
|
||||
$archived_rows,
|
||||
"UTF8 characters copied successfully with --bulk-insert"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
@@ -23,15 +23,11 @@ my $dbh = $sb->get_dbh_for('master');
|
||||
if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
}
|
||||
elsif ($sandbox_version gt '5.7') {
|
||||
plan tests => 4;
|
||||
}
|
||||
else {
|
||||
plan tests => 5;
|
||||
}
|
||||
|
||||
my $output;
|
||||
my $archived_rows;
|
||||
|
||||
# #############################################################################
|
||||
# Issue 1152: mk-archiver columns option resulting in null archived table data
|
||||
@@ -61,6 +57,7 @@ SKIP: {
|
||||
"--check-charset"
|
||||
);
|
||||
|
||||
}
|
||||
$output = output(
|
||||
sub { pt_archiver::main(
|
||||
'--source', 'h=127.1,P=12345,D=issue_1225,t=t,u=msandbox,p=msandbox',
|
||||
@@ -69,13 +66,12 @@ $output = output(
|
||||
},
|
||||
);
|
||||
|
||||
$archived_rows = $dbh->selectall_arrayref('select c from issue_1225.a limit 2');
|
||||
my $archived_rows = $dbh->selectall_arrayref('select c from issue_1225.a limit 2');
|
||||
|
||||
ok(
|
||||
$original_rows->[0]->[0] ne $archived_rows->[0]->[0],
|
||||
"UTF8 characters lost when cxn isn't also UTF8"
|
||||
);
|
||||
}
|
||||
|
||||
$sb->load_file('master', 't/pt-archiver/samples/issue_1225.sql');
|
||||
|
||||
@@ -83,7 +79,7 @@ $output = output(
|
||||
sub { pt_archiver::main(
|
||||
'--source', 'h=127.1,P=12345,D=issue_1225,t=t,u=msandbox,p=msandbox',
|
||||
'--dest', 't=a',
|
||||
qw(--no-check-charset --where 1=1 --purge -A utf8)) # -A utf8 makes it work
|
||||
qw(--where 1=1 --purge -A utf8)) # -A utf8 makes it work
|
||||
},
|
||||
);
|
||||
|
||||
|
@@ -33,7 +33,7 @@ elsif ( $DBD::mysql::VERSION lt '4' ) {
|
||||
my $output;
|
||||
my $rows;
|
||||
my $cnf = "/tmp/12345/my.sandbox.cnf";
|
||||
my $file = "/tmp/pt-archiver-file.txt";
|
||||
my $file = "/tmp/mk-archiver-file.txt";
|
||||
|
||||
# #############################################################################
|
||||
# Issue 1229: mk-archiver not creating UTF8 compatible file handles for
|
||||
@@ -53,15 +53,11 @@ is_deeply(
|
||||
|
||||
diag(`rm -rf $file >/dev/null`);
|
||||
|
||||
# We need to have --no-check-charset here, because utf8 that we use in the test file
|
||||
# is alias of utf8mb3 in 5.7 and alias of utf8mb4 in 8.0.
|
||||
# We cannot set this character set explicitly due to Perl limitations.
|
||||
# Changing utf8 to utf8mb4 will break test on 5.7
|
||||
$output = output(
|
||||
sub { pt_archiver::main(
|
||||
'--source', 'h=127.1,P=12345,D=issue_1225,t=t,u=msandbox,p=msandbox',
|
||||
'--file', $file,
|
||||
qw(--no-check-charset --where 1=1 -A UTF8)) # -A utf8 makes it work
|
||||
qw(--where 1=1 -A UTF8)) # -A utf8 makes it work
|
||||
},
|
||||
stderr => 1,
|
||||
);
|
||||
|
109
t/pt-archiver/pt-1898.t
Normal file
@@ -0,0 +1,109 @@
|
||||
#!/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 English qw(-no_match_vars);
|
||||
use Test::More;
|
||||
|
||||
use Data::Dumper;
|
||||
use PerconaTest;
|
||||
use Sandbox;
|
||||
use SqlModes;
|
||||
use File::Temp qw/ tempdir tempfile /;
|
||||
|
||||
if ($ENV{PERCONA_SLOW_BOX}) {
|
||||
plan skip_all => 'This test needs a fast machine';
|
||||
} else {
|
||||
plan tests => 6;
|
||||
#plan skip_all => 'This test is taking too much time even in fast machines';
|
||||
}
|
||||
|
||||
our $delay = 15;
|
||||
|
||||
my $tmp_file = File::Temp->new();
|
||||
my $tmp_file_name = $tmp_file->filename;
|
||||
unlink $tmp_file_name;
|
||||
|
||||
require "$trunk/bin/pt-archiver";
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $master_dbh = $sb->get_dbh_for('master');
|
||||
my $slave_dbh = $sb->get_dbh_for('slave1');
|
||||
my $master_dsn = 'h=127.0.0.1,P=12345,u=msandbox,p=msandbox';
|
||||
my $slave_dsn = 'h=127.0.0.1,P=12346,u=msandbox,p=msandbox';
|
||||
|
||||
sub reset_query_cache {
|
||||
my @dbhs = @_;
|
||||
return if ($sandbox_version >= '8.0');
|
||||
foreach my $dbh (@dbhs) {
|
||||
$dbh->do('RESET QUERY CACHE');
|
||||
}
|
||||
}
|
||||
|
||||
# 1) Set the slave delay to 0 just in case we are re-running the tests without restarting the sandbox.
|
||||
# 2) Load sample data
|
||||
# 3) Set the slave delay to 30 seconds to be able to see the 'waiting' message.
|
||||
diag("Setting slave delay to 0 seconds");
|
||||
$slave_dbh->do('STOP SLAVE');
|
||||
$slave_dbh->do('RESET SLAVE');
|
||||
$slave_dbh->do('START SLAVE');
|
||||
|
||||
diag('Loading test data');
|
||||
$sb->load_file('master', "t/pt-online-schema-change/samples/pt-1898.sql");
|
||||
|
||||
my $num_rows = 5000;
|
||||
diag("Loading $num_rows into the table. This might take some time.");
|
||||
diag(`util/mysql_random_data_load --host=127.0.0.1 --port=12345 --user=msandbox --password=msandbox test pt178 $num_rows`);
|
||||
|
||||
diag("Setting slave delay to $delay seconds");
|
||||
|
||||
$slave_dbh->do('STOP SLAVE');
|
||||
$slave_dbh->do("CHANGE MASTER TO MASTER_DELAY=$delay");
|
||||
$slave_dbh->do('START SLAVE');
|
||||
|
||||
# Run a full table scan query to ensure the slave is behind the master
|
||||
# There is no query cache in MySQL 8.0+
|
||||
reset_query_cache($master_dbh, $master_dbh);
|
||||
$master_dbh->do('UPDATE `test`.`joinit` SET g = g + 1 WHERE g <> 0');
|
||||
|
||||
# This is the base test, ust to ensure that without using --check-slave-lag nor --skip-check-slave-lag
|
||||
# pt-online-schema-change will wait on the slave at port 12346
|
||||
|
||||
my $max_lag = $delay / 2;
|
||||
my @args = ("--source", "$master_dsn,D=test,t=joinit", "--purge", "--where", "'g < 45'",
|
||||
"--commit-each", "--limit", "500", "--statistics", "--check-slave-lag", "h=127.0.0.1,P=12346,u=msandbox,p=msandbox",
|
||||
"--max-lag", "1");
|
||||
diag("Starting base test. This is going to take some time due to the delay in the slave");
|
||||
diag("pid: $tmp_file_name");
|
||||
my $argstr = join(@args, " ");
|
||||
my $output = `$trunk/bin/pt-online-schema-change $argstr 2>&1`;
|
||||
|
||||
like(
|
||||
$output,
|
||||
qr/Replica lag is \d+ seconds on .* Waiting/s,
|
||||
"Base test waits on the correct slave",
|
||||
);
|
||||
|
||||
|
||||
diag("Setting slave delay to 0 seconds");
|
||||
$slave_dbh->do('STOP SLAVE');
|
||||
$slave_dbh->do('RESET SLAVE');
|
||||
$slave_dbh->do('START SLAVE');
|
||||
|
||||
$master_dbh->do("DROP DATABASE IF EXISTS test");
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
$sb->wipe_clean($master_dbh);
|
||||
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||
done_testing;
|
@@ -1,286 +0,0 @@
|
||||
#!/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 PerconaTest;
|
||||
use Sandbox;
|
||||
require "$trunk/bin/pt-archiver";
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $dbh = $sb->get_dbh_for('master');
|
||||
|
||||
if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
}
|
||||
else {
|
||||
plan tests => 23;
|
||||
}
|
||||
|
||||
my $output;
|
||||
|
||||
# #############################################################################
|
||||
# PT-2114: Incorrect casting of BIT columns by pt-archiver
|
||||
# #############################################################################
|
||||
$sb->load_file('master', 't/pt-archiver/samples/pt-2114.sql');
|
||||
|
||||
my $zero_rows = $dbh->selectall_arrayref('select id, hex(val) from pt_2114.t1 where val = 0');
|
||||
my $exit_status;
|
||||
|
||||
$output = output(
|
||||
sub { $exit_status = pt_archiver::main(
|
||||
'--source', 'h=127.1,P=12345,D=pt_2114,t=t1,u=msandbox,p=msandbox,A=utf8mb4',
|
||||
'--where', '(val) in (select a.val from pt_2114.t1_tmp a where id =2)',
|
||||
'--purge')
|
||||
},
|
||||
);
|
||||
|
||||
is (
|
||||
$exit_status,
|
||||
0,
|
||||
"PT-2114 exit status OK",
|
||||
);
|
||||
|
||||
my $left_rows = $dbh->selectall_arrayref('select id, hex(val) from pt_2114.t1');
|
||||
|
||||
is_deeply(
|
||||
$zero_rows,
|
||||
$left_rows,
|
||||
"PT-2114 Only rows with val=0 left in the table"
|
||||
);
|
||||
|
||||
my $count_rows = $dbh->selectrow_arrayref('select count(*) from pt_2114.t1');
|
||||
|
||||
is (
|
||||
@{$count_rows}[0],
|
||||
4,
|
||||
"PT-2114 Four rows left in the table"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Reloading dump to perform archiving
|
||||
# #############################################################################
|
||||
$sb->load_file('master', 't/pt-archiver/samples/pt-2114.sql');
|
||||
|
||||
my $one_rows = $dbh->selectall_arrayref('select id, hex(val) from pt_2114.t1 where val = 1');
|
||||
|
||||
$output = output(
|
||||
sub { $exit_status = pt_archiver::main(
|
||||
'--source', 'h=127.1,P=12345,D=pt_2114,t=t1,u=msandbox,p=msandbox,A=utf8mb4',
|
||||
'--dest', 'h=127.1,P=12345,D=pt_2114,t=t2,u=msandbox,p=msandbox,A=utf8mb4',
|
||||
'--where', '(val) in (select a.val from pt_2114.t1_tmp a where id =2)',
|
||||
)
|
||||
},
|
||||
);
|
||||
|
||||
is (
|
||||
$exit_status,
|
||||
0,
|
||||
"PT-2114 exit status OK",
|
||||
);
|
||||
|
||||
$left_rows = $dbh->selectall_arrayref('select id, hex(val) from pt_2114.t1');
|
||||
|
||||
is_deeply(
|
||||
$zero_rows,
|
||||
$left_rows,
|
||||
"PT-2114 Only rows with val=0 left in the table"
|
||||
);
|
||||
|
||||
$count_rows = $dbh->selectrow_arrayref('select count(*) from pt_2114.t1');
|
||||
|
||||
is (
|
||||
@{$count_rows}[0],
|
||||
4,
|
||||
"PT-2114 Four rows left in the table"
|
||||
);
|
||||
|
||||
my $archived_rows = $dbh->selectall_arrayref('select id, hex(val) from pt_2114.t2');
|
||||
|
||||
is_deeply(
|
||||
$one_rows,
|
||||
$archived_rows,
|
||||
"PT-2114 Correct rows archived"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Reloading dump to perform archiving
|
||||
# #############################################################################
|
||||
$sb->load_file('master', 't/pt-archiver/samples/pt-2114.sql');
|
||||
|
||||
$output = output(
|
||||
sub { $exit_status = pt_archiver::main(
|
||||
'--source', 'h=127.1,P=12345,D=pt_2114,t=t1,u=msandbox,p=msandbox,A=utf8mb4,L=yes',
|
||||
'--dest', 'h=127.1,P=12345,D=pt_2114,t=t2,u=msandbox,p=msandbox,A=utf8mb4,L=yes',
|
||||
'--where', '(val) in (select a.val from pt_2114.t1_tmp a where id =2)',
|
||||
'--bulk-insert', '--limit', '10')
|
||||
},
|
||||
);
|
||||
|
||||
is (
|
||||
$exit_status,
|
||||
0,
|
||||
"PT-2114 exit status OK",
|
||||
);
|
||||
|
||||
$left_rows = $dbh->selectall_arrayref('select id, hex(val) from pt_2114.t1');
|
||||
|
||||
is_deeply(
|
||||
$zero_rows,
|
||||
$left_rows,
|
||||
"PT-2114 Only rows with val=0 left in the table with --bulk-insert"
|
||||
);
|
||||
|
||||
$count_rows = $dbh->selectrow_arrayref('select count(*) from pt_2114.t1');
|
||||
|
||||
is (
|
||||
@{$count_rows}[0],
|
||||
4,
|
||||
"PT-2114 Four rows left in the table"
|
||||
);
|
||||
|
||||
$archived_rows = $dbh->selectall_arrayref('select id, hex(val) from pt_2114.t2');
|
||||
|
||||
is_deeply(
|
||||
$one_rows,
|
||||
$archived_rows,
|
||||
"PT-2114 Correct rows archived with --bulk-insert"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Reloading dump to perform archiving
|
||||
# #############################################################################
|
||||
$sb->load_file('master', 't/pt-archiver/samples/pt-2114.sql');
|
||||
|
||||
$output = output(
|
||||
sub { $exit_status = pt_archiver::main(
|
||||
'--source', 'h=127.1,P=12345,D=pt_2114,t=t1,u=msandbox,p=msandbox,A=utf8mb4,L=yes',
|
||||
'--where', '(val) in (select a.val from pt_2114.t1_tmp a where id =2)',
|
||||
'--bulk-delete', '--purge', '--limit', '10')
|
||||
},
|
||||
);
|
||||
|
||||
is (
|
||||
$exit_status,
|
||||
0,
|
||||
"PT-2114 exit status OK",
|
||||
);
|
||||
|
||||
$left_rows = $dbh->selectall_arrayref('select id, hex(val) from pt_2114.t1');
|
||||
|
||||
is_deeply(
|
||||
$zero_rows,
|
||||
$left_rows,
|
||||
"PT-2114 Only rows with val=0 left in the table with --bulk-delete"
|
||||
);
|
||||
|
||||
$count_rows = $dbh->selectrow_arrayref('select count(*) from pt_2114.t1');
|
||||
|
||||
is (
|
||||
@{$count_rows}[0],
|
||||
4,
|
||||
"PT-2114 Four rows left in the table"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Reloading dump to perform archiving
|
||||
# #############################################################################
|
||||
$sb->load_file('master', 't/pt-archiver/samples/pt-2114.sql');
|
||||
|
||||
# Archiving into a file
|
||||
$output = output(
|
||||
sub { $exit_status = pt_archiver::main(
|
||||
'--where', '(val) in (select a.val from pt_2114.t1_tmp a where id =2)',
|
||||
'--source', 'h=127.1,P=12345,D=pt_2114,t=t1,u=msandbox,p=msandbox,A=utf8mb4,L=yes',
|
||||
'--file', 'archive.%D.%t', '-c', 'id'
|
||||
)
|
||||
},
|
||||
);
|
||||
|
||||
is (
|
||||
$exit_status,
|
||||
0,
|
||||
"PT-2114 exit status OK",
|
||||
);
|
||||
|
||||
ok(-f 'archive.pt_2114.t1', 'PT-2114 Archive file written OK');
|
||||
|
||||
$output = `cat archive.pt_2114.t1`;
|
||||
is($output, <<EOF
|
||||
123
|
||||
125
|
||||
128
|
||||
130
|
||||
EOF
|
||||
, 'PT-2114 Correct rows archived into the file');
|
||||
`rm -f archive.pt_2114.t1`;
|
||||
|
||||
$left_rows = $dbh->selectall_arrayref('select id, hex(val) from pt_2114.t1');
|
||||
|
||||
is_deeply(
|
||||
$zero_rows,
|
||||
$left_rows,
|
||||
"PT-2114 Only rows with val=0 left in the table after archiving into the file"
|
||||
);
|
||||
|
||||
$count_rows = $dbh->selectrow_arrayref('select count(*) from pt_2114.t1');
|
||||
|
||||
is (
|
||||
@{$count_rows}[0],
|
||||
4,
|
||||
"PT-2114 Four rows left in the table"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Longer BIT values
|
||||
# Loading dump to perform archiving
|
||||
# #############################################################################
|
||||
$sb->load_file('master', 't/pt-archiver/samples/pt-2114-2.sql');
|
||||
my $not_archived_rows = $dbh->selectall_arrayref("select id, hex(val) from pt_2114.t1 where val = b'1111000010'");
|
||||
|
||||
$output = output(
|
||||
sub { $exit_status = pt_archiver::main(
|
||||
'--source', 'h=127.1,P=12345,D=pt_2114,t=t1,u=msandbox,p=msandbox,A=utf8mb4',
|
||||
'--where', '(val) in (select a.val from pt_2114.t1_tmp a where id =2)',
|
||||
'--purge')
|
||||
},
|
||||
);
|
||||
|
||||
is (
|
||||
$exit_status,
|
||||
0,
|
||||
"PT-2114 exit status OK",
|
||||
);
|
||||
|
||||
$left_rows = $dbh->selectall_arrayref('select id, hex(val) from pt_2114.t1');
|
||||
|
||||
is_deeply(
|
||||
$not_archived_rows,
|
||||
$left_rows,
|
||||
"PT-2114 Only rows with val=0 left in the table"
|
||||
);
|
||||
|
||||
$count_rows = $dbh->selectrow_arrayref('select count(*) from pt_2114.t1');
|
||||
|
||||
is (
|
||||
@{$count_rows}[0],
|
||||
4,
|
||||
"PT-2114 Four rows left in the table"
|
||||
);
|
||||
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
$sb->wipe_clean($dbh);
|
||||
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||
exit;
|
@@ -1,19 +0,0 @@
|
||||
DROP DATABASE IF EXISTS pt_2114;
|
||||
CREATE DATABASE pt_2114;
|
||||
USE pt_2114;
|
||||
CREATE TABLE `pt_2114`.`t1` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`val` bit(10) NOT NULL DEFAULT b'0',
|
||||
PRIMARY KEY (`id`,`val`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=122 DEFAULT CHARSET=utf8mb4;
|
||||
CREATE TABLE pt_2114.t1_tmp LIKE t1;
|
||||
INSERT INTO pt_2114.t1 (val) VALUES (b'1111000010'),(b'1101001100');
|
||||
INSERT INTO pt_2114.t1 (val) SELECT val FROM pt_2114.t1 ;
|
||||
INSERT INTO pt_2114.t1 (val) SELECT val FROM pt_2114.t1 ;
|
||||
INSERT INTO pt_2114.t1_tmp SELECT NULL, val FROM pt_2114.t1;
|
||||
|
||||
CREATE TABLE `pt_2114`.`t2` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`val` bit(1) NOT NULL DEFAULT b'0',
|
||||
PRIMARY KEY (`id`,`val`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
@@ -1,19 +0,0 @@
|
||||
DROP DATABASE IF EXISTS pt_2114;
|
||||
CREATE DATABASE pt_2114;
|
||||
USE pt_2114;
|
||||
CREATE TABLE `pt_2114`.`t1` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`val` bit(1) NOT NULL DEFAULT b'0',
|
||||
PRIMARY KEY (`id`,`val`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=122 DEFAULT CHARSET=utf8mb4;
|
||||
CREATE TABLE pt_2114.t1_tmp LIKE t1;
|
||||
INSERT INTO pt_2114.t1 (val) VALUES (0),(1);
|
||||
INSERT INTO pt_2114.t1 (val) SELECT val FROM pt_2114.t1 ;
|
||||
INSERT INTO pt_2114.t1 (val) SELECT val FROM pt_2114.t1 ;
|
||||
INSERT INTO pt_2114.t1_tmp SELECT NULL, val FROM pt_2114.t1;
|
||||
|
||||
CREATE TABLE `pt_2114`.`t2` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`val` bit(1) NOT NULL DEFAULT b'0',
|
||||
PRIMARY KEY (`id`,`val`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
@@ -1,20 +0,0 @@
|
||||
SET NAMES utf8mb4;
|
||||
DROP DATABASE IF EXISTS pt_2123;
|
||||
CREATE DATABASE pt_2123;
|
||||
|
||||
CREATE TABLE `pt_2123`.`t1` (
|
||||
`col1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`col2` varchar(3) DEFAULT NULL,
|
||||
PRIMARY KEY (`col1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `pt_2123`.`t2` (
|
||||
`col1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`col2` varchar(3) DEFAULT NULL,
|
||||
PRIMARY KEY (`col1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
insert into pt_2123.t1 (col2) values ('あ');
|
||||
insert into pt_2123.t1 (col2) values ('あ');
|
||||
insert into pt_2123.t1 (col2) values ('あ');
|
||||
insert into pt_2123.t1 (col2) values ('あ');
|
@@ -82,6 +82,8 @@ $sb->load_file('master', 't/pt-deadlock-logger/samples/deadlocks_tbl.sql', 'test
|
||||
|
||||
$output = `$trunk/bin/pt-deadlock-logger $dsn --dest D=test,t=deadlocks --daemonize --run-time 10 --interval 1 --pid $pid_file 1>/dev/null 2>/dev/null`;
|
||||
|
||||
#REMOVEME
|
||||
`echo "test 3" >>/tmp/REMOVEME`;
|
||||
PerconaTest::wait_for_files($pid_file);
|
||||
|
||||
$output = `ps x | grep 'pt-deadlock-logger $dsn' | grep -v grep`;
|
||||
@@ -91,6 +93,8 @@ like(
|
||||
'It lives daemonized'
|
||||
) or diag($output);
|
||||
|
||||
#REMOVEME
|
||||
`echo "test 4" >>/tmp/REMOVEME`;
|
||||
my ($pid) = $output =~ /(\d+)/;
|
||||
|
||||
ok(
|
||||
|
@@ -32,30 +32,11 @@ my @args = ('-F', $cnf, qw(-h 127.1));
|
||||
$sb->wipe_clean($dbh);
|
||||
$sb->create_dbs($dbh, ['test']);
|
||||
|
||||
my $transform_int = undef;
|
||||
# In version 8.0 integer display width is deprecated and not shown in the outputs.
|
||||
# So we need to transform our samples.
|
||||
if ($sandbox_version ge '8.0') {
|
||||
$transform_int = sub {
|
||||
my $txt = slurp_file(shift);
|
||||
$txt =~ s/int\(\d{1,2}\)/int/g;
|
||||
print $txt;
|
||||
};
|
||||
}
|
||||
|
||||
$output = `$cmd -d mysql -t columns_priv -v`;
|
||||
# In version 8.0 order of columns in the index changed
|
||||
if ($sandbox_version ge '8.0') {
|
||||
like($output,
|
||||
qr/PRIMARY \(`Host`,`User`,`Db`,`Table_name`,`Column_name`\)/,
|
||||
'Finds mysql.columns_priv PK'
|
||||
);
|
||||
} else {
|
||||
like($output,
|
||||
qr/PRIMARY \(`Host`,`Db`,`User`,`Table_name`,`Column_name`\)/,
|
||||
'Finds mysql.columns_priv PK'
|
||||
);
|
||||
}
|
||||
like($output,
|
||||
qr/PRIMARY \(`Host`,`Db`,`User`,`Table_name`,`Column_name`\)/,
|
||||
'Finds mysql.columns_priv PK'
|
||||
);
|
||||
|
||||
is(`$cmd -d test --nosummary`, '', 'No dupes on clean sandbox');
|
||||
|
||||
@@ -64,27 +45,21 @@ $sb->load_file('master', 't/lib/samples/dupe_key.sql', 'test');
|
||||
ok(
|
||||
no_diff(
|
||||
sub { pt_duplicate_key_checker::main(@args, qw(-d test)) },
|
||||
"$sample/basic_output.txt",
|
||||
transform_sample => $transform_int
|
||||
),
|
||||
'Default output',
|
||||
"$sample/basic_output.txt"),
|
||||
'Default output'
|
||||
);
|
||||
|
||||
ok(
|
||||
no_diff(
|
||||
sub { pt_duplicate_key_checker::main(@args, qw(-d test --nosql)) },
|
||||
"$sample/nosql_output.txt",
|
||||
transform_sample => $transform_int
|
||||
),
|
||||
"$sample/nosql_output.txt"),
|
||||
'--nosql'
|
||||
);
|
||||
|
||||
ok(
|
||||
no_diff(
|
||||
sub { pt_duplicate_key_checker::main(@args, qw(-d test --nosummary)) },
|
||||
"$sample/nosummary_output.txt",
|
||||
transform_sample => $transform_int
|
||||
),
|
||||
"$sample/nosummary_output.txt"),
|
||||
'--nosummary'
|
||||
);
|
||||
|
||||
@@ -94,8 +69,7 @@ ok(
|
||||
no_diff(
|
||||
sub { pt_duplicate_key_checker::main(@args, qw(-d test -t UPPER_TEST)) },
|
||||
($sandbox_version ge '5.1' ? "$sample/uppercase_names-51.txt"
|
||||
: "$sample/uppercase_names.txt"),
|
||||
transform_sample => $transform_int
|
||||
: "$sample/uppercase_names.txt")
|
||||
),
|
||||
'Issue 306 crash on uppercase column names'
|
||||
);
|
||||
@@ -123,10 +97,9 @@ $sb->load_file('master', 't/lib/samples/dupekeys/dupe-cluster-bug-894140.sql', '
|
||||
|
||||
ok(
|
||||
no_diff(
|
||||
sub { pt_duplicate_key_checker::main(@args, qw(-d test)) },
|
||||
sub { pt_duplicate_key_checker::main(@args, qw(-d test)) },
|
||||
"$sample/bug-894140.txt",
|
||||
sed => [ "-e 's/ */ /g'" ],
|
||||
transform_sample => $transform_int
|
||||
),
|
||||
"Bug 894140"
|
||||
);
|
||||
|
@@ -30,17 +30,6 @@ my @args = ('-F', $cnf, qw(-h 127.1));
|
||||
$sb->wipe_clean($dbh);
|
||||
$sb->create_dbs($dbh, ['test']);
|
||||
|
||||
my $transform_int = undef;
|
||||
# In version 8.0 integer display width is deprecated and not shown in the outputs.
|
||||
# So we need to transform our samples.
|
||||
if ($sandbox_version ge '8.0') {
|
||||
$transform_int = sub {
|
||||
my $txt = slurp_file(shift);
|
||||
$txt =~ s/int\(\d{1,2}\)/int/g;
|
||||
print $txt;
|
||||
};
|
||||
}
|
||||
|
||||
# #############################################################################
|
||||
# Issue 295: Enhance rules for clustered keys in mk-duplicate-key-checker
|
||||
# #############################################################################
|
||||
@@ -49,8 +38,7 @@ ok(
|
||||
no_diff(
|
||||
sub { pt_duplicate_key_checker::main(@args, qw(-d issue_295)) },
|
||||
($sandbox_version ge '5.1' ? "$sample/issue_295-51.txt"
|
||||
: "$sample/issue_295.txt"),
|
||||
transform_sample => $transform_int
|
||||
: "$sample/issue_295.txt")
|
||||
),
|
||||
"Shorten, not remove, clustered dupes"
|
||||
) or diag($test_diff);
|
||||
|
@@ -33,17 +33,6 @@ my $cmd = "$trunk/bin/pt-duplicate-key-checker -F $cnf -h 127.1";
|
||||
$sb->wipe_clean($dbh);
|
||||
$sb->create_dbs($dbh, ['issue_1192']);
|
||||
|
||||
my $transform_int = undef;
|
||||
# In version 8.0 integer display width is deprecated and not shown in the outputs.
|
||||
# So we need to transform our samples.
|
||||
if ($sandbox_version ge '8.0') {
|
||||
$transform_int = sub {
|
||||
my $txt = slurp_file(shift);
|
||||
$txt =~ s/int\(\d{1,2}\)/int/g;
|
||||
print $txt;
|
||||
};
|
||||
}
|
||||
|
||||
# #############################################################################
|
||||
# Issue 1192: DROP/ADD leaves structure unchanged
|
||||
# #############################################################################
|
||||
@@ -54,7 +43,6 @@ ok(
|
||||
"$cmd -d issue_1192 --no-summary",
|
||||
"t/pt-duplicate-key-checker/samples/issue_1192.txt",
|
||||
sed => ["'s/ (/ (/g'"],
|
||||
transform_sample => $transform_int
|
||||
),
|
||||
"Keys are sorted lc so left-prefix magic works (issue 1192)"
|
||||
);
|
||||
|
@@ -33,17 +33,6 @@ my @args = ('-F', $cnf, qw(-h 127.1));
|
||||
$sb->wipe_clean($dbh);
|
||||
$sb->create_dbs($dbh, ['test']);
|
||||
|
||||
my $transform_int = undef;
|
||||
# In version 8.0 integer display width is deprecated and not shown in the outputs.
|
||||
# So we need to transform our samples.
|
||||
if ($sandbox_version ge '8.0') {
|
||||
$transform_int = sub {
|
||||
my $txt = slurp_file(shift);
|
||||
$txt =~ s/int\(\d{1,2}\)/int/g;
|
||||
print $txt;
|
||||
};
|
||||
}
|
||||
|
||||
# #############################################################################
|
||||
# Issue 331: mk-duplicate-key-checker crashes getting size of foreign keys
|
||||
# #############################################################################
|
||||
@@ -52,8 +41,7 @@ $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',
|
||||
transform_sample => $transform_int
|
||||
't/pt-duplicate-key-checker/samples/issue_331.txt'
|
||||
),
|
||||
'Issue 331 crash on fks'
|
||||
) or diag($test_diff);
|
||||
|
@@ -12,7 +12,7 @@
|
||||
# UNIQUE KEY `domain` (`domain`),
|
||||
# UNIQUE KEY `unique_key_domain` (`domain`)
|
||||
# Column types:
|
||||
# `domain` varchar(175) character set utf8mb3 collate utf8mb3_bin not null
|
||||
# `domain` varchar(175) character set utf8 collate utf8_bin not null
|
||||
# To remove this duplicate index, execute:
|
||||
ALTER TABLE `test`.`domains` DROP INDEX `domain`;
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
# UNIQUE KEY `domain` (`domain`),
|
||||
# UNIQUE KEY `unique_key_domain` (`domain`)
|
||||
# Column types:
|
||||
# `domain` varchar(175) character set utf8mb3 collate utf8mb3_bin not null
|
||||
# `domain` varchar(175) character set utf8 collate utf8_bin not null
|
||||
# To remove this duplicate index, execute:
|
||||
ALTER TABLE `test`.`domains` DROP INDEX `domain`;
|
||||
|
||||
|
@@ -26,7 +26,7 @@ ok(
|
||||
no_diff(
|
||||
"$cmd -- cat $sample/mext-001.txt",
|
||||
"t/pt-mext/samples/mext-001-result.txt",
|
||||
post_pipe => "LOCALE=C sort -k1,1",
|
||||
post_pipe => "LANG=C sort -k1,1",
|
||||
),
|
||||
"mext-001"
|
||||
) or diag($test_diff);
|
||||
@@ -35,7 +35,7 @@ ok(
|
||||
no_diff(
|
||||
"$cmd -r -- cat $sample/mext-002.txt",
|
||||
"t/pt-mext/samples/mext-002-result.txt",
|
||||
post_pipe => "LOCALE=C sort -k1,1",
|
||||
post_pipe => "LANG=C sort -k1,1",
|
||||
),
|
||||
"mext-002 -r"
|
||||
) or diag($test_diff);
|
||||
|