Compare commits

..

25 Commits

Author SHA1 Message Date
Sveta Smirnova
c1ba474a84 Updated version properly (#611)
* Release v3.5.1 Go 1.20 and upgrade deps

* Release v3.5.2

* PT-2193 Release Notes 3.5.2 (#610)

modified:   Changelog
	modified:   Makefile.PL
	modified:   config/sphinx-build/conf.py
	modified:   docs/release_notes.rst
	new file:   docs/rn.3-5-2.txt

* Updated version properly

---------

Co-authored-by: Carlos Salguero <carlos.salguero@percona.com>
Co-authored-by: Alina Derkach <alina.derkach@percona.com>
2023-03-28 12:28:10 +03:00
Alina Derkach
74e186f524 PT-2193 Release Notes 3.5.2 (#610)
modified:   Changelog
	modified:   Makefile.PL
	modified:   config/sphinx-build/conf.py
	modified:   docs/release_notes.rst
	new file:   docs/rn.3-5-2.txt
2023-03-27 19:15:03 +03:00
Carlos Salguero
e9d522cc58 Release v3.5.2 2023-03-27 09:08:42 -03:00
Carlos Salguero
4b5940807f Merge branch 'release-v3.5.1' of percona.github.com:percona/percona-toolkit into release-v3.5.2 2023-03-27 08:42:23 -03:00
Sveta Smirnova
642253ce52 PT-2156 Fix tests for lib (#606)
* PT-2156 - Fix tests for lib

- Fixed tests broken for lib/TableParser.pm after fix for PT-1059
- Updated tests for lib/TableParser.pm that are broken due to SHOW CREATE TABLE output format change in 8.0
- Updated modules for all tools that use lib/TableParser.pm

* Revert "Fixed pt-archiver tests"

This reverts commit a3ab87b12e.

This commit wa needed, because removed code in sandbox/slave_channels.sql broked the test. Proper fix would be to do not remove channel names rather than chaging the test. So revertig it.

* PT-2156 - Fix tests for lib

- Updated test t/lib/TableChecksum.t so it reflects changes, introduced in the fix for PT-2016
- Updated test t/lib/RowChecksum.t so it reflects changes added to in the fix for PT-2138: UTF8 support
- Uncommented SQL in sandbox/slave_channels.sql that made t/lib/MasterSlave.t to fail
- Added check for undef into t/pt-archiver/archive_using_channels.t
- Updated lib/Cxn.pm so it uses $dbh->{Active} after issue with the ping() call, reported at https://github.com/perl5-dbi/DBD-mysql/issues/306

* PT-2156 - Fix tests for lib

- Impoved the fix for PT-2016, so it does not files with keys with USING keyword
- Added brackets to expression in lib/TableNibbler.pm, so it does not crap query wit many indexes with OR keyword
- Adjusted test t/lib/TableNibbler.t, so it reflects above chages
- Modified lib/Cxn.pm, so it has workaround for https://github.com/perl5-dbi/DBD-mysql/issues/306 , introduced in DBD::mysql 4.0.50
- Updated tests: added debugging code and cleanups
- Updated modules for tools
2023-03-27 14:18:26 +03:00
Carlos Salguero
7a0a73b816 Release v3.5.1 Go 1.20 and upgrade deps 2023-03-22 09:00:12 -03:00
Sveta Smirnova
46a466efcc PT-2165 actual version, go version, and build for go tools (#603)
* PT-2165 - Actual Version, GoVersion, and Build for Go tools

Removed outdated numbers from main.go, because we update these numbers in the Makefile.

* PT-2165 - Actual Version, GoVersion, and Build for Go tools

Added template version into Makefile for the latest tag.
2023-02-27 01:19:26 +03:00
Sveta Smirnova
bfc00b93a8 PT-2160 fix tests for pt online schema change (#602)
* PT-2160 - Fix tests for pt-online-schema-change

Re-enabled tests after MySQL bug #89441 fix in 8.0.14 and later
Updated t/pt-online-schema-change/samples/basic_no_fks_innodb.sql, so its unique index is NOT NULL
Added synchonizations when tests are waiting for too long due to slave catch up
Added innodb_directories option for t/pt-online-schema-change/pt-244.t

* PT-2160 - Fix tests for pt-online-schema-change
PT-2048 - pt-osc spans excessive connections to the replica when executing in the source

t/pt-online-schema-change/slave_lag.t was failing due to PT-2048. I added code that reuses already created connections when checks for slave in the wait loop. It fixes slave_lag.t too.
I also added that prints more detailed error when fails to connect to the replica.

* PT-2160 - Fix tests for pt-online-schema-change

Modified t/pt-online-schema-change/slave_lag.t, so it runs and clean ups faster.

* PT-2160 - Fix tests for pt-online-schema-change

Modified t/pt-online-schema-change/pt-1455.t, so it runs and clean ups faster.

* PT-2160 - Fix tests for pt-online-schema-change

Fixed search for HASH and BTREE keys broken by fix for PT-2123
Updated modules for pt-archiver
Fixed die message for sandbox/start-sandbox
Added global_grants table to list of exceptions for the ok function in lib/Sandbox.pm
Added wait_for_slaves to bugs.t, so changes on the source are copied to replica before pt-osc starts working
Updated PXC tests
Added wait_for_slaves to pt-1455.t
Fixed regular expression in pt-229.t, so it works with both 5.x and 8.0 versions
Added innodb_directories option for pt-244.t, so it does not fail on 8.0
Modified slave_lag.t, so it is more stable and slow enough, so pt-osc can print message about delayed replicas
2023-02-27 01:19:11 +03:00
Yoann La Cancellera
7ecdae6ef6 PT-2102_pt-mysql-summary should support include in config files (#601)
* PT-2102 pt-mysql-summary should support include* in config file

includedir directories are now printed in the order of which they appear in root my.cnf

* PT-2102 pt-mysql-summary should support include* in config file

!include was not supported. Changed 'for' to 'while' to properly
test for '!includedir' and '!include'. Supports extra spaces between
files and !include.

* PT-2102 pt-mysql-summary should support include* in config file

Updates modules, added test case for !include and !includedir
Changed find_my_cnf function to make it try every regexes and only
returned when it find one

* Update pt-mysql-summary

Identation fix as suggested by review

* Update collect_mysql_info.sh

Identation as suggested by review

* PT-2102 pt-mysql-summary should support include* in config file

Fix formatting after review

---------

Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>
2023-02-23 16:00:44 +03:00
dependabot[bot]
bc370d2c1d Bump golang.org/x/net from 0.4.0 to 0.7.0 (#600)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.4.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.4.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-22 19:16:46 +03:00
Sveta Smirnova
09d9d1a6e4 PT-2161 - Fix tests for pt-slave-restart (#599)
Added REPLICATION_THREADS=0 to tests which suppose that replication is single-threaded,
because new default in 8.0 is 4 replication threads.
Fixed clean up code in t/pt-slave-restart/pt-slave-restart.t
2023-02-22 19:02:13 +03:00
Sveta Smirnova
aa1ab5d172 PT-2149 - Fix tests for pt-mext (#596)
Changed LANG=C to LOCALE=C, because only LANG does not change sort order properly in tr_TR.UTF8 environment
2023-02-22 19:01:41 +03:00
Sveta Smirnova
beb2b666e8 PT-2159 - Fix tests for pt-duplicate-key-checker (#595)
Added transformation to test results, so they work with deprecations, introduced in 8.0
2023-02-22 18:59:43 +03:00
Sveta Smirnova
91ef89f904 PT-2114 Incorrect casting of bit columns by pt archiver (#587)
* PT-2114 Incorrect casting of BIT columns by pt-archiver

Added special handling of BIT columns, because by default Perl does not properly recognizes
this type and creates invalid query for MySQL.
Removed debugging comment from t/pt-table-checksum/pt-226.t
Added test case.

* PT-2114 Incorrect casting of BIT columns by pt-archiver

Removed debugging comments from t/pt-deadlock-logger/standard_options.t and t/pt-table-checksum/fnv_64.t

* PT-2114 Incorrect casting of BIT columns by pt-archiver

Added test for archiving BIT columns.

* PT-2114 Incorrect casting of BIT columns by pt-archiver

Added test for bulk operations

* PT-2114 Incorrect casting of BIT columns by pt-archiver

Added more tests for BIT columns

* PT-2114 Incorrect casting of BIT columns by pt-archiver

- Improved fix for PT-2123, so it works with 5.7
- Fixed tests for PT-2114, so they work with 5.7
2023-02-22 18:59:05 +03:00
Sveta Smirnova
cd6eef7c28 PT-2152 - Fix tests for pt-show-grants (#598)
Updated results for version 8.0
2023-02-14 18:28:07 +03:00
Sveta Smirnova
e9c3d8f6fb PT-2155 - Fix tests for pt-upgrade (#597)
Version 5.7 introduced default mysql.session and mysql.sys. So I updated results for the diff_rows test.
2023-02-14 00:58:04 +03:00
Sveta Smirnova
61a53edc54 PT-188-Use percona.checksums in examples (#594)
Replaced test.checksum with percona.checksum in examples
2023-02-13 12:47:35 +03:00
Sveta Smirnova
2d6b22a1a0 PT-1389 - pt-variable-advisor Docs Typos (#593)
Fixed typo
2023-02-13 12:46:52 +03:00
Sveta Smirnova
a38fd1d998 PT-1594 - Need correction in the Documentation - pt-mysql-summary (#592)
Implemented suggested correction
2023-02-13 12:46:07 +03:00
Sveta Smirnova
0accdb3bd3 PT-1595-percona toolkit docs still reference Maatkit (#591)
- Removed Maatkit left overs
- Keeped links to Maatkit bugs and wiki
- Updated brokn links
2023-02-13 12:44:57 +03:00
Sveta Smirnova
bbe3170f2f PT-2120 pt-stalk with --system-only displaying mysql_only message on the screen (#584)
* 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

Added check if source DSN has character set UTF specified while option --charset is not provided
In this case it is safe to open bulk insert data file in utf8 mode.

* 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

Removed unrelated row in t/pt-archiver/samples/pt-2123.sql

* 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

util/update-modules for pt-archiver

* PT-2120 - pt-stalk with --system-only displaying MYSQL_ONLY: message on the screen

Now we are printing MYSQL_ONLY or SYSTEM_ONLY if option is specified
Also added a warning in case if both options provided together
Added test cases

* Update pt-stalk

Identation as was requested by @denisok
2023-02-13 12:44:12 +03:00
Sveta Smirnova
64ca4de973 PT-1642-Update PT docs to reference bug reporting location as Percona JIRA (#590)
Updated bug tracker URL and also changed "open issues" list to https://jira.percona.com/projects/PT/issues
2023-02-11 00:34:01 +03:00
Sveta Smirnova
c0b208ff94 PT-1700 pt-table-checksum REPLICATION_STOPPED exit status not documented (#588)
Fixed documntaiton in bin/pt-table-checksum
2023-02-10 21:09:20 +03:00
Sveta Smirnova
268dab8a73 PT-1683 List of supported distributions in the docs is outdated (#589)
Bug itself is fixed by commits 7eaca8a98e and ee6a9da438
But the documentation still listed Debian 8 (jessie) which is, again, outdated.
So I adopted example for Percona 3.5.1 on Debian 11 (bullseye)
2023-02-10 21:08:51 +03:00
EvgeniyPatlan
28bcd06b07 Create toolkit.yml (#586)
* Create toolkit.yml

Added github action that will build go binaries on each commit. After that we will scan all binaries on CVEs. And if there are no CVEs binaries will be available for downloads

* Update toolkit.yml

Update GA
2023-02-10 17:44:03 +03:00
109 changed files with 1443 additions and 548 deletions

40
.github/workflows/toolkit.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
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/*

View File

@@ -1,5 +1,38 @@
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

View File

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

View File

@@ -1285,7 +1285,7 @@ reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-align>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-align 3.5.2
=cut

View File

@@ -45,7 +45,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -2139,8 +2139,7 @@ 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 [\s\S]*?\),?.*)$/gm ) {
next KEY if $key =~ m/FOREIGN/;
my $key_ddl = $key;
@@ -2150,7 +2149,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+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
@@ -3221,7 +3220,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))";
@@ -3674,6 +3673,7 @@ 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,16 +3750,29 @@ sub recurse_to_slaves {
PTDEBUG && _d("Slave password set");
}
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 $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 $sql = 'SELECT @@SERVER_ID';
@@ -4587,7 +4600,7 @@ sub connect {
my $dp = $self->{DSNParser};
my $dbh = $self->{dbh};
if ( !$dbh || !$dbh->ping() ) {
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
$self->{asked_for_pass} = 1;
@@ -4616,19 +4629,20 @@ sub connect {
sub set_dbh {
my ($self, $dbh) = @_;
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*/';
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
PTDEBUG && _d($dbh, $sql);
my ($server_id, $hostname) = $dbh->selectrow_array($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) {
PTDEBUG && _d($dbh, 'Already set dbh');
return $dbh;
}
if ( $hostname ) {
$self->{hostname} = $hostname;
}
@@ -4643,7 +4657,7 @@ sub set_dbh {
}
$self->{dbh} = $dbh;
$self->{dbh_set} = 1;
$self->{dbh_set} = $connection_id;
return $dbh;
}
@@ -4769,6 +4783,17 @@ 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; }
@@ -7400,7 +7425,7 @@ server. Before using this tool, please:
=head1 DESCRIPTION
pt-archiver is the tool I use to archive tables as described in
L<http://tinyurl.com/mysql-archiving>. The goal is a low-impact, forward-only
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
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
@@ -8675,7 +8700,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-archiver>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -8753,6 +8778,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-archiver 3.5.1
pt-archiver 3.5.2
=cut

View File

@@ -43,7 +43,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -2368,7 +2368,7 @@ sub connect {
my $dp = $self->{DSNParser};
my $dbh = $self->{dbh};
if ( !$dbh || !$dbh->ping() ) {
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
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,19 +2397,20 @@ sub connect {
sub set_dbh {
my ($self, $dbh) = @_;
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*/';
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
PTDEBUG && _d($dbh, $sql);
my ($server_id, $hostname) = $dbh->selectrow_array($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) {
PTDEBUG && _d($dbh, 'Already set dbh');
return $dbh;
}
if ( $hostname ) {
$self->{hostname} = $hostname;
}
@@ -2424,7 +2425,7 @@ sub set_dbh {
}
$self->{dbh} = $dbh;
$self->{dbh_set} = 1;
$self->{dbh_set} = $connection_id;
return $dbh;
}
@@ -2550,6 +2551,17 @@ 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; }
@@ -5926,7 +5938,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-config-diff>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -5999,6 +6011,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-config-diff 3.5.1
pt-config-diff 3.5.2
=cut

View File

@@ -42,7 +42,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -2712,7 +2712,7 @@ sub connect {
my $dp = $self->{DSNParser};
my $dbh = $self->{dbh};
if ( !$dbh || !$dbh->ping() ) {
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
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,19 +2741,20 @@ sub connect {
sub set_dbh {
my ($self, $dbh) = @_;
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*/';
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
PTDEBUG && _d($dbh, $sql);
my ($server_id, $hostname) = $dbh->selectrow_array($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) {
PTDEBUG && _d($dbh, 'Already set dbh');
return $dbh;
}
if ( $hostname ) {
$self->{hostname} = $hostname;
}
@@ -2768,7 +2769,7 @@ sub set_dbh {
}
$self->{dbh} = $dbh;
$self->{dbh_set} = 1;
$self->{dbh_set} = $connection_id;
return $dbh;
}
@@ -2894,6 +2895,17 @@ 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; }
@@ -5702,7 +5714,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-deadlock-logger>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -5776,6 +5788,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-deadlock-logger 3.5.1
pt-deadlock-logger 3.5.2
=cut

View File

@@ -38,7 +38,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -5618,7 +5618,7 @@ reading from files.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-diskstats>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-diskstats 3.5.2
=cut

View File

@@ -39,7 +39,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -345,7 +345,7 @@ sub parse {
my $engine = $self->get_engine($ddl);
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
@@ -526,8 +526,7 @@ sub get_keys {
my $clustered_key = undef;
KEY:
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
next KEY if $key =~ m/FOREIGN/;
my $key_ddl = $key;
@@ -537,7 +536,7 @@ sub get_keys {
$key =~ s/USING HASH/USING BTREE/;
}
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
@@ -5713,7 +5712,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-duplicate-key-checker>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -5787,6 +5786,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-duplicate-key-checker 3.5.1
pt-duplicate-key-checker 3.5.2
=cut

View File

@@ -1634,7 +1634,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-fifo-split>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-fifo-split 3.5.2
=cut

View File

@@ -35,7 +35,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -1897,7 +1897,7 @@ sub parse {
my $engine = $self->get_engine($ddl);
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
@@ -2078,8 +2078,7 @@ sub get_keys {
my $clustered_key = undef;
KEY:
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
next KEY if $key =~ m/FOREIGN/;
my $key_ddl = $key;
@@ -2089,7 +2088,7 @@ sub get_keys {
$key =~ s/USING HASH/USING BTREE/;
}
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
@@ -5128,7 +5127,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-find>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -5202,6 +5201,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-find 3.5.1
pt-find 3.5.2
=cut

View File

@@ -2198,7 +2198,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-fingerprint>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-fingerprint 3.5.2
=cut

View File

@@ -37,7 +37,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -1866,7 +1866,7 @@ sub connect {
my $dp = $self->{DSNParser};
my $dbh = $self->{dbh};
if ( !$dbh || !$dbh->ping() ) {
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
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,19 +1895,20 @@ sub connect {
sub set_dbh {
my ($self, $dbh) = @_;
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*/';
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
PTDEBUG && _d($dbh, $sql);
my ($server_id, $hostname) = $dbh->selectrow_array($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) {
PTDEBUG && _d($dbh, 'Already set dbh');
return $dbh;
}
if ( $hostname ) {
$self->{hostname} = $hostname;
}
@@ -1922,7 +1923,7 @@ sub set_dbh {
}
$self->{dbh} = $dbh;
$self->{dbh_set} = 1;
$self->{dbh_set} = $connection_id;
return $dbh;
}
@@ -2048,6 +2049,17 @@ 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; }
@@ -4690,7 +4702,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-fk-error-logger>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -4763,6 +4775,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-fk-error-logger 3.5.1
pt-fk-error-logger 3.5.2
=cut

View File

@@ -44,7 +44,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -170,6 +170,7 @@ 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;
@@ -246,16 +247,29 @@ sub recurse_to_slaves {
PTDEBUG && _d("Slave password set");
}
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 $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 $sql = 'SELECT @@SERVER_ID';
@@ -3624,7 +3638,7 @@ sub parse {
my $engine = $self->get_engine($ddl);
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
@@ -3805,8 +3819,7 @@ sub get_keys {
my $clustered_key = undef;
KEY:
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
next KEY if $key =~ m/FOREIGN/;
my $key_ddl = $key;
@@ -3816,7 +3829,7 @@ sub get_keys {
$key =~ s/USING HASH/USING BTREE/;
}
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
@@ -7384,7 +7397,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-heartbeat>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -7460,6 +7473,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-heartbeat 3.5.1
pt-heartbeat 3.5.2
=cut

View File

@@ -45,7 +45,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -3149,7 +3149,7 @@ sub parse {
my $engine = $self->get_engine($ddl);
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
@@ -3330,8 +3330,7 @@ sub get_keys {
my $clustered_key = undef;
KEY:
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
next KEY if $key =~ m/FOREIGN/;
my $key_ddl = $key;
@@ -3341,7 +3340,7 @@ sub get_keys {
$key =~ s/USING HASH/USING BTREE/;
}
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
@@ -7658,7 +7657,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-index-usage>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -7732,6 +7731,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-index-usage 3.5.1
pt-index-usage 3.5.2
=cut

View File

@@ -1053,7 +1053,7 @@ This tool requires the Bourne shell (F</bin/sh>).
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-ioprofile>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-ioprofile 3.5.2
=cut

View File

@@ -47,7 +47,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -3012,7 +3012,7 @@ sub parse {
my $engine = $self->get_engine($ddl);
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
@@ -3193,8 +3193,7 @@ sub get_keys {
my $clustered_key = undef;
KEY:
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
next KEY if $key =~ m/FOREIGN/;
my $key_ddl = $key;
@@ -3204,7 +3203,7 @@ sub get_keys {
$key =~ s/USING HASH/USING BTREE/;
}
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
@@ -3951,6 +3950,7 @@ 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,16 +4027,29 @@ sub recurse_to_slaves {
PTDEBUG && _d("Slave password set");
}
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 $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 $sql = 'SELECT @@SERVER_ID';
@@ -5402,7 +5415,7 @@ sub connect {
my $dp = $self->{DSNParser};
my $dbh = $self->{dbh};
if ( !$dbh || !$dbh->ping() ) {
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
$self->{asked_for_pass} = 1;
@@ -5431,19 +5444,20 @@ sub connect {
sub set_dbh {
my ($self, $dbh) = @_;
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*/';
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
PTDEBUG && _d($dbh, $sql);
my ($server_id, $hostname) = $dbh->selectrow_array($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) {
PTDEBUG && _d($dbh, 'Already set dbh');
return $dbh;
}
if ( $hostname ) {
$self->{hostname} = $hostname;
}
@@ -5458,7 +5472,7 @@ sub set_dbh {
}
$self->{dbh} = $dbh;
$self->{dbh_set} = 1;
$self->{dbh_set} = $connection_id;
return $dbh;
}
@@ -5584,6 +5598,17 @@ 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; }
@@ -8660,7 +8685,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-kill>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -8734,6 +8759,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-kill 3.5.1
pt-kill 3.5.2
=cut

View File

@@ -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<http://www.percona.com/bugs/pt-mext>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-mext 3.5.2
=cut

View File

@@ -878,11 +878,17 @@ 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; }')"
else
cnf_file="$(grep --max-count 1 '/mysqld' "$file" \
| awk 'BEGIN{RS=" "; FS="=";} $1 ~ /--defaults-file/ { print $2; }')"
if [ -n "$cnf_file" ]; then
echo "$cnf_file"
return
fi
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"
@@ -1419,6 +1425,25 @@ 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"
}
@@ -2859,7 +2884,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 third column is the incremental difference from the first and second
The fourth 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.
@@ -3221,7 +3246,7 @@ On BSD systems, it may require a mounted procfs.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-mysql-summary>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -3300,7 +3325,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-mysql-summary 3.5.1
pt-mysql-summary 3.5.2
=cut

View File

@@ -56,7 +56,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
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/^(\s+`.*?),?$/gm;
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
@@ -3509,8 +3509,7 @@ sub get_keys {
my $clustered_key = undef;
KEY:
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
next KEY if $key =~ m/FOREIGN/;
my $key_ddl = $key;
@@ -3520,7 +3519,7 @@ sub get_keys {
$key =~ s/USING HASH/USING BTREE/;
}
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
@@ -3955,7 +3954,7 @@ sub connect {
my $dp = $self->{DSNParser};
my $dbh = $self->{dbh};
if ( !$dbh || !$dbh->ping() ) {
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
$self->{asked_for_pass} = 1;
@@ -3984,19 +3983,20 @@ sub connect {
sub set_dbh {
my ($self, $dbh) = @_;
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*/';
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
PTDEBUG && _d($dbh, $sql);
my ($server_id, $hostname) = $dbh->selectrow_array($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) {
PTDEBUG && _d($dbh, 'Already set dbh');
return $dbh;
}
if ( $hostname ) {
$self->{hostname} = $hostname;
}
@@ -4011,7 +4011,7 @@ sub set_dbh {
}
$self->{dbh} = $dbh;
$self->{dbh_set} = 1;
$self->{dbh_set} = $connection_id;
return $dbh;
}
@@ -4137,6 +4137,17 @@ 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; }
@@ -4225,6 +4236,7 @@ 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;
@@ -4301,16 +4313,29 @@ sub recurse_to_slaves {
PTDEBUG && _d("Slave password set");
}
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 $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 $sql = 'SELECT @@SERVER_ID';
@@ -8825,6 +8850,7 @@ sub main {
my $slaves =$ms->get_slaves(
dbh => $cxn->dbh(),
dsn => $cxn->dsn(),
slaves => $slaves,
make_cxn => sub {
return $make_cxn->(
@_,
@@ -13385,9 +13411,9 @@ REPLICATION SLAVE and REPLICATION CLIENT privileges.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-online-schema-change>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://bugs.launchpad.net/percona-toolkit>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
=over
@@ -13467,6 +13493,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-online-schema-change 3.5.1
pt-online-schema-change 3.5.2
=cut

View File

@@ -822,7 +822,7 @@ on the command line.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-pmp>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-pmp 3.5.2
=cut

View File

@@ -64,7 +64,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -8894,7 +8894,7 @@ sub parse {
my $engine = $self->get_engine($ddl);
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
@@ -9075,8 +9075,7 @@ sub get_keys {
my $clustered_key = undef;
KEY:
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
next KEY if $key =~ m/FOREIGN/;
my $key_ddl = $key;
@@ -9086,7 +9085,7 @@ sub get_keys {
$key =~ s/USING HASH/USING BTREE/;
}
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
@@ -10539,6 +10538,7 @@ 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,16 +10615,29 @@ sub recurse_to_slaves {
PTDEBUG && _d("Slave password set");
}
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 $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 $sql = 'SELECT @@SERVER_ID';
@@ -16775,7 +16788,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-query-digest>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -16977,6 +16990,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-query-digest 3.5.1
pt-query-digest 3.5.2
=cut

View File

@@ -2599,9 +2599,9 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-show-grants>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://bugs.launchpad.net/percona-toolkit>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
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.1
pt-show-grants 3.5.2
=cut

View File

@@ -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<http://www.percona.com/bugs/pt-sift>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-sift 3.5.2
=cut

View File

@@ -40,7 +40,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
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<http://www.percona.com/bugs/pt-slave-delay>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-slave-delay 3.5.2
=cut

View File

@@ -2306,6 +2306,7 @@ 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;
@@ -2382,16 +2383,29 @@ sub recurse_to_slaves {
PTDEBUG && _d("Slave password set");
}
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 $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 $sql = 'SELECT @@SERVER_ID';
@@ -4507,7 +4521,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-slave-find>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -4581,6 +4595,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-slave-find 3.5.1
pt-slave-find 3.5.2
=cut

View File

@@ -41,7 +41,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -2717,6 +2717,7 @@ 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;
@@ -2793,16 +2794,29 @@ sub recurse_to_slaves {
PTDEBUG && _d("Slave password set");
}
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 $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 $sql = 'SELECT @@SERVER_ID';
@@ -6158,7 +6172,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-slave-restart>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -6232,6 +6246,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-slave-restart 3.5.1
pt-slave-restart 3.5.2
=cut

View File

@@ -1570,8 +1570,11 @@ stalk() {
# Start collecting, maybe.
# ##################################################################
log "Collect $ITER triggered"
log "MYSQL_ONLY: $OPT_MYSQL_ONLY"
log "SYSTEM_ONLY: $OPT_SYSTEM_ONLY"
if [ "$OPT_MYSQL_ONLY" ]; then
log "MYSQL_ONLY: $OPT_MYSQL_ONLY"
elif [ "$OPT_SYSTEM_ONLY" ]; then
log "SYSTEM_ONLY: $OPT_SYSTEM_ONLY"
fi
# Send email to whomever that collect has been triggered.
if [ "$OPT_NOTIFY_BY_EMAIL" ]; then
@@ -1672,6 +1675,10 @@ 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.
@@ -2477,7 +2484,7 @@ This tool requires Bash v3 or newer. Certain options require other programs:
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-stalk>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -2557,7 +2564,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-stalk 3.5.1
pt-stalk 3.5.2
=cut

View File

@@ -2690,7 +2690,7 @@ This tool requires the Bourne shell (F</bin/sh>).
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-summary>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-summary 3.5.2
=cut

View File

@@ -58,7 +58,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -3673,7 +3673,7 @@ sub connect {
my $dp = $self->{DSNParser};
my $dbh = $self->{dbh};
if ( !$dbh || !$dbh->ping() ) {
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
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,19 +3702,20 @@ sub connect {
sub set_dbh {
my ($self, $dbh) = @_;
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*/';
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
PTDEBUG && _d($dbh, $sql);
my ($server_id, $hostname) = $dbh->selectrow_array($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) {
PTDEBUG && _d($dbh, 'Already set dbh');
return $dbh;
}
if ( $hostname ) {
$self->{hostname} = $hostname;
}
@@ -3729,7 +3730,7 @@ sub set_dbh {
}
$self->{dbh} = $dbh;
$self->{dbh_set} = 1;
$self->{dbh_set} = $connection_id;
return $dbh;
}
@@ -3855,6 +3856,17 @@ 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; }
@@ -4697,8 +4709,7 @@ 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 [\s\S]*?\),?.*)$/gm ) {
next KEY if $key =~ m/FOREIGN/;
my $key_ddl = $key;
@@ -4708,7 +4719,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+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
@@ -4989,7 +5000,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))";
@@ -5188,6 +5199,7 @@ 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;
@@ -5264,16 +5276,29 @@ sub recurse_to_slaves {
PTDEBUG && _d("Slave password set");
}
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 $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 $sql = 'SELECT @@SERVER_ID';
@@ -13010,6 +13035,7 @@ 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>
@@ -14050,7 +14076,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-table-checksum>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -14129,6 +14155,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-table-checksum 3.5.1
pt-table-checksum 3.5.2
=cut

View File

@@ -55,7 +55,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -2877,7 +2877,7 @@ sub parse {
my $engine = $self->get_engine($ddl);
my @defs = $ddl =~ m/^(\s+`.*?),?$/gm;
my @defs = $ddl =~ m/(?:(?<=,\n)|(?<=\(\n))(\s+`(?:.|\n)+?`.+?),?\n/g;
my @cols = map { $_ =~ m/`([^`]+)`/ } @defs;
PTDEBUG && _d('Table cols:', join(', ', map { "`$_`" } @cols));
@@ -3058,8 +3058,7 @@ sub get_keys {
my $clustered_key = undef;
KEY:
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
next KEY if $key =~ m/FOREIGN/;
my $key_ddl = $key;
@@ -3069,7 +3068,7 @@ sub get_keys {
$key =~ s/USING HASH/USING BTREE/;
}
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \((.+)\)/;
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;
@@ -6517,7 +6516,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))";
@@ -6716,6 +6715,7 @@ 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,16 +6792,29 @@ sub recurse_to_slaves {
PTDEBUG && _d("Slave password set");
}
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 $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 $sql = 'SELECT @@SERVER_ID';
@@ -11794,11 +11807,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 test.checksum master1
pt-table-sync --execute --replicate percona.checksum master1
Same as above but only resolve differences on slave1:
pt-table-sync --execute --replicate test.checksum \
pt-table-sync --execute --replicate percona.checksum \
--sync-to-master slave1
Sync master2 in a master-master replication configuration, where master2's copy
@@ -13039,7 +13052,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-table-sync>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -13101,7 +13114,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<http://tinyurl.com/mysql-data-diff-algorithm>,
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/>,
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
@@ -13119,8 +13132,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<http://tinyurl.com/maatkit-vs-sqlyog>
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/>
Thanks to the following people and organizations for helping in many ways:
@@ -13165,6 +13178,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-table-sync 3.5.1
pt-table-sync 3.5.2
=cut

View File

@@ -8446,7 +8446,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-table-usage>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-table-usage 3.5.2
=cut

View File

@@ -61,7 +61,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
use strict;
use warnings FATAL => 'all';
@@ -2539,7 +2539,7 @@ sub connect {
my $dp = $self->{DSNParser};
my $dbh = $self->{dbh};
if ( !$dbh || !$dbh->ping() ) {
if ( !$dbh || ( $dbh && $self->{dbh_set} && !$self->_ping($dbh) ) ) {
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,19 +2568,20 @@ sub connect {
sub set_dbh {
my ($self, $dbh) = @_;
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*/';
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
PTDEBUG && _d($dbh, $sql);
my ($server_id, $hostname) = $dbh->selectrow_array($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) {
PTDEBUG && _d($dbh, 'Already set dbh');
return $dbh;
}
if ( $hostname ) {
$self->{hostname} = $hostname;
}
@@ -2595,7 +2596,7 @@ sub set_dbh {
}
$self->{dbh} = $dbh;
$self->{dbh_set} = 1;
$self->{dbh_set} = $connection_id;
return $dbh;
}
@@ -2721,6 +2722,17 @@ 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; }
@@ -11442,7 +11454,7 @@ installed in any reasonably new version of Perl.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-upgrade>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
@@ -11516,6 +11528,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-upgrade 3.5.1
pt-upgrade 3.5.2
=cut

View File

@@ -44,7 +44,7 @@ BEGIN {
{
package Percona::Toolkit;
our $VERSION = '3.5.1';
our $VERSION = '3.5.2';
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 examples
At the time of this release, pt-variable-advisor only examines
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<http://www.percona.com/bugs/pt-variable-advisor>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-variable-advisor 3.5.2
=cut

View File

@@ -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://launchpad.net/percona-toolkit for more information.
# See https://github.com/percona/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://launchpad.net/percona-toolkit for more information.
# See https://github.com/percona/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://launchpad.net/percona-toolkit for more information.
# See https://github.com/percona/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<http://www.percona.com/bugs/pt-visual-explain>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
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.1
pt-visual-explain 3.5.2
=cut

View File

@@ -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.1'
release = '3.5.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@@ -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 8 ("jessie"),
For example, to download the package for Debian 11 ("bullseye"),
run the following::
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
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
If you want to download a specific tool, use the following address:
http://www.percona.com/get

View File

@@ -575,6 +575,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
Percona Toolkit v3.5.1 released 2023-01-23
Percona Toolkit v3.5.2 released 2023-03-28
=cut

View File

@@ -1,6 +1,48 @@
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
==============================

48
docs/rn.3-5-2.txt Normal file
View File

@@ -0,0 +1,48 @@
.. _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
View File

@@ -1,31 +1,31 @@
module github.com/percona/percona-toolkit
go 1.19
go 1.20
require (
github.com/AlekSi/pointer v1.2.0
github.com/Masterminds/semver v1.4.2
github.com/Masterminds/semver v1.5.0
github.com/alecthomas/kingpin v2.2.6+incompatible
github.com/alecthomas/kong v0.5.0
github.com/go-ini/ini v1.66.4
github.com/golang/mock v1.4.4
github.com/alecthomas/kong v0.7.1
github.com/go-ini/ini v1.67.0
github.com/golang/mock v1.6.0
github.com/google/uuid v1.3.0
github.com/hashicorp/go-version v1.4.0
github.com/hashicorp/go-version v1.6.0
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef
github.com/lib/pq v1.10.4
github.com/lib/pq v1.10.7
github.com/mattn/go-shellwords v1.0.12
github.com/montanaflynn/stats v0.6.6
github.com/montanaflynn/stats v0.7.0
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.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
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
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
k8s.io/api v0.23.5
k8s.io/api v0.26.3
)
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.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.1 // indirect
github.com/klauspost/compress v1.16.3 // 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.10 // indirect
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.1 // indirect
github.com/xdg-go/stringprep v1.0.3 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
github.com/yusufpapurcu/wmi v1.2.2 // 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
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
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // 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
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
)

97
go.sum
View File

@@ -4,6 +4,8 @@ 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=
@@ -11,6 +13,8 @@ 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=
@@ -36,6 +40,8 @@ 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=
@@ -56,6 +62,8 @@ 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=
@@ -78,6 +86,8 @@ 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=
@@ -91,6 +101,8 @@ 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=
@@ -102,6 +114,8 @@ 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=
@@ -110,6 +124,8 @@ 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=
@@ -125,6 +141,8 @@ 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=
@@ -150,11 +168,15 @@ 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=
@@ -162,46 +184,68 @@ 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=
@@ -213,10 +257,15 @@ 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.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU=
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
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/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=
@@ -225,6 +274,9 @@ 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=
@@ -241,22 +293,35 @@ 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.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/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/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.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
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/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.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
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/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=
@@ -268,7 +333,9 @@ 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=
@@ -316,28 +383,42 @@ 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=

View File

@@ -123,7 +123,8 @@ sub connect {
my $dp = $self->{DSNParser};
my $dbh = $self->{dbh};
if ( !$dbh || !$dbh->ping() ) {
# 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) ) ) {
# Ask for password once.
if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p} ) {
$dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
@@ -153,18 +154,6 @@ sub connect {
sub set_dbh {
my ($self, $dbh) = @_;
# 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
# a dbh, we set that dbh when connect() is called because whoever
# 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.
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).
@@ -172,10 +161,26 @@ sub set_dbh {
# 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*/';
my $sql = 'SELECT @@server_id /*!50038 , @@hostname*/, CONNECTION_ID() as connection_id';
PTDEBUG && _d($dbh, $sql);
my ($server_id, $hostname) = $dbh->selectrow_array($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
# a dbh, we set that dbh when connect() is called because whoever
# 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) {
PTDEBUG && _d($dbh, 'Already set dbh');
return $dbh;
}
if ( $hostname ) {
$self->{hostname} = $hostname;
}
@@ -191,7 +196,7 @@ sub set_dbh {
}
$self->{dbh} = $dbh;
$self->{dbh_set} = 1;
$self->{dbh_set} = $connection_id;
return $dbh;
}
@@ -343,6 +348,19 @@ 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; }

View File

@@ -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 Maatkit tools will expect. Tools should NEVER open their own
# the way the Percona 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 ) = @_;

View File

@@ -87,6 +87,7 @@ 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;
@@ -185,16 +186,29 @@ sub recurse_to_slaves {
PTDEBUG && _d("Slave password set");
}
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 $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 $sql = 'SELECT @@SERVER_ID';

View File

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

View File

@@ -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 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.
# 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.
my $quote_char = '';
VAL:
foreach my $val ( split(',', $vals) ) {

View File

@@ -372,6 +372,7 @@ 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

View File

@@ -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))";

View File

@@ -389,9 +389,7 @@ sub get_keys {
my $clustered_key = undef;
KEY:
#foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY .*)$/gm ) {
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY \(?`[\s\S]*?`\),?)$/gm ) {
foreach my $key ( $ddl =~ m/^ ((?:[A-Z]+ )?KEY [\s\S]*?\),?.*)$/gm ) {
# If you want foreign keys, use get_fks() below.
next KEY if $key =~ m/FOREIGN/;
@@ -408,7 +406,7 @@ sub get_keys {
}
# Determine index type
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+?)\)/;
my ( $type, $cols ) = $key =~ m/(?:USING (\w+))? \(([\s\S]+)\)/;
my ( $special ) = $key =~ m/(FULLTEXT|SPATIAL)/;
$type = $type || $special || 'BTREE';
my ($name) = $key =~ m/(PRIMARY|`[^`]*`)/;

View File

@@ -64,12 +64,17 @@ 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; }')"
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; }')"
if [ -n "$cnf_file" ]; then
echo "$cnf_file"
return
fi
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

View File

@@ -387,6 +387,25 @@ 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"
}

View File

@@ -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';

View File

@@ -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, and master-master."
die "Invalid sandbox type: $type. Valid types are master, slave, master-master, cluster, and channels."
fi
if [ $port -le 1024 ]; then

View File

@@ -18,6 +18,8 @@ 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

View File

@@ -15,10 +15,10 @@ const (
// We do not set anything here, these variables are defined by the Makefile
var (
Build string
GoVersion string
Version string
Commit string
Build string //nolint
GoVersion string //nolint
Version string //nolint
Commit string //nolint
)
func main() {

View File

@@ -45,11 +45,12 @@ const (
TOOLNAME = "pt-mongodb-index-check"
)
// We do not set anything here, these variables are defined by the Makefile
var (
Build string = "2020-04-23" //nolint
GoVersion string = "1.14.1" //nolint
Version string = "3.5.1" //nolint
Commit string //nolint
Build string //nolint
GoVersion string //nolint
Version string //nolint
Commit string //nolint
)
func main() {

View File

@@ -38,11 +38,12 @@ const (
DEFAULT_SKIPCOLLECTIONS = "system.profile" // comma separated list
)
// We do not set anything here, these variables are defined by the Makefile
var (
Build string = "2020-04-23" //nolint
GoVersion string = "1.14.1" //nolint
Version string = "3.5.1" //nolint
Commit string //nolint
Build string //nolint
GoVersion string //nolint
Version string //nolint
Commit string //nolint
)
type cliOptions struct {

View File

@@ -55,10 +55,11 @@ const (
//nolint:gochecknoglobals
var (
Build string = "2020-04-23"
GoVersion string = "1.14.1"
Version string = "3.5.1"
Commit string
// 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
defaultConnectionTimeout = 3 * time.Second
directConnection = true

View File

@@ -17,11 +17,12 @@ 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 = "2020-04-23" //nolint
Commit string //nolint
GoVersion string = "1.14.1" //nolint
Version string = "3.5.1" //nolint
Build string //nolint
GoVersion string //nolint
Version string //nolint
Commit string //nolint
)
type connOpts struct {

View File

@@ -1,6 +1,7 @@
GO := go
pkgs = $(shell basename `git rev-parse --show-toplevel`)
VERSION ?=$(shell git describe --abbrev=0)
# 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 ?=$(shell date +%FT%T%z)
GOVERSION ?=$(shell go version | cut --delimiter=" " -f3)
COMMIT ?=$(shell git rev-parse HEAD)

View File

@@ -84,10 +84,11 @@ var (
"pt-mysql-summary --host=$mysql-host --port=$mysql-port --user=$mysql-user --password=$mysql-pass",
}
Build string = "2020-04-23" //nolint
GoVersion string = "1.14.1" //nolint
Version string = "3.5.1" //nolint
Commit string //nolint
// 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
)
func main() {

View File

@@ -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`, `title`,}
.q{ UNIX_TIMESTAMP(`last_update`) AS `last_update`, SHA1(CONCAT_WS('#', `film_id`, convert(`title` using utf8mb4),}
.q{ CRC32(`description`), `release_year`, `language_id`, `original_language_id`, `rental_duration`,}
.q{ `rental_rate`, `length`, `replacement_cost`, `rating`, `special_features`, }
.q{ `rental_rate`, `length`, `replacement_cost`, convert(`rating` using utf8mb4), convert(`special_features` using utf8mb4), }
.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`, `title`))},
q{`film_id`, `title`, SHA1(CONCAT_WS('%', `film_id`, convert(`title` using utf8mb4)))},
'Separator',
);
@@ -191,7 +191,7 @@ is(
tbl => $tbl,
func => 'SHA1',
),
q{`film_id`, `title`, SHA1(CONCAT_WS('%', `film_id`, `title`))},
q{`film_id`, `title`, SHA1(CONCAT_WS('%', `film_id`, convert(`title` using utf8mb4)))},
'Bad separator',
);
@@ -204,7 +204,7 @@ is(
cols => [qw(film_id title)],
sep => "'''",
),
q{`film_id`, `title`, SHA1(CONCAT_WS('#', `film_id`, `title`))},
q{`film_id`, `title`, SHA1(CONCAT_WS('#', `film_id`, convert(`title` using utf8mb4)))},
'Really bad separator',
);

View File

@@ -229,9 +229,9 @@ is (
function => 'SHA1',
tbl_struct => $t,
),
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{`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{SHA1(CONCAT_WS('#', }
. q{`film_id`, `title`, `description`, `release_year`, `language_id`, }
. q{`film_id`, `title`, CRC32(`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`, `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`, 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{FNV_64(}
. q{`film_id`, `title`, `description`, `release_year`, `language_id`, }
. q{`film_id`, `title`, CRC32(`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`, `description`, `release_year`, `language_id`, }
. q{`film_id`, `title`, CRC32(`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`, `description`, `release_year`, `language_id`, }
. q{`film_id`, `title`, CRC32(`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`, `description`, `release_year`, `language_id`, }
. q{`film_id`, `title`, CRC32(`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`), }

View File

@@ -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 '

View File

@@ -28,6 +28,18 @@ 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
@@ -44,12 +56,14 @@ 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)"
);

View File

@@ -227,9 +227,9 @@ This tool requires Bash v3 or newer.
=head1 BUGS
For a list of known bugs, see L<http://www.percona.com/bugs/pt-stalk>.
For a list of known bugs, see L<https://jira.percona.com/projects/PT/issues>.
Please report bugs at L<https://bugs.launchpad.net/percona-toolkit>.
Please report bugs at L<https://jira.percona.com/projects/PT>.
Include the following information in your bug report:
=over

View File

@@ -28,7 +28,7 @@ elsif ( !$slave_dbh ) {
} elsif ($sandbox_version lt '5.7') {
plan skip_all => 'Only on MySQL 5.7+';
} else {
plan tests => 4;
plan tests => 5;
}
my ($master1_dbh, $master1_dsn) = $sb->start_sandbox(
@@ -76,10 +76,19 @@ $output = output(
sub { $exit_status = pt_archiver::main(@args) },
stderr => 1,
);
is(
diag("Exit status: $exit_status") if ($exit_status);
diag($output);
isnt(
$exit_status,
0,
'No need of channel name since there is only one master',
'Must specify a channel name',
);
like (
$output,
qr/"channel" was not specified/,
'Message saying channel name must be specified'
);
push @args, ('--channel', 'masterchan1');

View File

@@ -32,11 +32,30 @@ 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`;
like($output,
qr/PRIMARY \(`Host`,`Db`,`User`,`Table_name`,`Column_name`\)/,
'Finds mysql.columns_priv PK'
);
# 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'
);
}
is(`$cmd -d test --nosummary`, '', 'No dupes on clean sandbox');
@@ -45,21 +64,27 @@ $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"),
'Default output'
"$sample/basic_output.txt",
transform_sample => $transform_int
),
'Default output',
);
ok(
no_diff(
sub { pt_duplicate_key_checker::main(@args, qw(-d test --nosql)) },
"$sample/nosql_output.txt"),
"$sample/nosql_output.txt",
transform_sample => $transform_int
),
'--nosql'
);
ok(
no_diff(
sub { pt_duplicate_key_checker::main(@args, qw(-d test --nosummary)) },
"$sample/nosummary_output.txt"),
"$sample/nosummary_output.txt",
transform_sample => $transform_int
),
'--nosummary'
);
@@ -69,7 +94,8 @@ 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")
: "$sample/uppercase_names.txt"),
transform_sample => $transform_int
),
'Issue 306 crash on uppercase column names'
);
@@ -97,9 +123,10 @@ $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"
);

View File

@@ -30,6 +30,17 @@ 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
# #############################################################################
@@ -38,7 +49,8 @@ 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")
: "$sample/issue_295.txt"),
transform_sample => $transform_int
),
"Shorten, not remove, clustered dupes"
) or diag($test_diff);

View File

@@ -33,6 +33,17 @@ 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
# #############################################################################
@@ -43,6 +54,7 @@ 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)"
);

View File

@@ -33,6 +33,17 @@ 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
# #############################################################################
@@ -41,7 +52,8 @@ $sb->load_file('master', 't/pt-duplicate-key-checker/samples/issue_331.sql', 'te
ok(
no_diff(
sub { pt_duplicate_key_checker::main(@args, qw(-d issue_331)) },
't/pt-duplicate-key-checker/samples/issue_331.txt'
't/pt-duplicate-key-checker/samples/issue_331.txt',
transform_sample => $transform_int
),
'Issue 331 crash on fks'
) or diag($test_diff);

View File

@@ -12,7 +12,7 @@
# UNIQUE KEY `domain` (`domain`),
# UNIQUE KEY `unique_key_domain` (`domain`)
# Column types:
# `domain` varchar(175) character set utf8 collate utf8_bin not null
# `domain` varchar(175) character set utf8mb3 collate utf8mb3_bin not null
# To remove this duplicate index, execute:
ALTER TABLE `test`.`domains` DROP INDEX `domain`;

View File

@@ -12,7 +12,7 @@
# UNIQUE KEY `domain` (`domain`),
# UNIQUE KEY `unique_key_domain` (`domain`)
# Column types:
# `domain` varchar(175) character set utf8 collate utf8_bin not null
# `domain` varchar(175) character set utf8mb3 collate utf8mb3_bin not null
# To remove this duplicate index, execute:
ALTER TABLE `test`.`domains` DROP INDEX `domain`;

View File

@@ -26,7 +26,7 @@ ok(
no_diff(
"$cmd -- cat $sample/mext-001.txt",
"t/pt-mext/samples/mext-001-result.txt",
post_pipe => "LANG=C sort -k1,1",
post_pipe => "LOCALE=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 => "LANG=C sort -k1,1",
post_pipe => "LOCALE=C sort -k1,1",
),
"mext-002 -r"
) or diag($test_diff);

View File

@@ -0,0 +1,96 @@
#!/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 PerconaTest;
use Sandbox;
use DSNParser;
require VersionParser;
use Test::More;
use File::Temp qw( tempdir );
local $ENV{PTDEBUG} = "";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
my $has_keyring_plugin;
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
else {
plan tests => 3;
}
my $db_flavor = VersionParser->new($master_dbh)->flavor();
if ( $db_flavor =~ m/Percona Server/ ) {
my $rows = $master_dbh->selectall_hashref("SHOW PLUGINS", "name");
while (my ($key, $values) = each %$rows) {
if ($key =~ m/^keyring_/) {
$has_keyring_plugin=1;
last;
}
}
}
# mysqldump from earlier versions doesn't seem to work with 5.6,
# so use the actual mysqldump from each MySQL bin which should
# always be compatible with itself.
# We need LC_NUMERIC=POSIX, so test does not fail in environment
# which use , insead of . for numbers.
my $env = qq\CMD_MYSQLDUMP="$ENV{PERCONA_TOOLKIT_SANDBOX}/bin/mysqldump" LC_NUMERIC=POSIX\;
#
# --save-samples
#
my $dir = tempdir( "percona-testXXXXXXXX", CLEANUP => 1 );
my $output;
my $cnf = '/tmp/12345/my.sandbox.cnf';
diag(`cp $cnf $cnf.bak`);
my $cmd = "$trunk/bin/pt-mysql-summary --sleep 1 -- --defaults-file=$cnf";
diag(`echo "[mysqld]" > /tmp/12345/my.sandbox.2.cnf`);
diag(`echo "wait_timeout=12345" >> /tmp/12345/my.sandbox.2.cnf`);
diag(`echo "!include /tmp/12345/my.sandbox.2.cnf" >> $cnf`);
$output = `$cmd`;
like(
$output,
qr/wait_timeout\s+=\s+12345/s,
"!include works"
);
diag(`cp $cnf.bak $cnf`);
diag(`mkdir -p /tmp/12345/my.sandbox.3`);
diag(`echo "[mysqld]" > /tmp/12345/my.sandbox.3/my.sandbox.cnf`);
diag(`echo "wait_timeout=23456" >> /tmp/12345/my.sandbox.3/my.sandbox.cnf`);
diag(`echo "!includedir /tmp/12345/my.sandbox.3" >> $cnf`);
$output = `$cmd`;
like(
$output,
qr/wait_timeout\s+=\s+23456/s,
"!includedir works"
);
diag(`cp $cnf.bak $cnf`);
# #############################################################################
# Done.
# #############################################################################
$sb->wipe_clean($master_dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
exit;

View File

@@ -0,0 +1,43 @@
[mysqld]
####datadir=/var/lib/mysql
datadir=/mnt/data/mysql
####socket=/var/lib/mysql/mysql.sock
socket=/mnt/data/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
ssl-key = /opt/mysql.pdns/.cert/server-key.pem
ssl-cert = /opt/mysql.pdns/.cert/server-cert.pem
ssl-ca = /opt/mysql.pdns/.cert/ca-cert.pem
innodb_buffer_pool_size = 16M
innodb_flush_method = O_DIRECT
## THIS SETTING REQUIRE SPECIAL SHUTDOWN PROCEDURE AND MOVING LOGFILE. DO NOT SET UNLESS YOU UNDERSTAND WHAT YOU ARE DOING!
innodb_log_file_size = 64M
innodb_log_buffer_size = 1M
innodb_flush_log_at_trx_commit = 2
innodb_file_per_table = 1
ssl = 1
server-id = 1
log-bin=sl1-bin
wsrep_provider_options = "gcache.size=64M;base_host=10.1.2.102; base_port=4567; cert.log_conflicts=no;etc=etc;"
[mysql.server]
user=mysql
####basedir=/var/lib
basedir=/mnt/data
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysql]
[xtrabackup]
target-dir=/data/backup

View File

@@ -51,7 +51,7 @@ ok(
);
SKIP: {
skip "Skipping in MySQL 8.0.4-rc since there is an error in the server itself. See https://bugs.mysql.com/bug.php?id=89441", 9 if ($sandbox_version ge '8.0');
skip "Skipping in MySQL 8.0.4-rc since there is an error in the server itself. See https://bugs.mysql.com/bug.php?id=89441", 9 if ($sandbox_version ge '8.0' and VersionParser->new($dbh) le'8.0.14');
($output, $exit_status) = full_output(
sub { pt_online_schema_change::main(@args,
"$master_dsn,D=issue26211,t=process_model_inst",

View File

@@ -459,7 +459,7 @@ test_alter_table(
# Somewhat dangerous, but quick. Downside: table doesn't exist for a moment.
SKIP: {
skip "MySQL error https://bugs.mysql.com/bug.php?id=89441", 2 if ($sandbox_version ge '8.0');
skip "MySQL error https://bugs.mysql.com/bug.php?id=89441", 2 if ($sandbox_version ge '8.0' and VersionParser->new($master_dbh) le '8.0.14');
test_alter_table(
name => "Basic FK drop_swap --dry-run",
@@ -576,7 +576,7 @@ SKIP: {
skip 'Sandbox master does not have the sakila database', 7
unless @{$master_dbh->selectcol_arrayref("SHOW DATABASES LIKE 'sakila'")};
skip "MySQL error https://bugs.mysql.com/bug.php?id=89441", 2 if ($sandbox_version ge '8.0');
skip "MySQL error https://bugs.mysql.com/bug.php?id=89441", 2 if ($sandbox_version ge '8.0' and VersionParser->new($master_dbh) le '8.0.14');
# This test will use the drop_swap method because the child tables
# are large. To prove this, change check_fks to rebuild_constraints

View File

@@ -232,6 +232,8 @@ for my $i ( 0..4 ) {
$master_dbh->do(qq{create table `bug_1041372`.$tbl (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY )});
$master_dbh->do(qq{insert into `bug_1041372`.$tbl values (1), (2), (3), (4), (5)});
$sb->wait_for_slaves();
($output) = full_output(sub {
pt_online_schema_change::main(@args,
'--alter', "ADD COLUMN ptosc INT",
@@ -491,7 +493,8 @@ for (my $i = 0; $i < $rows; $i++) {
$big_insert .= "(NULL, 'xx')";
$master_dbh->do($big_insert);
# This big test causes slave lag error on slow boxes
$sb->wait_for_slaves();
$output = output(
sub { pt_online_schema_change::main(@args, "$master_dsn,D=bug_1340728,t=test",

View File

@@ -29,7 +29,7 @@ if ( !$sb->is_cluster_mode ) {
my ($master_dbh, $master_dsn) = $sb->start_sandbox(
server => 'cmaster',
type => 'master',
env => q/FORK="pxc" BINLOG_FORMAT="ROW"/,
env => q/BINLOG_FORMAT="ROW"/,
);
if ( !$master_dbh ) {
@@ -47,6 +47,16 @@ my $sample = "t/pt-online-schema-change/samples/";
# This is the same test we have for bug-1613915 but using DATA-DIR
$sb->load_file('cmaster', "$sample/bug-1613915.sql");
my $dir = tempdir( CLEANUP => 1 );
my $cmaster_port=$sb->port_for('cmaster');
if ($sandbox_version ge '8.0') {
diag(`/tmp/$cmaster_port/stop >/dev/null`);
diag(`echo "innodb_directories='$dir'" >> /tmp/$cmaster_port/my.sandbox.cnf`);
diag(`/tmp/$cmaster_port/start > /dev/null`);
}
$master_dbh = $sb->get_dbh_for('cmaster');
$output = output(
sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=o1",
'--execute',

View File

@@ -26,10 +26,6 @@ require "$trunk/bin/pt-online-schema-change";
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
if ($sandbox_version ge '8.0') {
plan skip_all => 'PXC 8 does not exist yet';
}
our ($master_dbh, $master_dsn) = $sb->start_sandbox(
server => 'master',
type => 'master',

View File

@@ -47,12 +47,15 @@ my @args = (qw(--set-vars innodb_lock_wait_timeout=3));
my $output;
my $exit_status;
# We need to reset master, because otherwise later RESET SLAVE call
# will let sandbox to re-apply all previous events, executed on the sandbox.
$master_dbh->do("RESET MASTER");
diag("Setting replication filters on slave 2");
$sb->load_file('slave2', "t/pt-online-schema-change/samples/pt-1455_slave.sql");
$sb->load_file('slave2', "t/pt-online-schema-change/samples/pt-1455_slave.sql", undef, no_wait => 1);
diag("Setting replication filters on slave 1");
$sb->load_file('slave1', "t/pt-online-schema-change/samples/pt-1455_slave.sql");
$sb->load_file('slave1', "t/pt-online-schema-change/samples/pt-1455_slave.sql", undef, no_wait => 1);
diag("Setting replication filters on master");
$sb->load_file('master', "t/pt-online-schema-change/samples/pt-1455_master.sql",undef, no_wait => 1);
$sb->load_file('master', "t/pt-online-schema-change/samples/pt-1455_master.sql");
diag("replication filters set");
my $num_rows = 1000;
@@ -63,6 +66,7 @@ diag(`util/mysql_random_data_load --host=127.0.0.1 --port=$master_port --user=ms
diag("$num_rows rows loaded. Starting tests.");
$master_dbh->do("FLUSH TABLES");
$sb->wait_for_slaves();
($output, $exit_status) = full_output(
sub { pt_online_schema_change::main(@args, "$master_dsn,D=employees,t=t1",
@@ -84,13 +88,14 @@ like(
qr/Successfully altered/s,
"PT-1455 Got successfully altered message.",
);
$master_dbh->do("RESET MASTER");
$master_dbh->do("DROP DATABASE IF EXISTS employees");
diag("Resetting replication filters on slave 2");
$sb->load_file('slave2', "t/pt-online-schema-change/samples/pt-1455_reset_slave.sql");
$sb->load_file('slave2', "t/pt-online-schema-change/samples/pt-1455_reset_slave.sql", undef, no_wait => 1);
diag("Resetting replication filters on slave 1");
$sb->load_file('slave1', "t/pt-online-schema-change/samples/pt-1455_reset_slave.sql");
$sb->load_file('slave1', "t/pt-online-schema-change/samples/pt-1455_reset_slave.sql", undef, no_wait => 1);
$sb->wait_for_slaves();
# #############################################################################
# Done.

View File

@@ -29,8 +29,12 @@ my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox';
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
} elsif ($sandbox_version ge '8.0') {
plan skip_all => 'Drop swap does not work with MySQL 8.0+';
}
my $vp = VersionParser->new($master_dbh);
if ($vp->cmp('8.0') > -1 && $vp->cmp('8.0.14') < 0 && $vp->flavor() !~ m/maria/i) {
plan skip_all => 'Drop swap does not work with MySQL 8.0 - 8.0.13';
} else {
plan tests => 3;
}

View File

@@ -317,7 +317,11 @@ sub test_alter_table {
SKIP: {
skip 'Sandbox MySQL version should be >= 5.7' unless $sandbox_version ge '5.7';
# drop_swap won't work with MySQL 8.0+
skip 'Sandbox MySQL version should be < 8.0' unless $sandbox_version lt '8.0';
my $vp = VersionParser->new($master_dbh);
if ($vp->cmp('8.0') > -1 && $vp->cmp('8.0.14') < 0 && $vp->flavor() !~ m/maria/i) {
skip 'Drop swap does not work with MySQL 8.0 - 8.0.13';
}
$sb->load_file('master', "$sample/pt-1919.sql");

View File

@@ -124,7 +124,8 @@ like(
my $rows = $master_dbh->selectrow_arrayref('SHOW CREATE TABLE test.test_a');
like(
@$rows[1],
qr/ `zzz` int\(11\) DEFAULT NULL,/im,
($sandbox_version ge '8.0') ? qr/ `zzz` int DEFAULT NULL,/im :
qr/ `zzz` int\(11\) DEFAULT NULL,/im,
"PT-229 New field was added",
);

View File

@@ -38,6 +38,16 @@ my $master_basedir = "/tmp/$master3_port";
diag(`$trunk/sandbox/stop-sandbox $master3_port >/dev/null`);
diag(`$trunk/sandbox/start-sandbox master $master3_port >/dev/null`);
my $new_dir='/tmp/tdir';
diag(`rm -rf $new_dir`);
diag(`mkdir -p $new_dir`);
if ($sandbox_version ge '8.0') {
diag(`/tmp/$master3_port/stop >/dev/null`);
diag(`echo "innodb_directories='$new_dir'" >> /tmp/$master3_port/my.sandbox.cnf`);
diag(`/tmp/$master3_port/start >/dev/null`);
}
my $dbh3 = $sb->get_dbh_for("master3");
my $dsn3 = $sb->dsn_for("master3");
@@ -62,10 +72,6 @@ diag("$num_rows rows loaded. Starting tests.");
$dbh3->do("FLUSH TABLES");
my $new_dir='/tmp/tdir';
diag(`rm -rf $new_dir`);
diag(`mkdir -p $new_dir`);
diag("2");
($output, $exit_status) = full_output(
sub { pt_online_schema_change::main(@args, "$dsn3,D=test,t=t3",

View File

@@ -146,14 +146,14 @@ is_deeply(
my ($master_dbh, $master_dsn) = $sb->start_sandbox(
server => 'cmaster',
type => 'master',
env => q/FORK="pxc" BINLOG_FORMAT="ROW"/,
env => q/BINLOG_FORMAT="ROW"/,
);
$sb->set_as_slave('node1', 'cmaster');
$sb->load_file('cmaster', "$sample/basic_with_fks.sql", undef, no_wait => 1);
$master_dbh->do("SET SESSION binlog_format=STATEMENT");
$master_dbh->do('SET @@binlog_format:="STATEMENT"');
$master_dbh->do("REPLACE INTO percona_test.sentinel (id, ping) VALUES (1, '')");
$sb->wait_for_slaves(master => 'cmaster', slave => 'node1');

View File

@@ -23,7 +23,7 @@ my $master_dbh = $sb->get_dbh_for('master');
my $vp = VersionParser->new($master_dbh);
if ($vp->cmp('8.0.14') > -1 && $vp->flavor() !~ m/maria/i) {
if ($vp->cmp('8.0') > -1 && $vp->cmp('8.0.14') < 0 && $vp->flavor() !~ m/maria/i) {
plan skip_all => 'Cannot run this test under the current MySQL version';
}

View File

@@ -3,7 +3,7 @@ CREATE DATABASE pt_osc;
USE pt_osc;
CREATE TABLE t (
id int auto_increment primary key,
c char(32),
c char(32) not null,
d date,
unique index (c(32))
) ENGINE=InnoDB;

View File

@@ -22,8 +22,7 @@ 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';
plan tests => 6;
}
our $delay = 30;
@@ -54,16 +53,19 @@ sub reset_query_cache {
# 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');
$master_dbh->do("RESET MASTER");
$slave_dbh->do('RESET SLAVE');
$slave_dbh->do('START SLAVE');
diag('Loading test data');
$sb->load_file('master', "t/pt-online-schema-change/samples/slave_lag.sql");
# Should be greater than chunk-size and big enough, so pt-osc will wait for delay
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`);
$sb->wait_for_slaves();
diag("Setting slave delay to $delay seconds");
$slave_dbh->do('STOP SLAVE');
@@ -73,17 +75,21 @@ $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);
# Update one row so slave is delayed
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 LIMIT 1');
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""');
# This is the base test, ust to ensure that without using --check-slave-lag nor --skip-check-slave-lag
# This is the base test, just 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 = "$master_dsn,D=test,t=pt178 --execute --chunk-size 10 --max-lag $max_lag --alter 'ENGINE=InnoDB' --pid $tmp_file_name";
# We need to sleep, otherwise pt-osc can finish before slave is delayed
sleep($max_lag);
my $args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 10 --max-lag $max_lag --alter 'ENGINE=InnoDB' --pid $tmp_file_name --progress time,5";
diag("Starting base test. This is going to take some time due to the delay in the slave");
diag("pid: $tmp_file_name");
my $output = `$trunk/bin/pt-online-schema-change $args 2>&1`;
like(
$output,
qr/Replica lag is \d+ seconds on .* Waiting/s,
@@ -92,12 +98,16 @@ like(
# Repeat the test now using --check-slave-lag
$args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag $max_lag --alter 'ENGINE=InnoDB' "
. "--check-slave-lag h=127.0.0.1,P=12346,u=msandbox,p=msandbox,D=test,t=sbtest --pid $tmp_file_name";
. "--check-slave-lag h=127.0.0.1,P=12346,u=msandbox,p=msandbox,D=test,t=sbtest --pid $tmp_file_name --progress time,5";
# Run a full table scan query to ensure the slave is behind the master
reset_query_cache($master_dbh, $master_dbh);
# Update one row so slave is delayed
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 LIMIT 1');
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""');
# We need to sleep, otherwise pt-osc can finish before slave is delayed
sleep($max_lag);
diag("Starting --check-slave-lag test. This is going to take some time due to the delay in the slave");
$output = `$trunk/bin/pt-online-schema-change $args 2>&1`;
@@ -109,15 +119,19 @@ like(
# Repeat the test new adding and removing a slave during the process
$args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag $max_lag --alter 'ENGINE=InnoDB' "
. "--recursion-method=dsn=D=test,t=dynamic_replicas --recurse 0 --pid $tmp_file_name";
. "--recursion-method=dsn=D=test,t=dynamic_replicas --recurse 0 --pid $tmp_file_name --progress time,5";
$master_dbh->do('CREATE TABLE `test`.`dynamic_replicas` (id INTEGER PRIMARY KEY, dsn VARCHAR(255) )');
$master_dbh->do("INSERT INTO `test`.`dynamic_replicas` (id, dsn) VALUES (1, '$slave_dsn')");
# Run a full table scan query to ensure the slave is behind the master
reset_query_cache($master_dbh, $master_dbh);
# Update one row so slave is delayed
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 LIMIT 1');
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""');
# We need to sleep, otherwise pt-osc can finish before slave is delayed
sleep($max_lag);
diag("Starting --recursion-method with changes during the process");
my ($fh, $filename) = tempfile();
my $pid = fork();
@@ -128,7 +142,7 @@ if (!$pid) {
exec("$trunk/bin/pt-online-schema-change $args");
}
sleep(60);
sleep($max_lag + 10);
$master_dbh->do("DELETE FROM `test`.`dynamic_replicas` WHERE id = 1;");
waitpid($pid, 0);
$output = do {
@@ -153,10 +167,14 @@ like(
# Repeat the test now using --skip-check-slave-lag
# Run a full table scan query to ensure the slave is behind the master
reset_query_cache($master_dbh, $master_dbh);
# Update one row so slave is delayed
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 LIMIT 1');
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""');
# We need to sleep, otherwise pt-osc can finish before slave is delayed
sleep($max_lag);
$args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag $max_lag --alter 'ENGINE=InnoDB' "
. "--skip-check-slave-lag h=127.0.0.1,P=12346,u=msandbox,p=msandbox,D=test,t=sbtest --pid $tmp_file_name";
. "--skip-check-slave-lag h=127.0.0.1,P=12346,u=msandbox,p=msandbox,D=test,t=sbtest --pid $tmp_file_name --progress time,5";
diag("Starting --skip-check-slave-lag test. This is going to take some time due to the delay in the slave");
$output = `$trunk/bin/pt-online-schema-change $args 2>&1`;
@@ -169,10 +187,12 @@ unlike(
diag("Setting slave delay to 0 seconds");
$slave_dbh->do('STOP SLAVE');
$master_dbh->do("RESET MASTER");
$slave_dbh->do('RESET SLAVE');
$slave_dbh->do('START SLAVE');
$master_dbh->do("DROP DATABASE IF EXISTS test");
$sb->wait_for_slaves();
# #############################################################################
# Done.

View File

@@ -54,16 +54,16 @@ $output = output(
my $expected_80 = <<'END_OUTPUT_0';
-- Grants for 'bob'@'%'
CREATE USER IF NOT EXISTS 'bob'@'%';
ALTER USER 'bob'@'%' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT;
CREATE USER IF NOT EXISTS `bob`@`%`;
ALTER USER `bob`@`%` IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT;
GRANT USAGE ON *.* TO `bob`@`%`;
-- Grants for 'bob'@'192.168.1.1'
CREATE USER IF NOT EXISTS 'bob'@'192.168.1.1';
ALTER USER 'bob'@'192.168.1.1' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT;
CREATE USER IF NOT EXISTS `bob`@`192.168.1.1`;
ALTER USER `bob`@`192.168.1.1` IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT;
GRANT USAGE ON *.* TO `bob`@`192.168.1.1`;
-- Grants for 'bob'@'localhost'
CREATE USER IF NOT EXISTS 'bob'@'localhost';
ALTER USER 'bob'@'localhost' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT;
CREATE USER IF NOT EXISTS `bob`@`localhost`;
ALTER USER `bob`@`localhost` IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT;
GRANT USAGE ON *.* TO `bob`@`localhost`;
END_OUTPUT_0
@@ -105,8 +105,8 @@ $output = output(
$expected_80 = <<'END_OUTPUT_5';
-- Grants for 'bob'@'192.168.1.1'
CREATE USER IF NOT EXISTS 'bob'@'192.168.1.1';
ALTER USER 'bob'@'192.168.1.1' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT;
CREATE USER IF NOT EXISTS `bob`@`192.168.1.1`;
ALTER USER `bob`@`192.168.1.1` IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT;
GRANT USAGE ON *.* TO `bob`@`192.168.1.1`;
END_OUTPUT_5

View File

@@ -1,6 +1,6 @@
-- Grants for 'sally'@'%'
CREATE USER IF NOT EXISTS 'sally'@'%';
ALTER USER 'sally'@'%' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT;
CREATE USER IF NOT EXISTS `sally`@`%`;
ALTER USER `sally`@`%` IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT;
GRANT INSERT (`city`), SELECT (`city_id`) ON `sakila`.`city` TO `sally`@`%`;
GRANT SELECT (`DateCreated`, `PaymentStat`, `PckPrice`, `SANumber`) ON `test`.`t` TO `sally`@`%`;
GRANT USAGE ON *.* TO `sally`@`%`;

View File

@@ -1,6 +1,6 @@
-- Grants for 'sally'@'%'
CREATE USER IF NOT EXISTS 'sally'@'%';
ALTER USER 'sally'@'%' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT;
CREATE USER IF NOT EXISTS `sally`@`%`;
ALTER USER `sally`@`%` IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT;
GRANT INSERT (`city`), SELECT, SELECT (`city_id`) ON `sakila`.`city` TO `sally`@`%`;
GRANT SELECT (`DateCreated`, `PaymentStat`, `PckPrice`, `SANumber`) ON `test`.`t` TO `sally`@`%`;
GRANT USAGE ON *.* TO `sally`@`%`;

View File

@@ -1,6 +1,6 @@
-- Grants for 'sally'@'%'
CREATE USER IF NOT EXISTS 'sally'@'%';
ALTER USER 'sally'@'%' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT;
CREATE USER IF NOT EXISTS `sally`@`%`;
ALTER USER `sally`@`%` IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT;
GRANT INSERT (`city`) ON `sakila`.`city` TO `sally`@`%`;
GRANT SELECT (`DateCreated`, `PaymentStat`, `PckPrice`, `SANumber`) ON `test`.`t` TO `sally`@`%`;
GRANT SELECT (`city_id`) ON `sakila`.`city` TO `sally`@`%`;

View File

@@ -4,8 +4,8 @@ REVOKE SELECT (`DateCreated`, `PaymentStat`, `PckPrice`, `SANumber`) ON `test`.`
REVOKE SELECT (`city_id`) ON `sakila`.`city` FROM `sally`@`%`;
REVOKE USAGE ON *.* FROM `sally`@`%`;
-- Grants for 'sally'@'%'
CREATE USER IF NOT EXISTS 'sally'@'%';
ALTER USER 'sally'@'%' IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT;
CREATE USER IF NOT EXISTS `sally`@`%`;
ALTER USER `sally`@`%` IDENTIFIED WITH 'mysql_native_password' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT;
GRANT INSERT (`city`) ON `sakila`.`city` TO `sally`@`%`;
GRANT SELECT (`DateCreated`, `PaymentStat`, `PckPrice`, `SANumber`) ON `test`.`t` TO `sally`@`%`;
GRANT SELECT (`city_id`) ON `sakila`.`city` TO `sally`@`%`;

View File

@@ -1,8 +1,7 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set. See http://code.google.
com/p/maatkit/wiki/Testing"
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";

View File

@@ -1,8 +1,7 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set. See http://code.google.
com/p/maatkit/wiki/Testing"
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";

View File

@@ -20,7 +20,7 @@ if ( $sandbox_version lt '5.6' ) {
}
diag('Restarting the sandbox');
diag(`SAKILA=0 GTID=1 $trunk/sandbox/test-env restart`);
diag(`SAKILA=0 REPLICATION_THREADS=0 GTID=1 $trunk/sandbox/test-env restart`);
diag("Sandbox restarted");
my $dp = new DSNParser(opts=>$dsn_opts);

View File

@@ -15,6 +15,10 @@ use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-slave-restart";
diag('Restarting the sandbox');
diag(`SAKILA=0 REPLICATION_THREADS=0 GTID=1 $trunk/sandbox/test-env restart`);
diag("Sandbox restarted");
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
@@ -137,7 +141,6 @@ is(
# Done.
# #############################################################################
diag(`rm -f /tmp/pt-slave-re*`);
$sb->wipe_clean($master_dbh);
$sb->wipe_clean($slave_dbh);
diag(`$trunk/sandbox/test-env restart`);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
done_testing;

Some files were not shown because too many files have changed in this diff Show More