mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-02 10:36:28 +00:00
Compare commits
155 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3ebe939ce7 | ||
![]() |
b33e63cdf2 | ||
![]() |
ab92feb875 | ||
![]() |
5498a4da81 | ||
![]() |
45a8579af7 | ||
![]() |
8ad1481c6c | ||
![]() |
2b5c8f69ab | ||
![]() |
eec92a7387 | ||
![]() |
d3741ca915 | ||
![]() |
36088049cc | ||
![]() |
964ed4c05c | ||
![]() |
3e0490dd3a | ||
![]() |
e3a693afcf | ||
![]() |
8fa2c63a5c | ||
![]() |
c6451a11d2 | ||
![]() |
41fdd9f46c | ||
![]() |
e623a91511 | ||
![]() |
2cb3533611 | ||
![]() |
ffc0fd9ae2 | ||
![]() |
df20b8af28 | ||
![]() |
11695b5b5c | ||
![]() |
e5724f41cf | ||
![]() |
43b313f3d5 | ||
![]() |
39aa83ffca | ||
![]() |
aac8b6a85a | ||
![]() |
f0539f7e34 | ||
![]() |
e1548d953f | ||
![]() |
672be1a2b2 | ||
![]() |
022dc7377b | ||
![]() |
bc90a923b1 | ||
![]() |
8c806df658 | ||
![]() |
dc9edf7cda | ||
![]() |
b5a1775bad | ||
![]() |
7260bab2dc | ||
![]() |
83923a6ac3 | ||
![]() |
287224d6de | ||
![]() |
dcd83a3e57 | ||
![]() |
d589034b31 | ||
![]() |
03ff3c314a | ||
![]() |
d2c4f57a52 | ||
![]() |
ea4886ad9d | ||
![]() |
2b45f192b0 | ||
![]() |
909125faf9 | ||
![]() |
6c4c30ce28 | ||
![]() |
2ec16a0ece | ||
![]() |
85dedaed92 | ||
![]() |
6d9afc9507 | ||
![]() |
6e5c5c5e6d | ||
![]() |
7cea40255b | ||
![]() |
d4d9d74543 | ||
![]() |
faad4f5445 | ||
![]() |
a584680406 | ||
![]() |
a52a6438ce | ||
![]() |
e4263ae173 | ||
![]() |
9b20208a78 | ||
![]() |
19719a1c2c | ||
![]() |
51b9c91a98 | ||
![]() |
8e90b31b3b | ||
![]() |
66277e6304 | ||
![]() |
57bb51f467 | ||
![]() |
d3644bd2e8 | ||
![]() |
9d8410c915 | ||
![]() |
f0981642e5 | ||
![]() |
fbf67524f0 | ||
![]() |
d0bebbdc04 | ||
![]() |
440194097e | ||
![]() |
c221d10789 | ||
![]() |
53278a9d18 | ||
![]() |
d1cc7bfee7 | ||
![]() |
345b7c1d0a | ||
![]() |
9ee287ffdb | ||
![]() |
41df469802 | ||
![]() |
d58d9e9fc4 | ||
![]() |
9ac2445550 | ||
![]() |
6776631ec0 | ||
![]() |
1b802d56df | ||
![]() |
4f017cc61a | ||
![]() |
d9142df0f6 | ||
![]() |
c1d0134525 | ||
![]() |
6d30d18834 | ||
![]() |
2bb073e218 | ||
![]() |
a90e5a78a0 | ||
![]() |
14c1365a42 | ||
![]() |
82a3cda72d | ||
![]() |
ed4268836f | ||
![]() |
602c1f0ea2 | ||
![]() |
07a149f9a7 | ||
![]() |
5a47bac4d4 | ||
![]() |
accdd7712b | ||
![]() |
f5fd795fda | ||
![]() |
588714cfad | ||
![]() |
5188d6836f | ||
![]() |
5299572b31 | ||
![]() |
0758e2c714 | ||
![]() |
82464dc256 | ||
![]() |
f95d448e03 | ||
![]() |
81582f3ce3 | ||
![]() |
9d02b690e0 | ||
![]() |
aa82c9c318 | ||
![]() |
42b20e1ee0 | ||
![]() |
97cdc1d14d | ||
![]() |
819d41826e | ||
![]() |
90d818d574 | ||
![]() |
0004bb7bbc | ||
![]() |
b801dfa156 | ||
![]() |
1a4c471a46 | ||
![]() |
d62c2d0692 | ||
![]() |
47fe4379fa | ||
![]() |
4bfca1ac00 | ||
![]() |
f4e7230bbd | ||
![]() |
af62172435 | ||
![]() |
08b00e7fab | ||
![]() |
6e9828795d | ||
![]() |
6a39b12f4e | ||
![]() |
d3685c1ca8 | ||
![]() |
56fb394e32 | ||
![]() |
123a599d3e | ||
![]() |
77afc948fc | ||
![]() |
7666af3fbb | ||
![]() |
b2decb0f82 | ||
![]() |
a4293bbe9e | ||
![]() |
eb689ef253 | ||
![]() |
88ae2c3783 | ||
![]() |
f3bca3af41 | ||
![]() |
f5ed3d987c | ||
![]() |
cb5e0077fd | ||
![]() |
abd84d03a8 | ||
![]() |
0be68be892 | ||
![]() |
445d38f359 | ||
![]() |
b9b152a395 | ||
![]() |
b79a6c621b | ||
![]() |
5afd9615de | ||
![]() |
4c4ba955b7 | ||
![]() |
6a4c4508d4 | ||
![]() |
b345824169 | ||
![]() |
e2cf183762 | ||
![]() |
b6040629cd | ||
![]() |
285588546d | ||
![]() |
2493c2485f | ||
![]() |
dc5491e13e | ||
![]() |
b1663d0f20 | ||
![]() |
09cd07f58e | ||
![]() |
cbe2333e92 | ||
![]() |
f0c947d9cf | ||
![]() |
6679596b3b | ||
![]() |
b547b7c21c | ||
![]() |
9d1c67613b | ||
![]() |
f9f05b7289 | ||
![]() |
b9447bf8c5 | ||
![]() |
a4db86e026 | ||
![]() |
0e7fc6d159 | ||
![]() |
c2fd796654 | ||
![]() |
910c2f0f3f | ||
![]() |
df7744e4b1 | ||
![]() |
feb15958db |
11
.travis.yml
11
.travis.yml
@@ -2,6 +2,7 @@ language: go
|
||||
|
||||
go:
|
||||
- 1.9.x
|
||||
- 1.10.x
|
||||
|
||||
services:
|
||||
- docker
|
||||
@@ -15,13 +16,6 @@ env:
|
||||
- MONGODB_IMAGE=percona/percona-server-mongodb:3.2
|
||||
- MONGODB_IMAGE=percona/percona-server-mongodb:3.4
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- go: 1.8.x
|
||||
env:
|
||||
- go: tip
|
||||
env:
|
||||
|
||||
install:
|
||||
- go get -u github.com/golang/dep/cmd/dep
|
||||
|
||||
@@ -39,6 +33,9 @@ before_script:
|
||||
script:
|
||||
- go test -timeout 1m ./src/...
|
||||
|
||||
allow_failures:
|
||||
- tip
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
slack:
|
||||
|
19
Changelog
19
Changelog
@@ -1,6 +1,23 @@
|
||||
Changelog for Percona Toolkit
|
||||
|
||||
v3.0.10
|
||||
* Fixed bug PT-1611: pt-archiver fails with UTF-8 chars
|
||||
* Fixed bug PT-1574: pt-online-schema-change fails on UK and NULLs
|
||||
* Fixed bug PT-1572: Better usage of ENUM fields in keys in NibbleIterator
|
||||
* Fixed bug PT-1422: pt-mysql-summary may get stuck when Time: NULL in processlist
|
||||
* Improvement PT-1321: Add required MySQL privileges to pt-online-schema-change documentation
|
||||
|
||||
v3.0.11 released 2018-07-06
|
||||
|
||||
* Improvement PT-1571 : Improved hostname recognition in pt-secure-collect
|
||||
* Fixed bug PT-1570 : pt-archiver fails to detect columns with the word GENERATED as part of the comment
|
||||
* Improvement PT-1569 : Disabled --alter-foreign-keys-method=drop_swap in pt-osc
|
||||
* Fixed bug PT-1563 : Fixed pt-show-grants for MySQL 5.6
|
||||
* Improvement PT-1562 : pt-mysql-summary: Fix mysqld command for Travis
|
||||
* Fixed bug PT-1551 : pt-table-checksum fails on MySQL 8.0.11
|
||||
* Improvement PT-242 : (pt-stalk) Include SHOW SLAVE STATUS on 5.7 (Thanks Marcelo Altmann)
|
||||
* Fixed bug PT-241 : (pt-stalk) Slave queries doesn't run on 5.7 (Thanks Marcelo Altmann)
|
||||
|
||||
v3.0.10 released 2018-05-21
|
||||
|
||||
* Fixed bug PT-1556 : pt-table-checksum 3.0.9 doesn't change binlog_format to statement anymore
|
||||
* Improvement PT-1546 : Improved support of MySQL 8 roles
|
||||
|
@@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
|
||||
|
||||
WriteMakefile(
|
||||
NAME => 'percona-toolkit',
|
||||
VERSION => '3.0.9',
|
||||
VERSION => '3.0.12',
|
||||
EXE_FILES => [ <bin/*> ],
|
||||
MAN1PODS => {
|
||||
'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p',
|
||||
|
@@ -1359,6 +1359,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-align 3.0.9
|
||||
pt-align 3.0.12
|
||||
|
||||
=cut
|
||||
|
1766
bin/pt-archiver
1766
bin/pt-archiver
File diff suppressed because it is too large
Load Diff
1750
bin/pt-config-diff
1750
bin/pt-config-diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1750
bin/pt-diskstats
1750
bin/pt-diskstats
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1648,6 +1648,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-fifo-split 3.0.9
|
||||
pt-fifo-split 3.0.12
|
||||
|
||||
=cut
|
||||
|
1752
bin/pt-find
1752
bin/pt-find
File diff suppressed because it is too large
Load Diff
@@ -2239,6 +2239,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-fingerprint 3.0.9
|
||||
pt-fingerprint 3.0.12
|
||||
|
||||
=cut
|
||||
|
File diff suppressed because it is too large
Load Diff
1766
bin/pt-heartbeat
1766
bin/pt-heartbeat
File diff suppressed because it is too large
Load Diff
1752
bin/pt-index-usage
1752
bin/pt-index-usage
File diff suppressed because it is too large
Load Diff
@@ -1127,7 +1127,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-ioprofile 3.0.9
|
||||
pt-ioprofile 3.0.12
|
||||
|
||||
=cut
|
||||
|
||||
|
1752
bin/pt-kill
1752
bin/pt-kill
File diff suppressed because it is too large
Load Diff
@@ -804,7 +804,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-mext 3.0.9
|
||||
pt-mext 3.0.12
|
||||
|
||||
=cut
|
||||
|
||||
|
@@ -827,7 +827,7 @@ setup_data_dir () {
|
||||
get_var () {
|
||||
local varname="$1"
|
||||
local file="$2"
|
||||
awk -v pattern="${varname}" '$1 == pattern { if (length($2)) { len = length($1); print substr($0, len+index(substr($0, len+1), $2)) } }' "${file}"
|
||||
awk -v pattern="${varname}" '$1 == pattern { if (length($2)) { len = length($1); print substr($0, len+index(substr($0, len+1), $2)) } }' "${file}" | tr -d '\r'
|
||||
}
|
||||
|
||||
# ###########################################################################
|
||||
@@ -1366,6 +1366,9 @@ summarize_processlist () {
|
||||
}
|
||||
\$1 == \"Time:\" {
|
||||
t = \$2;
|
||||
if ( t == \"NULL\" ) {
|
||||
t = 0;
|
||||
}
|
||||
}
|
||||
\$1 == \"Command:\" {
|
||||
c = \$2;
|
||||
@@ -2265,7 +2268,7 @@ report_jemalloc_enabled() {
|
||||
local GENERAL_JEMALLOC_STATUS=0
|
||||
local JEMALLOC_LOCATION=''
|
||||
|
||||
for PID in $(pidof mysqld); do
|
||||
for pid in $(pidof mysqld); do
|
||||
grep -qc jemalloc /proc/${pid}/environ || ldd $(which mysqld) 2>/dev/null | grep -qc jemalloc
|
||||
jemalloc_status=$?
|
||||
if [ $jemalloc_status = 1 ]; then
|
||||
@@ -2580,14 +2583,14 @@ check_mysql () {
|
||||
# Check that mysql and mysqldump are in PATH. If not, we're
|
||||
# already dead in the water, so don't bother with cmd line opts,
|
||||
# just error and exit.
|
||||
[ -n "$(mysql --help 2>/dev/null)" ] \
|
||||
[ -n "$(${CMD_MYSQL} --help 2>/dev/null)" ] \
|
||||
|| die "Cannot execute mysql. Check that it is in PATH."
|
||||
[ -n "$(mysqldump --help 2>/dev/null)" ] \
|
||||
[ -n "$(${CMD_MYSQLDUMP} --help 2>/dev/null)" ] \
|
||||
|| die "Cannot execute mysqldump. Check that it is in PATH."
|
||||
|
||||
# Now that we have the cmd line opts, check that we can actually
|
||||
# connect to MySQL.
|
||||
[ -n "$(mysql $EXT_ARGV -e 'SHOW STATUS')" ] \
|
||||
[ -n "$(${CMD_MYSQL} ${EXT_ARGV} -e 'SHOW STATUS')" ] \
|
||||
|| die "Cannot connect to MySQL. Check that MySQL is running and that the options after -- are correct."
|
||||
|
||||
}
|
||||
@@ -3287,7 +3290,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-mysql-summary 3.0.9
|
||||
pt-mysql-summary 3.0.12
|
||||
|
||||
=cut
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -897,7 +897,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-pmp 3.0.9
|
||||
pt-pmp 3.0.12
|
||||
|
||||
=cut
|
||||
|
||||
|
1780
bin/pt-query-digest
1780
bin/pt-query-digest
File diff suppressed because it is too large
Load Diff
@@ -1912,11 +1912,14 @@ sub main {
|
||||
# MySQL 8 roles must be excluded from the regular users list.
|
||||
# Roles can be identified because the user password is expired, the authentication
|
||||
# string is empty and the account is locked
|
||||
my $mysql8_where = '';
|
||||
if (VersionCompare::cmp($version, '8.0.0') >= 0) {
|
||||
$mysql8_where = ' WHERE NOT ( `account_locked`="Y" AND ' .
|
||||
' `password_expired`="Y" AND ' .
|
||||
' `authentication_string`="" ) ';
|
||||
}
|
||||
my $users = $o->get('only') || $dbh->selectall_arrayref(
|
||||
'SELECT DISTINCT User, Host FROM mysql.user WHERE NOT (`account_locked`="Y"
|
||||
AND `password_expired`="Y"
|
||||
AND `authentication_string`=""
|
||||
) ORDER BY User, Host',
|
||||
"SELECT DISTINCT User, Host FROM mysql.user $mysql8_where ORDER BY User, Host",
|
||||
{ Slice => {} });
|
||||
if ( scalar @all_hosts ) {
|
||||
my $where = join(' OR ', map { "User='$_'" } @all_hosts);
|
||||
@@ -2588,6 +2591,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-show-grants 3.0.9
|
||||
pt-show-grants 3.0.12
|
||||
|
||||
=cut
|
||||
|
@@ -1245,7 +1245,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-sift 3.0.9
|
||||
pt-sift 3.0.12
|
||||
|
||||
=cut
|
||||
|
||||
|
1750
bin/pt-slave-delay
1750
bin/pt-slave-delay
File diff suppressed because it is too large
Load Diff
@@ -4482,6 +4482,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-slave-find 3.0.9
|
||||
pt-slave-find 3.0.12
|
||||
|
||||
=cut
|
||||
|
1750
bin/pt-slave-restart
1750
bin/pt-slave-restart
File diff suppressed because it is too large
Load Diff
25
bin/pt-stalk
25
bin/pt-stalk
@@ -833,7 +833,7 @@ collect() {
|
||||
tail -f "$mysql_error_log" >"$d/$p-log_error" &
|
||||
tail_error_log_pid=$!
|
||||
|
||||
$CMD_MYSQLADMIN $EXT_ARGV debug
|
||||
$CMD_MYSQLADMIN $EXT_ARGV
|
||||
else
|
||||
log "Could not find the MySQL error log"
|
||||
fi
|
||||
@@ -916,7 +916,7 @@ collect() {
|
||||
local ps_instrumentation_enabled=$($CMD_MYSQL $EXT_ARGV -e 'SELECT ENABLED FROM performance_schema.setup_instruments WHERE NAME = "transaction";' \
|
||||
| sed "2q;d" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
||||
|
||||
if [ $ps_instrumentation_enabled != "yes" ]; then
|
||||
if [ !$ps_instrumentation_enabled = "yes" ]; then
|
||||
log "Performance Schema instrumentation is disabled"
|
||||
fi
|
||||
|
||||
@@ -1162,26 +1162,25 @@ slave_status() {
|
||||
local outfile=$1
|
||||
local mysql_version=$2
|
||||
|
||||
if [ "${mysql_version}" '<' "5.7" ]; then
|
||||
local sql="SHOW SLAVE STATUS\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
else
|
||||
local sql="SHOW SLAVE STATUS\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
if [ "${mysql_version}" '>' "5.6" ]; then
|
||||
local sql="SELECT * FROM performance_schema.replication_connection_configuration JOIN performance_schema.replication_applier_configuration USING(channel_name)\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
sql="SELECT * FROM replication_connection_status\G"
|
||||
sql="SELECT * FROM performance_schema.replication_connection_status\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
sql="SELECT * FROM replication_applier_status JOIN replication_applier_status_by_coordinator USING(channel_name)\G"
|
||||
sql="SELECT * FROM performance_schema.replication_applier_status JOIN performance_schema.replication_applier_status_by_coordinator USING(channel_name)\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
collect_mysql_variables() {
|
||||
local outfile=$1
|
||||
|
||||
@@ -2283,6 +2282,10 @@ of editing the source, you can call pt-stalk as
|
||||
which will do exactly what you need. Combined with the plugin hooks, this
|
||||
gives you a fine-grained control of what the tool does.
|
||||
|
||||
It is possible to enable C<debug> mode in mysqladmin specifying:
|
||||
|
||||
C<CMD_MYSQLADMIN='mysqladmin debug' pt-stalk params ...>
|
||||
|
||||
=head1 SYSTEM REQUIREMENTS
|
||||
|
||||
This tool requires Bash v3 or newer. Certain options require other programs:
|
||||
@@ -2376,7 +2379,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-stalk 3.0.9
|
||||
pt-stalk 3.0.12
|
||||
|
||||
=cut
|
||||
|
||||
|
@@ -2723,7 +2723,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-summary 3.0.9
|
||||
pt-summary 3.0.12
|
||||
|
||||
=cut
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
1752
bin/pt-table-sync
1752
bin/pt-table-sync
File diff suppressed because it is too large
Load Diff
@@ -6850,7 +6850,7 @@ sub remove_quoted_text {
|
||||
my ($string) = @_;
|
||||
$string =~ s/[^\\]`[^`]*[^\\]`//g;
|
||||
$string =~ s/[^\\]"[^"]*[^\\]"//g;
|
||||
$string =~ s/[^\\]"[^"]*[^\\]"//g;
|
||||
$string =~ s/[^\\]'[^']*[^\\]'//g;
|
||||
return $string;
|
||||
}
|
||||
|
||||
@@ -8487,6 +8487,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-table-usage 3.0.9
|
||||
pt-table-usage 3.0.12
|
||||
|
||||
=cut
|
||||
|
1750
bin/pt-upgrade
1750
bin/pt-upgrade
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3281,6 +3281,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
pt-visual-explain 3.0.9
|
||||
pt-visual-explain 3.0.12
|
||||
|
||||
=cut
|
||||
|
@@ -1,3 +1,45 @@
|
||||
percona-toolkit (3.0.12-1) unstable; urgency=low
|
||||
|
||||
* Fixed bug PT-1611: pt-archiver fails with UTF-8 chars
|
||||
* Fixed bug PT-1603: pt-table-sync is not considering unsorted enum fields in indexes for calculating chunk boundaries
|
||||
* Fixed bug PT-1574: pt-online-schema-change fails on UK and NULLs
|
||||
* Fixed bug PT-1572: Better usage of ENUM fields in keys in NibbleIterator
|
||||
* Fixed bug PT-1422: pt-mysql-summary may get stuck when Time: NULL in processlist
|
||||
* Improvement PT-1321: Add required MySQL privileges to pt-online-schema-change documentation
|
||||
|
||||
-- Percona Toolkit Developers <toolkit-dev@percona.com> Tue, 11 Sep 2018 11:20:08 +0000
|
||||
|
||||
percona-toolkit (3.0.11-1) unstable; urgency=low
|
||||
|
||||
* Improvement PT-1571 : Improved hostname recognition in pt-secure-collect
|
||||
* Fixed bug PT-1570 : pt-archiver fails to detect columns with the word GENERATED as part of the comment
|
||||
* Improvement PT-1569 : Disabled --alter-foreign-keys-method=drop_swap in pt-osc
|
||||
* Fixed bug PT-1563 : Fixed pt-show-grants for MySQL 5.6
|
||||
* Improvement PT-1562 : pt-mysql-summary: Fix mysqld command for Travis
|
||||
* Fixed bug PT-1551 : pt-table-checksum fails on MySQL 8.0.11
|
||||
* Improvement PT-242 : (pt-stalk) Include SHOW SLAVE STATUS on 5.7 (Thanks Marcelo Altmann)
|
||||
* Fixed bug PT-241 : (pt-stalk) Slave queries doesn't run on 5.7 (Thanks Marcelo Altmann)
|
||||
|
||||
-- Percona Toolkit Developers <toolkit-dev@percona.com> Fri, 06 Jul 2018 15:07:41 +0000
|
||||
|
||||
percona-toolkit (3.0.11-1) unstable; urgency=low
|
||||
|
||||
* Improvement PT-1571 : Improved hostname recognition in pt-secure-collect
|
||||
* Fixed bug PT-1570 : pt-archiver fails to detect columns with the word GENERATED as part of the comment
|
||||
* Improvement PT-1569 : Disabled --alter-foreign-keys-method=drop_swap in pt-osc
|
||||
* Fixed bug PT-1563 : Fixed pt-show-grants for MySQL 5.6
|
||||
* Improvement PT-1562 : pt-mysql-summary: Fix mysqld command for Travis
|
||||
* Fixed bug PT-1551 : pt-table-checksum fails on MySQL 8.0.11
|
||||
* Improvement PT-242 : (pt-stalk) Include SHOW SLAVE STATUS on 5.7 (Thanks Marcelo Altmann)
|
||||
* Fixed bug PT-241 : (pt-stalk) Slave queries doesn't run on 5.7 (Thanks Marcelo Altmann)
|
||||
|
||||
-- Percona Toolkit Developers <toolkit-dev@percona.com> Tue, 03 Jul 2018 12:54:53 +0000
|
||||
|
||||
percona-toolkit (3.0.10-1) unstable; urgency=low
|
||||
|
||||
|
||||
-- Percona Toolkit Developers <toolkit-dev@percona.com> Mon, 21 May 2018 17:36:10 +0000
|
||||
|
||||
percona-toolkit (3.0.9-1) unstable; urgency=low
|
||||
|
||||
|
||||
|
@@ -50,7 +50,7 @@ copyright = u'2017, Percona LLC and/or its affiliates'
|
||||
# The short X.Y version.
|
||||
version = '3.0'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '3.0.9'
|
||||
release = '3.0.12'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
@@ -46,6 +46,7 @@ Configuration
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
version-check
|
||||
configuration_files
|
||||
dsn_data_source_name_specifications
|
||||
environment
|
||||
|
@@ -102,10 +102,6 @@ Aggregate GDB stack traces for a selected program.
|
||||
|
||||
Analyze MySQL queries from logs, processlist, and tcpdump.
|
||||
|
||||
=item pt-secure-collect
|
||||
|
||||
Collect, sanitize, pack and encrypt pt-tools outputs.
|
||||
|
||||
=item pt-show-grants
|
||||
|
||||
Canonicalize and print MySQL grants so you can effectively replicate, compare and version-control them.
|
||||
@@ -564,6 +560,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
Percona Toolkit v3.0.9 released 2018-04-17
|
||||
Percona Toolkit v3.0.12 released 2018-09-11
|
||||
|
||||
=cut
|
||||
|
30462
docs/release_notes.rst
30462
docs/release_notes.rst
File diff suppressed because it is too large
Load Diff
26
docs/rn.3-0-1.txt
Normal file
26
docs/rn.3-0-1.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
v3.0.1 released 2017-02-20
|
||||
==========================
|
||||
|
||||
Percona Toolkit 3.0.1 GA includes the following changes:
|
||||
|
||||
* Added requirement to run ``pt-mongodb-summary`` as a user with the ``clusterAdmin`` or ``root`` built-in roles.
|
||||
|
||||
v3.0 released 2017-02-06
|
||||
========================
|
||||
|
||||
Percona Toolkit 3.0.0 RC includes the following changes:
|
||||
|
||||
New Features
|
||||
|
||||
* Added ``pt-mongodb-summary`` tool
|
||||
|
||||
* Added ``pt-mongodb-query-digest`` tool
|
||||
|
||||
Bug fixes
|
||||
|
||||
* 1402776: Updated ``MySQLProtocolParser`` to fix error when parsing ``tcpdump`` capture with ``pt-query-digest``
|
||||
|
||||
* 1632522: Fixed failure of ``pt-online-schema-change`` when altering a table with a self-referencing foreign key (Thanks Amiel Marqeta)
|
||||
|
||||
* 1654668: Fixed failure of ``pt-summary`` on Red Hat and derivatives (Thanks Marcelo Altmann)
|
19
docs/rn.3-0-10.txt
Normal file
19
docs/rn.3-0-10.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
v3.0.10 released 2018-05-21
|
||||
===========================
|
||||
|
||||
New Features
|
||||
|
||||
* :jirabug:`PT-131`: ``pt-table-checksum`` disables the QRT plugin
|
||||
* :jirabug:`PT-118`: ``pt-table-checksum`` report the number of rows
|
||||
of difference between master and slave.
|
||||
|
||||
Improvements
|
||||
|
||||
* :jirabug:`PT-1546`: Improved support of MySQL 8 roles
|
||||
* :jirabug:`PT-1543`: The encrypted table status query causes high load over multiple minutes
|
||||
* :jirabug:`PT-1536`: Added info about encrypted tablespaces in ``pt-mysql-summary``
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* :jirabug:`PT-1556`: ``pt-table-checksum`` 3.0.9 does not change ``binlog_format`` to statement any more.
|
30
docs/rn.3-0-11.txt
Normal file
30
docs/rn.3-0-11.txt
Normal file
@@ -0,0 +1,30 @@
|
||||
v3.0.11 released 2018-07-06
|
||||
===========================
|
||||
|
||||
New features
|
||||
|
||||
* :jirabug:`PT-1571`: Improved hostname recognition in ``pt-secure-collect``
|
||||
* :jirabug:`PT-1569`: Disabled ``--alter-foreign-keys-method=drop_swap`` in ``pt-online-schema-change``
|
||||
* :jirabug:`PT-242`: (``pt-stalk``) Include ``SHOW SLAVE STATUS`` on MySQL 5.7 (Thanks `Marcelo Altmann <https://www.percona.com/blog/author/marcelo-altmann/>`_)
|
||||
|
||||
Fixed bugs
|
||||
|
||||
* :jirabug:`PT-1570`: ``pt-archiver`` fails to detect columns with the word *GENERATED* as part of the comment
|
||||
* :jirabug:`PT-1563`: ``pt-show-grants`` fails for MySQL 5.6 producing an error which reports that an unknown column **account_locked** has been detected.
|
||||
* :jirabug:`PT-1551`: ``pt-table-checksum`` fails on MySQL 8.0.11
|
||||
* :jirabug:`PT-241`: (``pt-stalk``) Slave queries don\'t run on MySQL 5.7 because the FQDN is missing (Thanks `Marcelo Altmann <https://www.percona.com/blog/author/marcelo-altmann/>`_)
|
||||
|
||||
Breaking changes:
|
||||
|
||||
Starting with this version, the queries checksum in ``pt-query-digest`` will
|
||||
store the full MD5 field as a CHAR(32) field instead of storing just the least
|
||||
significant bytes of the checksum as a BIGINT field. The reason for this
|
||||
change is that storing only the least significant bytes as a BIGINT was
|
||||
producing inconsistent results in MySQL 8 compared to MySQL 5.6+.
|
||||
|
||||
``pt-online-schema-change`` in MySQL 8:
|
||||
|
||||
Due to a `bug in MySQL 8.0+ <https://bugs.mysql.com/bug.php?id=89441>`_, it
|
||||
is not possible to use the ``drop_swap`` method to rebuild constraints because
|
||||
renaming a table will result in losing the foreign keys. You must specify a
|
||||
different method explicitly.
|
18
docs/rn.3-0-12.txt
Normal file
18
docs/rn.3-0-12.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
Fixed bugs
|
||||
|
||||
* :jirabug:`PT-1611`: ``pt-archiver`` failed to output UTF-8 characters.
|
||||
* :jirabug:`PT-1574`: ``pt-online-schema-change`` failed on tables with a nullable unique key and a row with NULL values.
|
||||
* :jirabug:`PT-1572`: ENUM fields usage in keys was improved, resulting in higher speed for expressions with sorted ENUM items.
|
||||
* :jirabug:`PT-1422`: ``pt-mysql-summary`` could hang when NULL values appear in the processlist Time column.
|
||||
Documentation changes
|
||||
|
||||
* :jirabug:`PT-1321`: The required MySQL privileges were detailed in `pt-online-schema-change`` documentation
|
||||
|
||||
Changelog
|
||||
---------
|
||||
|
||||
* Fixed bug PT-1611: pt-archiver fails with UTF-8 chars
|
||||
* Fixed bug PT-1574: pt-online-schema-change fails on UK and NULLs
|
||||
* Fixed bug PT-1572: Better usage of ENUM fields in keys in NibbleIterator
|
||||
* Fixed bug PT-1422: pt-mysql-summary may get stuck when Time: NULL in processlist
|
||||
* Improvement PT-1321: Add required MySQL privileges to pt-online-schema-change documentation
|
31
docs/rn.3-0-2.txt
Normal file
31
docs/rn.3-0-2.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
v3.0.2 released 2017-03-27
|
||||
==========================
|
||||
|
||||
Percona Toolkit 3.0.2 includes the following changes:
|
||||
|
||||
New Features
|
||||
|
||||
* PT-73: Added support for SSL connections to ``pt-mongodb-summary`` and ``pt-mongodb-query-digest``
|
||||
|
||||
* 1642751: Enabled gathering of information about locks and transactions by ``pt-stalk`` using Performance Schema if it is enabled (Thanks Agustin Gallego)
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* PT-74: Fixed gathering of security settings when running ``pt-mongodb-summary`` on a mongod instance that is specified as the host
|
||||
|
||||
* PT-75: Changed the default sort order in ``pt-mongodb-query-digest`` output to descending
|
||||
|
||||
* PT-76: Added support of ``&`` and ``#`` symbols in passwords for ``pt-mysql-summary``
|
||||
|
||||
* PT-77: Updated ``Makefile`` to support new MongoDB tools
|
||||
|
||||
* PT-89: Fixed ``pt-stalk`` to run ``top`` more than once to collect useful CPU usage
|
||||
|
||||
* PT-93: Fixed ``pt-mongodb-query-digest`` to make query ID match query key (Thanks Kamil Dziedzic)
|
||||
|
||||
* PT-94: Fixed ``pt-online-schema-change`` to not make duplicate rows in ``_t_new`` when updating primary key. Also see 1646713.
|
||||
|
||||
* PT-101: Fixed ``pt-table-checksum`` to correctly use the ``--slave-user`` and ``--slave-password`` options. Also see 1651002.
|
||||
|
||||
* PT-105: Fixed ``pt-table-checksum`` to continue running if a database is dropped in the process
|
29
docs/rn.3-0-3.txt
Normal file
29
docs/rn.3-0-3.txt
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
v3.0.3 released 2017-05-18
|
||||
==========================
|
||||
|
||||
Percona Toolkit 3.0.3 includes the following changes:
|
||||
|
||||
New Features
|
||||
|
||||
* Added the ``--skip-check-slave-lag`` option for ``pt-table-checksum``, ``pt-online-schema-change``, and ``pt-archiver``.
|
||||
|
||||
This option can be used to specify list of servers where to skip checking for slave lag.
|
||||
|
||||
* 1642754: Added support for collecting replication slave information in ``pt-stalk``.
|
||||
|
||||
* PT-111: Added support for collecting information about variables from Performance Schema in ``pt-stalk``. For more information, see 1642753.
|
||||
|
||||
* PT-116: Added the ``--[no]use-insert-ignore`` option for ``pt-online-schema-change`` to force or prevent using ``IGNORE`` on ``INSERT`` statements. For more information, see 1545129.
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* PT-115: Fixed ``OptionParser`` to accept repeatable DSNs.
|
||||
|
||||
* PT-126: Fixed ``pt-online-schema-change`` to correctly parse comments. For more information, see 1592072.
|
||||
|
||||
* PT-128: Fixed ``pt-stalk`` to include memory usage information. For more information, see 1510809.
|
||||
|
||||
* PT-130: Fixed ``pt-mext`` to work with non-empty RSA public key. For more information, see 1587404.
|
||||
|
||||
* PT-132: Fixed ``pt-online-schema-change`` to enable ``--no-drop-new-table`` when ``--no-swap-tables`` and ``--no-drop-triggers`` are used.
|
81
docs/rn.3-0-4.txt
Normal file
81
docs/rn.3-0-4.txt
Normal file
@@ -0,0 +1,81 @@
|
||||
|
||||
v3.0.4 released 2017-08-02
|
||||
==========================
|
||||
|
||||
Percona Toolkit 3.0.4 includes the following changes:
|
||||
|
||||
New Features
|
||||
|
||||
* :jirabug:`PT-90`: Added collection of information about prepared statements
|
||||
by ``pt-stalk`` when Performance Schema is enabled.
|
||||
For more information, see :lpbug:`1642750`.
|
||||
|
||||
* :jirabug:`PT-91`: Added the ``--preserve-triggers`` option
|
||||
for ``pt-online-schema-change`` to support ``AFTER`` triggers.
|
||||
|
||||
* :jirabug:`PT-138`: Added ``--output-format`` option
|
||||
for ``pt-mongodb-summary`` to choose between JSON format
|
||||
and the default plain text.
|
||||
|
||||
* :jirabug:`PT-141`: Added the ``--output-format=csv`` parameter
|
||||
for ``pt-archiver`` to archive rows in CSV format.
|
||||
|
||||
* :jirabug:`PT-142`: Added the ``--only-same-schema-fks`` option
|
||||
for ``pt-online-schema-change`` to check foreigns keys only on tables
|
||||
with the same schema as the original table.
|
||||
This should speed up the tool's execution,
|
||||
but keep in mind that if you have foreign keys
|
||||
referencing tables in other schemas,
|
||||
they won't be detected.
|
||||
For more information, see :lpbug:`1690122`.
|
||||
|
||||
* :jirabug:`PT-153`: Added the ``--check-unique-key-change`` option
|
||||
for ``pt-online-schema-change`` to abort
|
||||
if the specified statement for ``--alter`` is trying to add a unique index.
|
||||
This is supposed to avoid adding duplicate keys
|
||||
that might lead to silently losing data.
|
||||
|
||||
* :jirabug:`PT-173`: Added the ``--truncate-replicate-table`` option
|
||||
for ``pt-table-checksum`` to ensure stale data is removed.
|
||||
|
||||
Bug fixes
|
||||
|
||||
* :jirabug:`PT-136`: Fixed ``pt-table-checksum`` to support tables
|
||||
that have columns with different collations or charsets.
|
||||
For more information, see :lpbug:`1674266`.
|
||||
|
||||
* :jirabug:`PT-143`: Fixed primary key handling by ``pt-archiver``.
|
||||
For more information, see :lpbug:`1691630`.
|
||||
|
||||
* :jirabug:`PT-144`: Limited constraint name in the new table
|
||||
when running ``pt-online-schema-change``.
|
||||
For more information, see :lpbug:`1491674`.
|
||||
|
||||
* :jirabug:`PT-146`: Fixed the ``--no-check-binlog-format`` option
|
||||
for ``pt-table-checksum`` to work as expected.
|
||||
|
||||
* :jirabug:`PT-148`: Fixed the use of uninitialized value in ``printf()``
|
||||
for ``pt-online-schema-change``.
|
||||
For more information, see :lpbug:`1693614`.
|
||||
|
||||
* :jirabug:`PT-151`: Fixed ``pt-table-sync`` to prevent field type ``point``
|
||||
to be taken as decimal.
|
||||
|
||||
* :jirabug:`PT-154`: Reverted :jirabug:`PT-116`
|
||||
to remove the ``--use-insert-ignore`` option
|
||||
from ``pt-online-schema-change``.
|
||||
|
||||
* :jirabug:`PT-161`: Fixed the ``--skip-check-slave-lag`` feature
|
||||
for ``pt-table-checksum`` to safely check for undefined values.
|
||||
|
||||
* :jirabug:`PT-178`: Fixed regression in ``--check-slave-lag`` option
|
||||
for ``pt-online-schema-change``.
|
||||
|
||||
* :jirabug:`PT-180`: Fixed regression in ``--skip-check-slave-lag`` option
|
||||
for ``pt-online-schema-change``.
|
||||
|
||||
* :jirabug:`PT-181`: Fixed syntax error in ``pt-online-schema-change``.
|
||||
|
||||
Other Improvements
|
||||
|
||||
* :jirabug:`PT-162`: Updated list of tables ignored by ``pt-table-checksum``.
|
28
docs/rn.3-0-5.txt
Normal file
28
docs/rn.3-0-5.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
v3.0.5 released 2017-11-20
|
||||
==========================
|
||||
|
||||
Percona Toolkit 3.0.5 includes the following changes:
|
||||
|
||||
New Features
|
||||
|
||||
* :jirabug:`PMM-1590`: Improve MongoDB Profiler for ``PMM`` and ``PT``
|
||||
* :jirabug:`PT-216`: The ``mongodb-query-digest`` supports ``MongoDB`` versions lower than 3.2; incorrect output was fixed.
|
||||
* :jirabug:`PT-182`: The ``pt-summary``, ``pt-mysql-summary``, ``pt-mongodb-summary`` commands provide output in the the JSON format.
|
||||
* :jirabug:`PT-152`: ``pt-mysql-summary`` shows the output of the *Show Slave Hosts* command.
|
||||
* :jirabug:`PT-139`: ``pt-table-sync`` supports replication channels (requires MySQL version 5.7.6 or higher)
|
||||
|
||||
Bug fixes
|
||||
|
||||
* :jirabug:`PT-211`: ``pt-mext`` fails if the ``Rsa_public_key`` variable is empty.
|
||||
* :jirabug:`PT-212`: ``pt-mongodb-query-digest --version`` produced incorrect values.
|
||||
* :jirabug:`PT-202`: ``pt-online-schema-change`` incorrectly processed virtual columns.
|
||||
* :jirabug:`PT-200`: ``pt-online-schema-change`` command reported an error when the name of an index contained 'unique' as as the prefix or suffix.
|
||||
* :jirabug:`PT-199`: ``pt-table-checksum`` did not detect differences on a system with the ROW based replication active.
|
||||
* :jirabug:`PT-196`: ``pt-onine-schema-change --max-load`` paused if a status variable was passed **0** as the value.
|
||||
* :jirabug:`PT-193`: ``pt-table-checksum`` reported a misleading error if a column comment contained an apostrophe. For more information, see :lpbug:`1708749`.
|
||||
* :jirabug:`PT-187`: In some cases, ``pt-table-checksum`` did not report that the same table contained different values on the master and slave.
|
||||
* :jirabug:`PT-186`: ``pt-online-schema-change --alter`` could fail if field names contained upper case characters. For more information, see :lpbug:`1705998`.
|
||||
* :jirabug:`PT-183`: In some cases ``pt-mongodb-query-digest`` could not connect to a db using authentication.
|
||||
* :jirabug:`PT-167`: In some cases, ``pt-kill`` could ignore the value of the ``--busy-time`` parameter. For more information, see :lpbug:`1016272`.
|
||||
* :jirabug:`PT-161`: When run with the ``--skip-check-slave-lag``, the ``pt-table-checksum`` could fail in some cases.
|
25
docs/rn.3-0-6.txt
Normal file
25
docs/rn.3-0-6.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
v3.0.6 released 2018-01-04
|
||||
==========================
|
||||
|
||||
Percona Toolkit 3.0.6 includes the following changes:
|
||||
|
||||
New Features
|
||||
|
||||
* :jirabug:`PT-221`: Improve ``pt-table-sync`` support for ``MyRocks``
|
||||
* :jirabug:`PT-218`: ``pt-stalk`` now checks the ``RocksDB`` status
|
||||
* :jirabug:`PT-214`: ``pt-mysql-summary`` contains the ``RocksDB`` section
|
||||
* :jirabug:`PT-205`: ``pt-osc`` shows a message if trying to set the engine to
|
||||
``rocksdb`` and ``binlog_format != row``.
|
||||
* :jirabug:`PT-204`: ``pt-table-checksum`` skips ``RocksDB`` tables.
|
||||
|
||||
Known Issues
|
||||
|
||||
* :jirabug:`PT-238`: The information message implemented for :jirabug:`PT-204` has a typo when referring to the ``--ignore-engines`` parameter. This problem is planned to be fixed in the next release.
|
||||
* :jirabug:`PT-240`: It has been detected that the implementation of :jirabug:`PT-205` is not complete and ``pt-osc`` may fail when altering tables. This problem is planned to be fixed in the next release.
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* :jirabug:`PT-234`: The general log parser cannot handle timestamps which include time zones
|
||||
* :jirabug:`PT-229`: ``pt-online-schema-change`` does not retry on a deadlock error when using ``Percona Server`` 5.7
|
||||
* :jirabug:`PT-225`: ``pt-table-checksum`` ignores generated columns
|
21
docs/rn.3-0-7.txt
Normal file
21
docs/rn.3-0-7.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
v3.0.7 released 2018-03-01
|
||||
==========================
|
||||
|
||||
New Features
|
||||
|
||||
* :jirabug:`PT-633`: Added --mysql-only option to ``pt-stalk`` for RDS
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* :jirabug:`PT-244`: The ``--data-dir`` option of ``pt-online-schema-change`` is broken for partitioned table
|
||||
* :jirabug:`PT-1256`: ``pt-table-sync`` does not use the character set for the table it is synchronizing
|
||||
* :jirabug:`PT-1455`: ``pt-osc`` is stuck when filtering out on the slave the table that is being altered
|
||||
* :jirabug:`PT-1485`: The *Security* section of ``pt-mysql-summary`` is broken in versions bigger than 5.6
|
||||
* :jirabug:`PMM-1905`: ``Explain`` fails if it encounters a negative ``ntoreturn``
|
||||
|
||||
Known Issues:
|
||||
|
||||
* pt-online-schema-change will lock forever if using ``--drop-swap`` under MySQL 8.0.3-rc and 8.0.4-rc due to an error in MySQL: https://bugs.mysql.com/bug.php?id=8948
|
||||
* pt-online-schema-change will lose FK constraints under MySQL 8.0.2-dmr, 8.0.3-rc 8.0.4-rc due to an error in MySQL: https://bugs.mysql.com/bug.php?id=89441
|
||||
* pt-show-grants can't handle MySQL 8 roles yet
|
12
docs/rn.3-0-8.txt
Normal file
12
docs/rn.3-0-8.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
v3.0.8 released 2018-03-13
|
||||
==========================
|
||||
|
||||
New Features
|
||||
|
||||
* :jirabug:`PT-1500`: Added --output=secure-slowlog option to ``pt-query-digest``
|
||||
|
||||
Buf Fixes
|
||||
|
||||
* :jirabug:`PT-1503`: The post-install script fails on VM due to improper UUID file detection
|
||||
* :jirabug:`PT-1492`: ``pt-kill`` in version 3.0.7 ignores the value of the ``--busy-time``
|
25
docs/rn.3-0-9.txt
Normal file
25
docs/rn.3-0-9.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
v3.0.9 released 2018-04-20
|
||||
==========================
|
||||
|
||||
New Tools
|
||||
|
||||
* :jirabug:`PT-1501`: ``pt-secure-collect`` - New tool to collect and sanitize pt-tools outputs
|
||||
|
||||
New Features
|
||||
|
||||
* :jirabug:`PT-1530`: Add support for encryption status to ``pt-mysql-summary``
|
||||
* :jirabug:`PT-1526`: Add ndb status to ``pt-mysql-summary`` (Thanks Fernando Ipar)
|
||||
* :jirabug:`PT-1525`: Add support for MySQL 8 roles into ``pt-mysql-summary``
|
||||
* :jirabug:`PT-1509`: Make ``pt-table-sync`` only set binlog_format when necessary (Thanks Moritz Lenz)
|
||||
* :jirabug:`PT-1508`: Add ``--read-only-interval`` and ``--fail-successive-errors`` flags to ``pt-heartbeat`` (Thanks Shlomi Noach)
|
||||
* :jirabug:`PT-243`: Add ``--max-hostname-length`` and ``--max-line-length`` flags to ``pt-query-digest``
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* :jirabug:`PT-1527`: Fixed ``pt-table-checksum`` ignores ``--nocheck-binlog-format``
|
||||
|
||||
Improvements
|
||||
|
||||
* :jirabug:`PT-1507`: ``pt-summary`` does not reliably read in the transparent huge pages setting (Thanks Nick Veenhof)
|
||||
* :jirabug:`PT-1488`: ``pt-show-grants`` support for MySQL 8.0
|
118
docs/version-check.rst
Normal file
118
docs/version-check.rst
Normal file
@@ -0,0 +1,118 @@
|
||||
.. _version-check:
|
||||
|
||||
================================================================================
|
||||
Version Checking
|
||||
================================================================================
|
||||
|
||||
Some Percona software contains “version checking” functionality which is a
|
||||
feature that enables Percona software users to be notified of available software
|
||||
updates to improve your environment security and performance. Alongside this,
|
||||
the version check functionality also provides Percona with information relating
|
||||
to which software versions you are running, coupled with the environment
|
||||
confirmation which the software is running within. This helps enable Percona to
|
||||
focus our development effort accordingly based on trends within our customer
|
||||
community.
|
||||
|
||||
|
||||
The purpose of this document is to articulate the information that is
|
||||
collected, as well as to provide guidance on how to disable this functionality
|
||||
if desired.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
*Version Check* was implemented in |pt| 2.1.4, and was enabled by default in
|
||||
version 2.2.1. Currently it is supported as a ``--[no]version-check`` option
|
||||
by `a number of tools in Percona Toolkit <https://www.percona.com/doc/percona-toolkit/LATEST/genindex.html>`_,
|
||||
|pxb|, and |pmm|.
|
||||
|
||||
When launched with Version Check enabled, the tool that supports this feature
|
||||
connects to a Percona's *version check service* via a secure HTTPS channel. It
|
||||
compares the locally installed version for possible updates, and also checks
|
||||
versions of the following software:
|
||||
|
||||
* Operating System
|
||||
* Percona Monitoring and Management (PMM)
|
||||
* MySQL
|
||||
* Perl
|
||||
* MySQL driver for Perl (DBD::mysql)
|
||||
* Percona Toolkit
|
||||
|
||||
Then it checks for and warns about versions with known problems if they are
|
||||
identified as running in the environment.
|
||||
|
||||
Each version check request is logged by the server. Stored information consists
|
||||
of the checked system unique ID followed by the software name and version.
|
||||
The ID is generated either at installation or when the |version-check| query is
|
||||
submitted for the first time.
|
||||
|
||||
.. note::
|
||||
|
||||
Prior to version 3.0.7 of |pt|, the system ID was calculated as an MD5 hash
|
||||
of a hostname, and starting from |pt| 3.0.7 it is generated as an MD5
|
||||
hash of a random number. |pxb| continues to use hostname-based MD5 hash.
|
||||
|
||||
As a result, the content of the sent query is as follows::
|
||||
|
||||
85624f3fb5d2af8816178ea1493ed41a;DBD::mysql;4.044
|
||||
c2b6d625ef3409164cbf8af4985c48d3;MySQL;MySQL Community Server (GPL) 5.7.22-log
|
||||
85624f3fb5d2af8816178ea1493ed41a;OS;Manjaro Linux
|
||||
85624f3fb5d2af8816178ea1493ed41a;Percona::Toolkit;3.0.11-dev
|
||||
85624f3fb5d2af8816178ea1493ed41a;Perl;5.26.2
|
||||
|
||||
Disabling Version Check
|
||||
=======================
|
||||
|
||||
Although the |version-check| feature does not collect any personal information,
|
||||
you might prefer to disable this feature, either one time or permanently.
|
||||
To disable it one time, use ``--no-version-check`` option when invoking the
|
||||
tool from a Percona product which supports it. Here is a simple example which
|
||||
shows running `pt-diskstats <https://www.percona.com/doc/percona-toolkit/LATEST/pt-diskstats.html>`_
|
||||
tool from the |pt| with |version-check| turned off::
|
||||
|
||||
pt-diskstats --no-version-check
|
||||
|
||||
Disabling |version-check| permanently can be done by placing
|
||||
``no-version-check`` option into the configuration file of a Percona product
|
||||
(see correspondent documentation for exact file name and syntax). For example,
|
||||
in case of |pt| `this can be done <https://www.percona.com/doc/percona-toolkit/LATEST/configuration_files.html>`_ in a global configuration file ``/etc/percona-toolkit/percona-toolkit.conf``::
|
||||
|
||||
# Disable Version Check for all tools:
|
||||
no-version-check
|
||||
|
||||
In case of |pxb| this can be done `in its configuration file <https://www.percona.com/doc/percona-xtrabackup/2.4/using_xtrabackup/configuring.htm>`_ in a similar way::
|
||||
|
||||
[xtrabackup]
|
||||
no-version-check
|
||||
|
||||
Frequently Asked Questions
|
||||
==========================
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Why is this functionality enabled by default?
|
||||
---------------------------------------------
|
||||
|
||||
We believe having this functionality enabled improves security and performance
|
||||
of environments running Percona Software and it is good choice for majority of
|
||||
the users.
|
||||
|
||||
Why not rely on Operating System's built in functionality for software updates?
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
In many environments the Operating Systems repositories may not carry the
|
||||
latest version of software and newer versions of software often installed
|
||||
manually, so not being covered by operating system wide check for updates.
|
||||
|
||||
Why do you send more information than just the version of software being run as a part of version check service?
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Compatibility problems can be caused by versions of various components in the
|
||||
environment, for example problematic versions of Perl, DBD or MySQL could cause
|
||||
operational problems with Percona Toolkit.
|
||||
|
||||
.. |pmm| replace:: PMM (Percona Monitoring and Management)
|
||||
.. |pt| replace:: Percona Toolkit
|
||||
.. |pxb| replace:: Percona XtraBackup
|
||||
.. |version-check| replace:: *version checking*
|
@@ -532,12 +532,12 @@ sub diff_rows {
|
||||
|
||||
$left_dbh->do("DROP TABLE IF EXISTS $left_tbl");
|
||||
$left_dbh->do("CREATE TABLE $left_tbl $table_ddl");
|
||||
$left_dbh->do("LOAD DATA LOCAL INFILE '$left_outfile' "
|
||||
$left_dbh->do("LOAD DATA INFILE '$left_outfile' "
|
||||
. "INTO TABLE $left_tbl");
|
||||
|
||||
$right_dbh->do("DROP TABLE IF EXISTS $right_tbl");
|
||||
$right_dbh->do("CREATE TABLE $right_tbl $table_ddl");
|
||||
$right_dbh->do("LOAD DATA LOCAL INFILE '$right_outfile' "
|
||||
$right_dbh->do("LOAD DATA INFILE '$right_outfile' "
|
||||
. "INTO TABLE $right_tbl");
|
||||
|
||||
PTDEBUG && _d('Loaded', $left_outfile, 'into table', $left_tbl, 'and',
|
||||
|
@@ -43,7 +43,7 @@ sub new {
|
||||
|
||||
my $genlog_line_1= qr{
|
||||
\A
|
||||
(?:(\d{6}\s+\d{1,2}:\d\d:\d\d|\d{4}-\d{1,2}-\d{1,2}T\d\d:\d\d:\d\d\.\d+(?:Z|-?\d\d:\d\d)?))? # Timestamp
|
||||
(?:(\d{6}\s+\d{1,2}:\d\d:\d\d|\d{4}-\d{1,2}-\d{1,2}T\d\d:\d\d:\d\d\.\d+(?:Z|[-+]?\d\d:\d\d)?))? # Timestamp
|
||||
\s+
|
||||
(?:\s*(\d+)) # Thread ID
|
||||
\s
|
||||
|
1401
lib/HTTP/Tiny.pm
Normal file
1401
lib/HTTP/Tiny.pm
Normal file
File diff suppressed because it is too large
Load Diff
@@ -134,14 +134,40 @@ sub new {
|
||||
);
|
||||
PTDEBUG && _d('Ascend params:', Dumper($asc));
|
||||
|
||||
# Check if enum fields items are sorted or not.
|
||||
# If they are sorted we can skip adding CONCAT to improve the queries eficiency.
|
||||
my $force_concat_enums = $o->has('force-concat-enums') && $o->get('force-concat-enums');
|
||||
my $i=0;
|
||||
for my $index (@{$index_cols}) {
|
||||
last if $args{n_chunk_index_cols} && $i >= $args{n_chunk_index_cols};
|
||||
$i++;
|
||||
if ($tbl->{tbl_struct}->{type_for}->{$index} eq 'enum') {
|
||||
if ($tbl->{tbl_struct}->{defs}->{$index} =~ m/enum\s*\((.*?)\)/) {
|
||||
my @items = split(/,\s*/, $1);
|
||||
my $sorted = 1; # Asume the items list is sorted to later check if this is true
|
||||
for (my $i=1; $i < scalar(@items); $i++) {
|
||||
if ($items[$i-1] gt $items[$i]) {
|
||||
$sorted = 0;
|
||||
last;
|
||||
}
|
||||
}
|
||||
if (!$force_concat_enums && !$sorted) {
|
||||
die "The index " . $index . " in table " . $tbl->{name} .
|
||||
" has unsorted enum items.\nPlease read the documentation for the --force-concat-enums parameter\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Make SQL statements, prepared on first call to next(). FROM and
|
||||
# ORDER BY are the same for all statements. FORCE IDNEX and ORDER BY
|
||||
# are needed to ensure deterministic nibbling.
|
||||
|
||||
my $from = "$tbl->{name} FORCE INDEX(`$index`)";
|
||||
my $order_by = join(', ', map { $tbl->{tbl_struct}->{type_for}->{$_} eq 'enum'
|
||||
my $order_by = join(', ', map { $tbl->{tbl_struct}->{type_for}->{$_} eq 'enum' && $force_concat_enums
|
||||
? "CONCAT(".$q->quote($_).")" : $q->quote($_)} @{$index_cols});
|
||||
|
||||
my $order_by_dec = join(' DESC,', map { $tbl->{tbl_struct}->{type_for}->{$_} eq 'enum'
|
||||
my $order_by_dec = join(' DESC,', map { $tbl->{tbl_struct}->{type_for}->{$_} eq 'enum' && $force_concat_enums
|
||||
? "CONCAT(".$q->quote($_).")" : $q->quote($_)} @{$index_cols});
|
||||
|
||||
# The real first row in the table. Usually we start nibbling from
|
||||
|
@@ -18,7 +18,7 @@
|
||||
# ###########################################################################
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.0.10';
|
||||
our $VERSION = '3.0.13-dev';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
|
@@ -1332,7 +1332,8 @@ sub explain_report {
|
||||
$explain .= "# *************************** $i. "
|
||||
. "row ***************************\n";
|
||||
foreach my $j ( 0 .. $#row ) {
|
||||
$explain .= sprintf "# %13s: %s\n", $sth->{NAME}->[$j],
|
||||
my $value_format = $sth->{NAME}->[$j] eq 'filtered' ? "%.02f" : "%s";
|
||||
$explain .= sprintf "# %13s: $value_format\n", $sth->{NAME}->[$j],
|
||||
defined $row[$j] ? $row[$j] : 'NULL';
|
||||
}
|
||||
$i++; # next row number
|
||||
|
@@ -220,7 +220,7 @@ sub remove_quoted_text {
|
||||
my ($string) = @_;
|
||||
$string =~ s/[^\\]`[^`]*[^\\]`//g;
|
||||
$string =~ s/[^\\]"[^"]*[^\\]"//g;
|
||||
$string =~ s/[^\\]"[^"]*[^\\]"//g;
|
||||
$string =~ s/[^\\]'[^']*[^\\]'//g;
|
||||
return $string;
|
||||
}
|
||||
|
||||
|
@@ -45,7 +45,7 @@ use FindBin qw();
|
||||
|
||||
eval {
|
||||
require Percona::Toolkit;
|
||||
require HTTP::Micro;
|
||||
require HTTP::Tiny;
|
||||
};
|
||||
|
||||
my $home = $ENV{HOME} || $ENV{HOMEPATH} || $ENV{USERPROFILE} || '.';
|
||||
@@ -171,7 +171,7 @@ sub version_check {
|
||||
else {
|
||||
print "\n# A software update is available:\n";
|
||||
}
|
||||
print join("\n", map { "# * $_" } @$advice), "\n\n";
|
||||
print join("\n", map { "# * ".($_ || '') } @$advice), "\n\n";
|
||||
}
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
@@ -384,7 +384,7 @@ sub pingback {
|
||||
my $instances = $args{instances};
|
||||
|
||||
# Optional args
|
||||
my $ua = $args{ua} || HTTP::Micro->new( timeout => 3 );
|
||||
my $ua = $args{ua} || HTTP::Tiny->new( timeout => 3 );
|
||||
|
||||
# GET https://upgrade.percona.com, the server will return
|
||||
# a plaintext list of items/programs it wants the tool
|
||||
|
@@ -332,6 +332,9 @@ summarize_processlist () {
|
||||
}
|
||||
\$1 == \"Time:\" {
|
||||
t = \$2;
|
||||
if ( t == \"NULL\" ) {
|
||||
t = 0;
|
||||
}
|
||||
}
|
||||
\$1 == \"Command:\" {
|
||||
c = \$2;
|
||||
@@ -1269,7 +1272,7 @@ report_jemalloc_enabled() {
|
||||
local GENERAL_JEMALLOC_STATUS=0
|
||||
local JEMALLOC_LOCATION=''
|
||||
|
||||
for PID in $(pidof mysqld); do
|
||||
for pid in $(pidof mysqld); do
|
||||
grep -qc jemalloc /proc/${pid}/environ || ldd $(which mysqld) 2>/dev/null | grep -qc jemalloc
|
||||
jemalloc_status=$?
|
||||
if [ $jemalloc_status = 1 ]; then
|
||||
@@ -1576,7 +1579,7 @@ report_mysql_summary () {
|
||||
local keyring_plugins="$(collect_keyring_plugins)"
|
||||
local encrypted_tables=""
|
||||
local encrypted_tablespaces=""
|
||||
if [ ${OPT_LIST_ENCRYPTED_TABLES} == 'yes' ]; then
|
||||
if [ "${OPT_LIST_ENCRYPTED_TABLES}" = 'yes' ]; then
|
||||
encrypted_tables="$(collect_encrypted_tables)"
|
||||
encrypted_tablespaces="$(collect_encrypted_tablespaces)"
|
||||
fi
|
||||
|
@@ -5,21 +5,52 @@ use warnings;
|
||||
|
||||
my $file = $ARGV[0];
|
||||
my $testcase = "";
|
||||
my $testsuite = "";
|
||||
my $error_collect = "";
|
||||
my $error_print = "";
|
||||
my $open_error = 0;
|
||||
|
||||
if (not defined $file) {
|
||||
die "Need filename as parameter!\n";
|
||||
}
|
||||
|
||||
sub close_error {
|
||||
if ( $open_error == 1 ) {
|
||||
print "$error_collect ]]></system-err></testcase>\n";
|
||||
$error_collect=""; $open_error=0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
open (my $info, $file) or die "Could not open $file: $!";
|
||||
|
||||
print "<testsuite name=\"PT MySQL Test\">\n";
|
||||
print "<testsuites name=\"PT-MySQL\">\n";
|
||||
while(my $line = <$info>) {
|
||||
if ($line =~ /^(t\/\S+).* (\.*) (skipped:) (.*)$/) { print "<testcase name=\"$1\"><skipped/><system-out>Skip reason:<![CDATA[ $4 ]]></system-out></testcase>\n"; }
|
||||
elsif ($line =~ /^ok (\d+) - (.*)$/) { print "<testcase name=\"$testcase - test $1\"><system-out>Test description:<![CDATA[ $2 ]]></system-out></testcase>\n"; }
|
||||
elsif ($line =~ /^not ok (\d+) - (.*)$/) { print "<testcase name=\"$testcase - test $1\"><failure/><system-out>Test description:<![CDATA[ $2 ]]></system-out><system-err><![CDATA[ $error_print ]]></system-err></testcase>\n"; }
|
||||
elsif ($line =~ /^(t\/\S+).* (\.*) $/) { $testcase = "$1"; $error_print = $error_collect; $error_collect = ""; }
|
||||
elsif ($line !~ /^ok$/ && $line !~ /^\d+..\d+$/) { $error_collect = $error_collect . $line; }
|
||||
if ($line =~ /^(t\/)(\S+)(\/)(\S+).* (\.*) (skipped:) (.*)$/) {
|
||||
close_error();
|
||||
print "<testcase name=\"$4\"><skipped/><system-out>Skip reason:<![CDATA[ $7 ]]></system-out></testcase>\n";
|
||||
}
|
||||
elsif ($line =~ /^ok (\d+) - (.*)$/) {
|
||||
close_error();
|
||||
print "<testcase name=\"$testcase - test $1\"><system-out>Test description:<![CDATA[ $2 ]]></system-out></testcase>\n";
|
||||
}
|
||||
elsif ($line =~ /^not ok (\d+) - (.*)$/) {
|
||||
close_error();
|
||||
print "<testcase name=\"$testcase - test $1\"><failure/><system-out>Test description:<![CDATA[ $2 ]]></system-out><system-err><![CDATA[ ";
|
||||
$open_error=1;
|
||||
}
|
||||
elsif ($line =~ /^(t\/)(\S+)(\/)(\S+).* (\.*) $/) {
|
||||
close_error();
|
||||
if ( "$2" eq "$testsuite" ) {
|
||||
$testcase="$4"; $error_collect="";
|
||||
}
|
||||
else {
|
||||
if ( "$testsuite" ne "" ) { print "</testsuite>\n"; }
|
||||
$testsuite="$2"; $testcase="$4"; $error_collect=""; print "<testsuite name=\"$testsuite\">\n";
|
||||
}
|
||||
}
|
||||
elsif ($line !~ /^ok$/ && $line !~ /^\d+..\d+$/) {
|
||||
$error_collect=$error_collect . $line;
|
||||
}
|
||||
}
|
||||
print "</testsuite>\n"
|
||||
print "</testsuite>\n</testsuites>\n";
|
||||
|
15
sandbox/slave_channels_t.sql
Normal file
15
sandbox/slave_channels_t.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
STOP SLAVE FOR CHANNEL '';
|
||||
SET GLOBAL master_info_repository = 'TABLE';
|
||||
SET @@GLOBAL.relay_log_info_repository = 'TABLE';
|
||||
SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY=ON;
|
||||
SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;
|
||||
SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE;
|
||||
SET @@GLOBAL.GTID_MODE = ON;
|
||||
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_port=2900, master_user='msandbox', master_password='msandbox', master_auto_position=1 FOR CHANNEL 'masterchan1';
|
||||
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_port=2901, master_user='msandbox', master_password='msandbox', master_auto_position=1 FOR CHANNEL 'masterchan2';
|
||||
|
||||
START SLAVE for channel 'masterchan1';
|
||||
START SLAVE for channel 'masterchan2';
|
||||
|
@@ -122,8 +122,12 @@ make_sandbox() {
|
||||
fi
|
||||
|
||||
if [ -n "$GTID" ]; then
|
||||
#echo "gtid_mode=on" >> ${TMP_DIR}/$port/my.sandbox.cnf
|
||||
echo "gtid_mode=ON_PERMISSIVE" >> ${TMP_DIR}/$port/my.sandbox.cnf
|
||||
if [ "$version" "<" '5.7' ]; then
|
||||
echo "gtid_mode=on" >> ${TMP_DIR}/$port/my.sandbox.cnf
|
||||
fi
|
||||
if [ ! "$version" "<" '5.7' ]; then
|
||||
echo "gtid_mode=ON_PERMISSIVE" >> ${TMP_DIR}/$port/my.sandbox.cnf
|
||||
fi
|
||||
echo "enforce_gtid_consistency" >> ${TMP_DIR}/$port/my.sandbox.cnf
|
||||
fi
|
||||
if [ -n "$REPLICATION_THREADS" ]; then
|
||||
@@ -143,7 +147,7 @@ make_sandbox() {
|
||||
|
||||
if [ $generating_database -eq 1 ]; then
|
||||
echo "Creating default databases ..."
|
||||
if [ "$version" > "5.6" ]; then
|
||||
if [ "$version" ">" "5.6" ]; then
|
||||
rm -f ${TMP_DIR}/empty-defaults.txt
|
||||
touch ${TMP_DIR}/empty-defaults.txt
|
||||
rm -rf ${TMP_DIR}/$port/data
|
||||
|
@@ -1,6 +1,6 @@
|
||||
GO := go
|
||||
pkgs = $(shell find . -type d -name "pt-*" -exec basename {} \;)
|
||||
VERSION="3.0.9"
|
||||
VERSION="3.0.12"
|
||||
BUILD=$(shell date +%FT%T%z)
|
||||
GOVERSION=$(shell go version | cut --delimiter=" " -f3)
|
||||
GOUTILSDIR ?= $(GOPATH)/bin
|
||||
|
@@ -10,7 +10,7 @@ GOPATH ?=${HOME}/go
|
||||
MAKE_TARS = ''
|
||||
CUR_DIR=$(shell pwd)
|
||||
BIN_DIR=${CUR_DIR}/build
|
||||
SOURCES=collect encryptor pt-secure-data
|
||||
SOURCES=collect encryptor pt-secure-collect
|
||||
LDFLAGS="-X main.Version=${VERSION} -X main.Build=${BUILD} -X main.Commit=${COMMIT} -X main.Branch=${BRANCH} -X main.GoVersion=${GOVERSION} -s -w"
|
||||
|
||||
ifeq (${GOPATH},)
|
||||
@@ -22,7 +22,7 @@ $(error Invalid GOPATH. There is no src dir in the GOPATH)
|
||||
endif
|
||||
|
||||
ifeq ($(findstring ${GOPATH},${CUR_DIR}), )
|
||||
$(error Wrong directorry for the project. It must be in $GOPATH/github/Percona-Lab/pt-secure-data)
|
||||
$(error Wrong directorry for the project. It must be in $GOPATH/github/Percona-Lab/pt-secure-collect)
|
||||
endif
|
||||
|
||||
$(info )
|
||||
@@ -37,7 +37,7 @@ default: prepare
|
||||
@rm -f ${BIN_DIR}/collect_*.tar.gz
|
||||
@echo
|
||||
@$(info Building in ${BIN_DIR})
|
||||
@go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/pt-secure-data *.go
|
||||
@go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/pt-secure-collect *.go
|
||||
|
||||
prepare:
|
||||
@$(info Checking if ${BIN_DIR} exists)
|
||||
@@ -47,31 +47,31 @@ all: clean darwin-amd64-tar linux-amd64-tar windows-amd64-tar
|
||||
|
||||
clean: prepare
|
||||
@$(info Cleaning binaries and tar.gz files in dir ${BIN_DIR})
|
||||
@rm -f ${BIN_DIR}/pt-secure-data
|
||||
@rm -f ${BIN_DIR}/pt-secure-data.exe
|
||||
@rm -f ${BIN_DIR}/pt-secure-data_*.tar.gz
|
||||
@rm -f ${BIN_DIR}/pt-secure-collect
|
||||
@rm -f ${BIN_DIR}/pt-secure-collect.exe
|
||||
@rm -f ${BIN_DIR}/pt-secure-collect_*.tar.gz
|
||||
|
||||
linux-amd64: prepare
|
||||
@echo "Building linux/amd64 binaries in ${BIN_DIR}"
|
||||
@GOOS=linux GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/pt-secure-data *.go
|
||||
@GOOS=linux GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/pt-secure-collect *.go
|
||||
|
||||
linux-amd64-tar: linux-amd64
|
||||
@tar cvzf ${BIN_DIR}/pt-secure-data_linux_amd64.tar.gz -C ${BIN_DIR} pt-secure-data
|
||||
@tar cvzf ${BIN_DIR}/pt-secure-collect_linux_amd64.tar.gz -C ${BIN_DIR} pt-secure-collect
|
||||
|
||||
darwin-amd64:
|
||||
@echo "Building darwin/amd64 binaries in ${BIN_DIR}"
|
||||
@mkdir -p ${BIN_DIR}
|
||||
@GOOS=darwin GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/pt-secure-data *.go
|
||||
@GOOS=darwin GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/pt-secure-collect *.go
|
||||
|
||||
darwin-amd64-tar: darwin-amd64
|
||||
@tar cvzf ${BIN_DIR}/pt-secure-data_darwin_amd64.tar.gz -C ${BIN_DIR} pt-secure-data
|
||||
@tar cvzf ${BIN_DIR}/pt-secure-collect_darwin_amd64.tar.gz -C ${BIN_DIR} pt-secure-collect
|
||||
|
||||
windows-amd64: prepare
|
||||
@echo "Building windows/amd64 binaries in ${BIN_DIR}"
|
||||
@GOOS=windows GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/pt-secure-data.exe *.go
|
||||
@GOOS=windows GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/pt-secure-collect.exe *.go
|
||||
|
||||
windows-amd64-tar: windows-amd64
|
||||
@tar cvzf ${BIN_DIR}/pt-secure-data_windows_amd64.tar.gz -C ${BIN_DIR} pt-secure-data.exe
|
||||
@tar cvzf ${BIN_DIR}/pt-secure-collect_windows_amd64.tar.gz -C ${BIN_DIR} pt-secure-collect.exe
|
||||
|
||||
style:
|
||||
@echo ">> checking code style"
|
||||
|
@@ -9,7 +9,7 @@ Internal variables placeholders will be replaced with the corresponding flag va
|
||||
|
||||
Usage:
|
||||
```
|
||||
pt-secure-data [<flags>] <command> [<args> ...]
|
||||
pt-secure-collect [<flags>] <command> [<args> ...]
|
||||
```
|
||||
|
||||
|
||||
|
@@ -67,6 +67,8 @@ type myDefaults struct {
|
||||
}
|
||||
|
||||
const (
|
||||
TOOLNAME = "pt-secure-collect"
|
||||
|
||||
decryptCmd = "decrypt"
|
||||
encryptCmd = "encrypt"
|
||||
collectCmd = "collect"
|
||||
@@ -81,6 +83,10 @@ var (
|
||||
"pt-summary",
|
||||
"pt-mysql-summary --host=$mysql-host --port=$mysql-port --user=$mysql-user --password=$mysql-pass",
|
||||
}
|
||||
|
||||
Build string = "01-01-1980"
|
||||
GoVersion string = "1.8"
|
||||
Version string = "3.0.1"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -164,12 +170,15 @@ func processCliParams(baseTempPath string, usageWriter io.Writer) (*cliOptions,
|
||||
}
|
||||
msg += "\n "
|
||||
|
||||
app := kingpin.New("pt-secure-data", msg)
|
||||
app := kingpin.New(TOOLNAME, msg)
|
||||
if usageWriter != nil {
|
||||
app.UsageWriter(usageWriter)
|
||||
app.Terminate(nil)
|
||||
}
|
||||
|
||||
// Add support for --version flag
|
||||
app.Version(TOOLNAME + "\nVersion " + Version + "\nBuild: " + Build + " using " + GoVersion)
|
||||
|
||||
opts := &cliOptions{
|
||||
CollectCommand: app.Command(collectCmd, "Collect, sanitize, pack and encrypt data from pt-tools."),
|
||||
DecryptCommand: app.Command(decryptCmd, "Decrypt an encrypted file. The password will be requested from the terminal."),
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
hostnameRE = regexp.MustCompile(`(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-][A-Za-z0-9]){2,3}(?:\W)`)
|
||||
hostnameRE = regexp.MustCompile(`(([a-zA-Z0-9]|[a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z]+)|([0-9]{1,3}\.){3}[0-9]{1,3}`)
|
||||
queryLineRe []*regexp.Regexp
|
||||
queryInLineRe []*regexp.Regexp
|
||||
)
|
||||
|
54
src/go/pt-secure-collect/sanitize/sanitize_test.go
Normal file
54
src/go/pt-secure-collect/sanitize/sanitize_test.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package sanitize
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/kr/pretty"
|
||||
)
|
||||
|
||||
func TestSanitizeHostnames(t *testing.T) {
|
||||
|
||||
want := []string{
|
||||
"top - 20:05:17 up 10 days, 16:27, 1 user, load average: 0.01, 0.15, 0.19",
|
||||
"Tasks: 115 total, 1 running, 114 sleeping, 0 stopped, 0 zombie",
|
||||
"%Cpu(s): 1.0 us, 0.3 sy, 0.0 ni, 98.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st",
|
||||
"KiB Mem : 3881748 total, 147324 free, 1892824 used, 1841600 buff/cache",
|
||||
"KiB Swap: 1572860 total, 1572748 free, 112 used. 1609372 avail Mem",
|
||||
"",
|
||||
"PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND",
|
||||
"5304 vagrant 20 0 1983280 1.327g 12272 S 2.3 35.8 456:34.90 prometheus",
|
||||
"5313 root 20 0 142100 16952 5428 S 1.0 0.4 189:16.81 node_exporter ",
|
||||
}
|
||||
lines := make([]string, len(want))
|
||||
copy(lines, want)
|
||||
sanitizeHostnames(lines)
|
||||
if !reflect.DeepEqual(lines, want) {
|
||||
pretty.Println(want)
|
||||
pretty.Println(lines)
|
||||
t.Error("structures don't match")
|
||||
}
|
||||
|
||||
lines = []string{
|
||||
"top - 20:05:17 up 10 days, 16:27, 1 user, load average: 0.01, 0.15, 0.19",
|
||||
"Tasks: 115 total, 1 running, 114 sleeping, 0 stopped, 0 zombie",
|
||||
"%Cpu(s): 1.0 us, 0.3 sy, 0.0 ni, 98.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st",
|
||||
"lets put a host name here: domain.com",
|
||||
"and put an ip address here: 10.0.0.1",
|
||||
"and put a non ip address here: 10.0",
|
||||
}
|
||||
want = []string{
|
||||
"top - 20:05:17 up 10 days, 16:27, 1 user, load average: 0.01, 0.15, 0.19",
|
||||
"Tasks: 115 total, 1 running, 114 sleeping, 0 stopped, 0 zombie",
|
||||
"%Cpu(s): 1.0 us, 0.3 sy, 0.0 ni, 98.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st",
|
||||
"lets put a host name here: hostname",
|
||||
"and put an ip address here: hostname",
|
||||
"and put a non ip address here: 10.0",
|
||||
}
|
||||
sanitizeHostnames(lines)
|
||||
if !reflect.DeepEqual(lines, want) {
|
||||
t.Error("structures don't match")
|
||||
pretty.Println(want)
|
||||
pretty.Println(lines)
|
||||
}
|
||||
}
|
@@ -256,9 +256,11 @@ SKIP: {
|
||||
is($d->{S}, '/tmp/12345/mysql_sandbox12345.sock', 'Filled in socket');
|
||||
is($d->{h}, '127.0.0.1', 'Left hostname alone');
|
||||
|
||||
my $want = $sandbox_version lt '8.0' ? [ qw(utf8 utf8 utf8) ]: [ qw(utf8mb4 utf8mb4 utf8mb4) ];
|
||||
warn Data::Dumper::Dumper($want);
|
||||
is_deeply(
|
||||
$dbh->selectrow_arrayref('select @@character_set_client, @@character_set_connection, @@character_set_results'),
|
||||
[qw(utf8 utf8 utf8)],
|
||||
$want,
|
||||
'Set charset'
|
||||
);
|
||||
$dbh->disconnect();
|
||||
@@ -276,7 +278,7 @@ SKIP: {
|
||||
};
|
||||
is_deeply(
|
||||
$dbh->selectrow_arrayref('select @@character_set_client, @@character_set_connection, @@character_set_results'),
|
||||
[qw(utf8 utf8 utf8)],
|
||||
$want,
|
||||
'Set utf8 charset case-insensitively (issue 1282)'
|
||||
);
|
||||
};
|
||||
|
@@ -73,20 +73,27 @@ if ( $sandbox_version gt '5.6' ) {
|
||||
];
|
||||
}
|
||||
|
||||
is_deeply(
|
||||
$exa->explain_query(
|
||||
my $got = $exa->explain_query(
|
||||
dbh => $dbh,
|
||||
query => 'select * from actor where actor_id = 5',
|
||||
),
|
||||
);
|
||||
|
||||
$got->[0]->{filtered} = int($got->[0]->{filtered}) if (defined($got->[0]->{filtered}));
|
||||
|
||||
is_deeply(
|
||||
$got,
|
||||
$want,
|
||||
'Got a simple EXPLAIN result',
|
||||
);
|
||||
|
||||
is_deeply(
|
||||
$exa->explain_query(
|
||||
$got = $exa->explain_query(
|
||||
dbh => $dbh,
|
||||
query => 'delete from actor where actor_id = 5',
|
||||
),
|
||||
);
|
||||
$got->[0]->{filtered} = int($got->[0]->{filtered}) if (defined($got->[0]->{filtered}));
|
||||
|
||||
is_deeply(
|
||||
$got,
|
||||
$want,
|
||||
'Got EXPLAIN result for a DELETE',
|
||||
);
|
||||
|
@@ -270,6 +270,61 @@ test_log_parser(
|
||||
],
|
||||
);
|
||||
|
||||
# Customer issue from Ernie.
|
||||
test_log_parser(
|
||||
parser => $p,
|
||||
file => $sample.'pt-1573-general-log-system.log',
|
||||
oktorun => sub { $oktorun = $_[0]; },
|
||||
result => [
|
||||
{
|
||||
Query_time => 0,
|
||||
Thread_id => '257426',
|
||||
arg => 'administrator command: Connect',
|
||||
bytes => 30,
|
||||
cmd => 'Admin',
|
||||
host => '127.0.0.1',
|
||||
pos_in_log => 0,
|
||||
ts => '2018-09-07T18:45:40.098124+08:00',
|
||||
user => 'mysqlha_common'
|
||||
},
|
||||
{
|
||||
Query_time => 0,
|
||||
Thread_id => '257426',
|
||||
arg => 'set autocommit=0',
|
||||
bytes => 16,
|
||||
cmd => 'Query',
|
||||
pos_in_log => 285,
|
||||
ts => '2018-09-07T18:45:40.098511+08:00'
|
||||
},
|
||||
{
|
||||
Query_time => 0,
|
||||
Thread_id => '257426',
|
||||
arg => 'set autocommit=1',
|
||||
bytes => 16,
|
||||
cmd => 'Query',
|
||||
pos_in_log => 411,
|
||||
ts => '2018-09-07T18:45:40.098613+08:00'
|
||||
},
|
||||
{
|
||||
Query_time => 0,
|
||||
Thread_id => '257426',
|
||||
arg => 'show global status like \'Threads_connected\'',
|
||||
bytes => 43,
|
||||
cmd => 'Query',
|
||||
pos_in_log => 501,
|
||||
ts => '2018-09-07T18:45:40.098769+08:00'
|
||||
},
|
||||
{
|
||||
Query_time => 0,
|
||||
Thread_id => '257426',
|
||||
arg => 'administrator command: Quit',
|
||||
bytes => 27,
|
||||
cmd => 'Admin',
|
||||
pos_in_log => 547,
|
||||
ts => '2018-09-07T18:45:40.101009+08:00'
|
||||
}
|
||||
],
|
||||
);
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
@@ -173,9 +173,9 @@ SKIP: {
|
||||
d => $DBD::mysql::VERSION ge '4.001' ? undef : '(7)',
|
||||
dt => undef,
|
||||
ts => undef,
|
||||
c => '(3)',
|
||||
c2 => '(45)',
|
||||
v => '(96)',
|
||||
c => $sandbox_version ge '8.0' ? '(4)' : '(3)',
|
||||
c2 => $sandbox_version ge '8.0' ? '(60)' : '(45)',
|
||||
v => $sandbox_version ge '8.0' ? '(128)' : '(96)',
|
||||
t => undef,
|
||||
},
|
||||
},
|
||||
|
@@ -38,6 +38,8 @@ my $dbh = $sb->get_dbh_for('master');
|
||||
|
||||
if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
} else {
|
||||
plan tests => 62;
|
||||
}
|
||||
|
||||
my $q = new Quoter();
|
||||
@@ -65,6 +67,7 @@ my $in = "/t/lib/samples/NibbleIterator/";
|
||||
sub make_nibble_iter {
|
||||
my (%args) = @_;
|
||||
|
||||
|
||||
if (my $file = $args{sql_file}) {
|
||||
$sb->load_file('master', "$in/$file");
|
||||
}
|
||||
@@ -83,18 +86,19 @@ sub make_nibble_iter {
|
||||
1 while $si->next();
|
||||
|
||||
my $ni = new NibbleIterator(
|
||||
Cxn => $cxn,
|
||||
tbl => $schema->get_table(lc($args{db}), lc($args{tbl})),
|
||||
chunk_size => $o->get('chunk-size'),
|
||||
chunk_index => $o->get('chunk-index'),
|
||||
callbacks => $args{callbacks},
|
||||
select => $args{select},
|
||||
one_nibble => $args{one_nibble},
|
||||
resume => $args{resume},
|
||||
order_by => $args{order_by},
|
||||
comments => $args{comments},
|
||||
pause_file => $o->get('pause-file'),
|
||||
sleep => $args{sleep} || 60,
|
||||
Cxn => $cxn,
|
||||
tbl => $schema->get_table(lc($args{db}), lc($args{tbl})),
|
||||
chunk_size => $o->get('chunk-size'),
|
||||
chunk_index => $o->get('chunk-index'),
|
||||
callbacks => $args{callbacks},
|
||||
select => $args{select},
|
||||
one_nibble => $args{one_nibble},
|
||||
resume => $args{resume},
|
||||
order_by => $args{order_by},
|
||||
comments => $args{comments},
|
||||
n_chunk_index_cols => $o->get('chunk-index-columns'),
|
||||
pause_file => $o->get('pause-file'),
|
||||
sleep => $args{sleep} || 60,
|
||||
%common_modules,
|
||||
);
|
||||
|
||||
@@ -879,7 +883,7 @@ is_deeply(
|
||||
# #############################################################################
|
||||
|
||||
diag(`/tmp/12345/use < $trunk/t/lib/samples/cardinality.sql >/dev/null`);
|
||||
|
||||
$dbh->do('analyze table bad_tables.inv');
|
||||
$ni = make_nibble_iter(
|
||||
db => 'cardb',
|
||||
tbl => 't',
|
||||
@@ -892,6 +896,76 @@ is(
|
||||
"Use non-unique index with highest cardinality (bug 1199591)"
|
||||
);
|
||||
|
||||
$sb->load_file('master', "t/lib/samples/NibbleIterator/enum_keys.sql");
|
||||
$ni = undef;
|
||||
eval {
|
||||
$ni = make_nibble_iter(
|
||||
db => 'test',
|
||||
tbl => 't1',
|
||||
argv => [qw(--databases test --chunk-size 3)],
|
||||
);
|
||||
};
|
||||
|
||||
like(
|
||||
$EVAL_ERROR,
|
||||
qr/The index f3 in table `test`.`t1` has unsorted enum items/,
|
||||
"PT-1572 Die on unsorted enum items in index",
|
||||
);
|
||||
|
||||
eval {
|
||||
$ni = make_nibble_iter(
|
||||
db => 'test',
|
||||
tbl => 't1',
|
||||
argv => [qw(--databases test --force-concat-enums --chunk-size 3)],
|
||||
);
|
||||
};
|
||||
|
||||
like(
|
||||
$ni->{explain_first_lb_sql},
|
||||
qr/ORDER BY `f1`, `f2`, CONCAT\(`f3`\)/,
|
||||
"PT-1572 Use of CONCAT for unsorted ENUM field items without --",
|
||||
);
|
||||
|
||||
eval {
|
||||
$ni = make_nibble_iter(
|
||||
db => 'test',
|
||||
tbl => 't2',
|
||||
argv => [qw(--databases test --chunk-size 3)],
|
||||
);
|
||||
};
|
||||
|
||||
is(
|
||||
$EVAL_ERROR,
|
||||
'',
|
||||
"PT-1572 No errors on sorted enum items in index",
|
||||
);
|
||||
|
||||
like(
|
||||
$ni->{explain_first_lb_sql},
|
||||
qr/ORDER BY `f1`, `f2`, `f3`/,
|
||||
"PT-1572 Don't use CONCAT for sorted ENUM field items without --force-concat-enums",
|
||||
);
|
||||
|
||||
eval {
|
||||
$ni = make_nibble_iter(
|
||||
db => 'test',
|
||||
tbl => 't1',
|
||||
argv => [qw(--databases test --chunk-size 3 --chunk-index-columns 2)],
|
||||
);
|
||||
};
|
||||
|
||||
is(
|
||||
$EVAL_ERROR,
|
||||
'',
|
||||
"PT-1572 No errors on unsorted enum items in index and --chunk-index-columns",
|
||||
);
|
||||
|
||||
like(
|
||||
$ni->{explain_first_lb_sql},
|
||||
qr/ORDER BY `f1`, `f2`, `f3`/,
|
||||
"PT-1572 Don't use CONCAT for sorted ENUM field items without --force-concat-enums & --chunk-index-columns",
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
@@ -900,11 +974,15 @@ is(
|
||||
open STDERR, '>', \$output;
|
||||
$ni->_d('Complete test coverage');
|
||||
}
|
||||
|
||||
like(
|
||||
$output,
|
||||
qr/Complete test coverage/,
|
||||
'_d() works'
|
||||
);
|
||||
|
||||
$dbh->do("DROP DATABASE test");
|
||||
|
||||
$sb->wipe_clean($dbh);
|
||||
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||
done_testing;
|
||||
|
@@ -1220,9 +1220,11 @@ SKIP: {
|
||||
: $sandbox_version ge '5.1' ? "t/lib/samples/QueryReportFormatter/report025.txt"
|
||||
: "t/lib/samples/QueryReportFormatter/report026.txt");
|
||||
|
||||
# 30
|
||||
# 32
|
||||
my $explain_report = $qrf->explain_report("select * from qrf.t where i=2", 'qrf');
|
||||
$explain_report =~ s/filtered: 100(\s+)/filtered: 100.00$1/;
|
||||
is(
|
||||
$qrf->explain_report("select * from qrf.t where i=2", 'qrf'),
|
||||
$explain_report,
|
||||
$explain,
|
||||
"explain_report()"
|
||||
);
|
||||
|
@@ -23,8 +23,9 @@ my $dbh = $sb->get_dbh_for('master');
|
||||
|
||||
if ( !$dbh ) {
|
||||
plan skip_all => "Cannot connect to sandbox master";
|
||||
}
|
||||
else {
|
||||
} elsif ($sandbox_version ge '8.0') {
|
||||
plan skip_all => "There is no NO_AUTO_CREATE_USER in MySQL 8.0+";
|
||||
} else {
|
||||
plan tests => 4;
|
||||
}
|
||||
|
||||
|
@@ -624,9 +624,10 @@ is_deeply(
|
||||
'Type and length of CRC32'
|
||||
);
|
||||
|
||||
my $want = $sandbox_version ge '8.0' ? [qw(varchar 128)] : [qw(varchar 96)];
|
||||
is_deeply(
|
||||
[$c->get_crc_type($dbh, 'MD5')],
|
||||
[qw(varchar 96)],
|
||||
$want,
|
||||
'Type and length of MD5'
|
||||
);
|
||||
|
||||
|
@@ -1188,6 +1188,85 @@ SKIP: {
|
||||
) or die Data::Dumper::Dumper($tbl);
|
||||
}
|
||||
|
||||
# Test that the GENERATED word in a column comment doesn't make that column
|
||||
# to be detected as a MySQL 5.7+ generated column.
|
||||
$tbl = $tp->parse( load_file('t/lib/samples/generated_cols_comments.sql') );
|
||||
is_deeply(
|
||||
$tbl,
|
||||
{
|
||||
charset => 'latin1',
|
||||
clustered_key => 'PRIMARY',
|
||||
col_posn => {
|
||||
id => 0,
|
||||
source => 1,
|
||||
tso_id => 2
|
||||
},
|
||||
cols => [
|
||||
'id',
|
||||
'source',
|
||||
'tso_id'
|
||||
],
|
||||
defs => {
|
||||
id => ' `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT \'The unique id of the audit record.\'',
|
||||
source => ' `source` enum(\'val1\',\'val2\') NOT NULL COMMENT \'Transaction originator\'',
|
||||
tso_id => ' `tso_id` int(11) unsigned NOT NULL DEFAULT \'0\' COMMENT \'An internally generated transaction.\''
|
||||
},
|
||||
engine => 'InnoDB',
|
||||
is_autoinc => {
|
||||
id => 1,
|
||||
source => 0,
|
||||
tso_id => 0
|
||||
},
|
||||
is_col => {
|
||||
id => 1,
|
||||
source => 1,
|
||||
tso_id => 1
|
||||
},
|
||||
is_generated => {},
|
||||
is_nullable => {},
|
||||
is_numeric => {
|
||||
id => 1,
|
||||
tso_id => 1
|
||||
},
|
||||
keys => {
|
||||
PRIMARY => {
|
||||
col_prefixes => [
|
||||
undef
|
||||
],
|
||||
colnames => '`id`',
|
||||
cols => [
|
||||
'id'
|
||||
],
|
||||
ddl => 'PRIMARY KEY (`id`),',
|
||||
is_col => {
|
||||
id => 1
|
||||
},
|
||||
is_nullable => 0,
|
||||
is_unique => 1,
|
||||
name => 'PRIMARY',
|
||||
type => 'BTREE'
|
||||
}
|
||||
},
|
||||
name => 't1',
|
||||
non_generated_cols => [
|
||||
'id',
|
||||
'source',
|
||||
'tso_id'
|
||||
],
|
||||
null_cols => [],
|
||||
numeric_cols => [
|
||||
'id',
|
||||
'tso_id'
|
||||
],
|
||||
type_for => {
|
||||
id => 'int',
|
||||
source => 'enum',
|
||||
tso_id => 'int'
|
||||
}
|
||||
},
|
||||
'Column having the word "generated" as part of the comment is OK',
|
||||
) or diag Data::Dumper::Dumper($tbl);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
47
t/lib/samples/NibbleIterator/enum_keys.sql
Normal file
47
t/lib/samples/NibbleIterator/enum_keys.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
DROP DATABASE IF EXISTS test;
|
||||
CREATE DATABASE test;
|
||||
USE test;
|
||||
|
||||
-- Don't change the comments. The enum word inside the comment is there to test the table parser
|
||||
|
||||
CREATE TABLE `test`.`t1` (
|
||||
f1 DATE NOT NULL,
|
||||
f2 INT(10) UNSIGNED NOT NULL,
|
||||
f3 ENUM('c','a','b','d') NOT NULL DEFAULT 'c' COMMENT "unsorted enum items",
|
||||
f4 INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`f1`,`f2`,`f3`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
INSERT INTO `t1` VALUES
|
||||
('2018-07-27',165910161,'c',1375471152),
|
||||
('2018-07-27',393713658,'d',1382302491),
|
||||
('2018-07-27',472875023,'c',525456967),
|
||||
('2018-07-27',543582931,'c',1657080267),
|
||||
('2018-07-27',583532949,'d',280366509),
|
||||
('2018-07-27',1396416465,'d',1252007743),
|
||||
('2018-07-27',1705409249,'c',1714682759),
|
||||
('2018-07-27',1801160058,'a',1022430181),
|
||||
('2018-07-27',1898674299,'c',1310715836),
|
||||
('2018-07-27',2011751560,'a',109015753);
|
||||
|
||||
CREATE TABLE `test`.`t2` (
|
||||
f1 DATE NOT NULL,
|
||||
f2 INT(10) UNSIGNED NOT NULL,
|
||||
f3 ENUM('a','b','c','d') NOT NULL DEFAULT 'c' COMMENT "sorted enum items",
|
||||
f4 INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`f1`,`f2`,`f3`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
INSERT INTO `t2` VALUES
|
||||
('2018-07-27',165910161,'c',1375471152),
|
||||
('2018-07-27',393713658,'d',1382302491),
|
||||
('2018-07-27',472875023,'c',525456967),
|
||||
('2018-07-27',543582931,'c',1657080267),
|
||||
('2018-07-27',583532949,'d',280366509),
|
||||
('2018-07-27',1396416465,'d',1252007743),
|
||||
('2018-07-27',1705409249,'c',1714682759),
|
||||
('2018-07-27',1801160058,'a',1022430181),
|
||||
('2018-07-27',1898674299,'c',1310715836),
|
||||
('2018-07-27',2011751560,'a',109015753);
|
@@ -9,5 +9,5 @@
|
||||
# key_len: 4
|
||||
# ref: const
|
||||
# rows: 1
|
||||
# filtered: 100
|
||||
# filtered: 100.00
|
||||
# Extra: NULL
|
||||
|
@@ -6,7 +6,7 @@ CREATE TABLE `columns_priv` (
|
||||
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 COMMENT='Column privileges'
|
||||
|
||||
@@ -23,25 +23,25 @@ CREATE TABLE `db` (
|
||||
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`User` char(32) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Select_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Insert_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Update_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Delete_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Drop_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Grant_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`References_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Index_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Alter_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_view_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Show_view_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_routine_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Execute_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Event_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
PRIMARY KEY (`Host`,`Db`,`User`),
|
||||
KEY `User` (`User`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 COMMENT='Database privileges'
|
||||
@@ -63,7 +63,7 @@ CREATE TABLE `engine_cost` (
|
||||
`cost_value` float DEFAULT NULL,
|
||||
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`comment` varchar(1024) DEFAULT NULL,
|
||||
`default_value` float GENERATED ALWAYS AS ((case `cost_name` when _utf8'io_block_read_cost' then 1.0 when _utf8'memory_block_read_cost' then 0.25 else NULL end)) VIRTUAL,
|
||||
`default_value` float GENERATED ALWAYS AS ((case `cost_name` when _utf8mb3'io_block_read_cost' then 1.0 when _utf8mb3'memory_block_read_cost' then 0.25 else NULL end)) VIRTUAL,
|
||||
PRIMARY KEY (`cost_name`,`engine_name`,`device_type`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0
|
||||
|
||||
@@ -72,7 +72,7 @@ CREATE TABLE `func` (
|
||||
`name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`ret` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL,
|
||||
`type` enum('function','aggregate') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
PRIMARY KEY (`name`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 COMMENT='User defined functions'
|
||||
|
||||
@@ -80,8 +80,8 @@ mysql.global_grants
|
||||
CREATE TABLE `global_grants` (
|
||||
`USER` char(32) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`HOST` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`PRIV` char(32) CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`WITH_GRANT_OPTION` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`PRIV` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
|
||||
`WITH_GRANT_OPTION` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
PRIMARY KEY (`USER`,`HOST`,`PRIV`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 COMMENT='Extended global grants'
|
||||
|
||||
@@ -122,29 +122,6 @@ CREATE TABLE `help_topic` (
|
||||
UNIQUE KEY `name` (`name`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='help topics'
|
||||
|
||||
mysql.innodb_ddl_log
|
||||
CREATE TABLE `innodb_ddl_log` (
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`thread_id` bigint(20) unsigned NOT NULL,
|
||||
`type` int(10) unsigned NOT NULL,
|
||||
`space_id` int(10) unsigned DEFAULT NULL,
|
||||
`page_no` int(10) unsigned DEFAULT NULL,
|
||||
`index_id` bigint(20) unsigned DEFAULT NULL,
|
||||
`table_id` bigint(20) unsigned DEFAULT NULL,
|
||||
`old_file_path` varchar(512) COLLATE utf8_bin DEFAULT NULL,
|
||||
`new_file_path` varchar(512) COLLATE utf8_bin DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `thread_id` (`thread_id`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB AUTO_INCREMENT=478 DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
|
||||
|
||||
mysql.innodb_dynamic_metadata
|
||||
CREATE TABLE `innodb_dynamic_metadata` (
|
||||
`table_id` bigint(20) unsigned NOT NULL,
|
||||
`version` bigint(20) unsigned NOT NULL,
|
||||
`metadata` blob NOT NULL,
|
||||
PRIMARY KEY (`table_id`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
|
||||
|
||||
mysql.password_history
|
||||
CREATE TABLE `password_history` (
|
||||
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
@@ -166,10 +143,10 @@ CREATE TABLE `procs_priv` (
|
||||
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`User` char(32) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`Routine_name` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
|
||||
`Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
|
||||
`Grantor` char(93) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
|
||||
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
|
||||
KEY `Grantor` (`Grantor`)
|
||||
@@ -194,7 +171,7 @@ CREATE TABLE `role_edges` (
|
||||
`FROM_USER` char(32) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`TO_HOST` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`TO_USER` char(32) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`WITH_ADMIN_OPTION` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`WITH_ADMIN_OPTION` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
PRIMARY KEY (`FROM_HOST`,`FROM_USER`,`TO_HOST`,`TO_USER`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 COMMENT='Role hierarchy and role grants'
|
||||
|
||||
@@ -204,7 +181,7 @@ CREATE TABLE `server_cost` (
|
||||
`cost_value` float DEFAULT NULL,
|
||||
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`comment` varchar(1024) DEFAULT NULL,
|
||||
`default_value` float GENERATED ALWAYS AS ((case `cost_name` when _utf8'disk_temptable_create_cost' then 20.0 when _utf8'disk_temptable_row_cost' then 0.5 when _utf8'key_compare_cost' then 0.05 when _utf8'memory_temptable_create_cost' then 1.0 when _utf8'memory_temptable_row_cost' then 0.1 when _utf8'row_evaluate_cost' then 0.1 else NULL end)) VIRTUAL,
|
||||
`default_value` float GENERATED ALWAYS AS ((case `cost_name` when _utf8mb3'disk_temptable_create_cost' then 20.0 when _utf8mb3'disk_temptable_row_cost' then 0.5 when _utf8mb3'key_compare_cost' then 0.05 when _utf8mb3'memory_temptable_create_cost' then 1.0 when _utf8mb3'memory_temptable_row_cost' then 0.1 when _utf8mb3'row_evaluate_cost' then 0.1 else NULL end)) VIRTUAL,
|
||||
PRIMARY KEY (`cost_name`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0
|
||||
|
||||
@@ -230,8 +207,8 @@ CREATE TABLE `tables_priv` (
|
||||
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Grantor` char(93) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
|
||||
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
|
||||
KEY `Grantor` (`Grantor`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 COMMENT='Table privileges'
|
||||
@@ -239,7 +216,7 @@ CREATE TABLE `tables_priv` (
|
||||
mysql.time_zone
|
||||
CREATE TABLE `time_zone` (
|
||||
`Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N',
|
||||
`Use_leap_seconds` enum('Y','N') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
PRIMARY KEY (`Time_zone_id`)
|
||||
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Time zones'
|
||||
|
||||
@@ -279,36 +256,36 @@ mysql.user
|
||||
CREATE TABLE `user` (
|
||||
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`User` char(32) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`Select_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Insert_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Update_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Delete_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Drop_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Reload_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Shutdown_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Process_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`File_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Grant_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`References_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Index_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Alter_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Show_db_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Super_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Execute_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Repl_client_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_view_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Show_view_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_routine_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_user_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Event_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
|
||||
`ssl_cipher` blob NOT NULL,
|
||||
`x509_issuer` blob NOT NULL,
|
||||
`x509_subject` blob NOT NULL,
|
||||
@@ -318,12 +295,12 @@ CREATE TABLE `user` (
|
||||
`max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`plugin` char(64) COLLATE utf8_bin NOT NULL DEFAULT 'caching_sha2_password',
|
||||
`authentication_string` text COLLATE utf8_bin,
|
||||
`password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`password_expired` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`password_last_changed` timestamp NULL DEFAULT NULL,
|
||||
`password_lifetime` smallint(5) unsigned DEFAULT NULL,
|
||||
`account_locked` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_role_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Drop_role_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`account_locked` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_role_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Drop_role_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Password_reuse_history` smallint(5) unsigned DEFAULT NULL,
|
||||
`Password_reuse_time` smallint(5) unsigned DEFAULT NULL,
|
||||
PRIMARY KEY (`Host`,`User`)
|
||||
@@ -334,19 +311,19 @@ CREATE TABLE `checksums` (
|
||||
`db_tbl` varchar(128) NOT NULL,
|
||||
`checksum` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`db_tbl`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
|
||||
|
||||
percona_test.load_data
|
||||
CREATE TABLE `load_data` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
|
||||
|
||||
percona_test.sentinel
|
||||
CREATE TABLE `sentinel` (
|
||||
`id` int(11) NOT NULL,
|
||||
`ping` varchar(64) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
|
||||
|
||||
sakila.actor
|
||||
CREATE TABLE `actor` (
|
||||
@@ -571,5 +548,5 @@ CREATE TABLE `sys_config` (
|
||||
`set_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`set_by` varchar(128) DEFAULT NULL,
|
||||
PRIMARY KEY (`variable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
|
||||
|
||||
|
@@ -2,36 +2,36 @@ mysql.user
|
||||
CREATE TABLE `user` (
|
||||
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`User` char(32) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`Select_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Insert_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Update_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Delete_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Drop_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Reload_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Shutdown_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Process_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`File_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Grant_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`References_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Index_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Alter_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Show_db_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Super_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Execute_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Repl_client_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_view_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Show_view_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_routine_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_user_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Event_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
|
||||
`ssl_cipher` blob NOT NULL,
|
||||
`x509_issuer` blob NOT NULL,
|
||||
`x509_subject` blob NOT NULL,
|
||||
@@ -41,12 +41,12 @@ CREATE TABLE `user` (
|
||||
`max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`plugin` char(64) COLLATE utf8_bin NOT NULL DEFAULT 'caching_sha2_password',
|
||||
`authentication_string` text COLLATE utf8_bin,
|
||||
`password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`password_expired` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`password_last_changed` timestamp NULL DEFAULT NULL,
|
||||
`password_lifetime` smallint(5) unsigned DEFAULT NULL,
|
||||
`account_locked` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_role_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Drop_role_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`account_locked` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Create_role_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Drop_role_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
|
||||
`Password_reuse_history` smallint(5) unsigned DEFAULT NULL,
|
||||
`Password_reuse_time` smallint(5) unsigned DEFAULT NULL,
|
||||
PRIMARY KEY (`Host`,`User`)
|
||||
|
6
t/lib/samples/generated_cols_comments.sql
Normal file
6
t/lib/samples/generated_cols_comments.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
CREATE TABLE `t1` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'The unique id of the audit record.',
|
||||
`source` enum('val1','val2') NOT NULL COMMENT 'Transaction originator',
|
||||
`tso_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'An internally generated transaction.',
|
||||
PRIMARY KEY (`id`),
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='some comment here generated'
|
8
t/lib/samples/genlogs/pt-1573-general-log-system.log
Normal file
8
t/lib/samples/genlogs/pt-1573-general-log-system.log
Normal file
@@ -0,0 +1,8 @@
|
||||
/usr/local/mysql-5.7.21/bin/mysqld, Version: 5.7.21-log (MySQL Community Server (GPL)). started with:
|
||||
Tcp port: 5721 Unix socket: /tmp/mysql5721.sock
|
||||
Time Id Command Argument
|
||||
2018-09-07T18:45:40.098124+08:00 257426 Connect mysqlha_common@127.0.0.1 on using TCP/IP
|
||||
2018-09-07T18:45:40.098511+08:00 257426 Query set autocommit=0
|
||||
2018-09-07T18:45:40.098613+08:00 257426 Query set autocommit=1
|
||||
2018-09-07T18:45:40.098769+08:00 257426 Query show global status like 'Threads_connected'
|
||||
2018-09-07T18:45:40.101009+08:00 257426 Quit
|
@@ -46,7 +46,6 @@ is($output, <<EOF
|
||||
2\t\\N\t3\t4
|
||||
3\t2\t3\t\\\t
|
||||
4\t2\t3\t\\
|
||||
|
||||
EOF
|
||||
, 'File has the right stuff');
|
||||
`rm -f archive.test.table_1`;
|
||||
@@ -124,8 +123,8 @@ $output = output(
|
||||
);
|
||||
$output = `cat archive.test.table_2`;
|
||||
is($output, <<EOF
|
||||
1, 2, 3, "4"
|
||||
2, "\\N", 3, "4"
|
||||
1, 2, 3, 4
|
||||
2, "\\N", 3, 4
|
||||
3, 2, 3, "\\\t"
|
||||
4, 2, 3, "\\\n"
|
||||
5, 2, 3, "Zapp \\"Brannigan"
|
||||
|
@@ -140,10 +140,11 @@ ok(
|
||||
|
||||
$sb->load_file('master', 't/lib/samples/dupekeys/simple_dupe_bug_1217013.sql', 'test');
|
||||
|
||||
my $want = $sandbox_version lt '8.0' ? "$sample/simple_dupe_bug_1217013.txt" : "$sample/simple_dupe_bug_1217013_80.txt";
|
||||
ok(
|
||||
no_diff(
|
||||
sub { pt_duplicate_key_checker::main(@args, qw(-t test.domains -v)) },
|
||||
"$sample/simple_dupe_bug_1217013.txt"),
|
||||
$want),
|
||||
'Exact unique dupes (bug 1217013)'
|
||||
) or diag($test_diff);
|
||||
|
||||
@@ -152,10 +153,11 @@ ok(
|
||||
# https://bugs.launchpad.net/percona-toolkit/+bug/1402730
|
||||
# #############################################################################
|
||||
|
||||
$want = $sandbox_version lt '8.0' ? "$sample/simple_dupe_bug_1402730.txt" : "$sample/simple_dupe_bug_1402730_80.txt";
|
||||
ok(
|
||||
no_diff(
|
||||
sub { pt_duplicate_key_checker::main(@args, qw(-t test.domains --verbose)) },
|
||||
"$sample/simple_dupe_bug_1217013.txt", keep_output=>1),
|
||||
"$want", keep_output=>1),
|
||||
q[--verbose option doesn't skip dupes reporting (bug 1402730)]
|
||||
) or diag($test_diff);
|
||||
|
||||
|
@@ -0,0 +1,25 @@
|
||||
# ########################################################################
|
||||
# test.domains
|
||||
# ########################################################################
|
||||
|
||||
# PRIMARY (`id`)
|
||||
# domain (`domain`)
|
||||
# unique_key_domain (`domain`)
|
||||
|
||||
# Uniqueness of domain ignored because unique_key_domain is a duplicate constraint
|
||||
# domain is a duplicate of unique_key_domain
|
||||
# Key definitions:
|
||||
# UNIQUE KEY `domain` (`domain`),
|
||||
# UNIQUE KEY `unique_key_domain` (`domain`)
|
||||
# Column types:
|
||||
# `domain` varchar(175) character set utf8 collate utf8_bin not null
|
||||
# To remove this duplicate index, execute:
|
||||
ALTER TABLE `test`.`domains` DROP INDEX `domain`;
|
||||
|
||||
# ########################################################################
|
||||
# Summary of indexes
|
||||
# ########################################################################
|
||||
|
||||
# Size Duplicate Indexes 527
|
||||
# Total Duplicate Indexes 1
|
||||
# Total Indexes 3
|
@@ -0,0 +1,25 @@
|
||||
# ########################################################################
|
||||
# test.domains
|
||||
# ########################################################################
|
||||
|
||||
# PRIMARY (`id`)
|
||||
# domain (`domain`)
|
||||
# unique_key_domain (`domain`)
|
||||
|
||||
# Uniqueness of domain ignored because unique_key_domain is a duplicate constraint
|
||||
# domain is a duplicate of unique_key_domain
|
||||
# Key definitions:
|
||||
# UNIQUE KEY `domain` (`domain`),
|
||||
# UNIQUE KEY `unique_key_domain` (`domain`)
|
||||
# Column types:
|
||||
# `domain` varchar(175) collate utf8_bin not null
|
||||
# To remove this duplicate index, execute:
|
||||
ALTER TABLE `test`.`domains` DROP INDEX `domain`;
|
||||
|
||||
# ########################################################################
|
||||
# Summary of indexes
|
||||
# ########################################################################
|
||||
|
||||
# Size Duplicate Indexes 527
|
||||
# Total Duplicate Indexes 1
|
||||
# Total Indexes 3
|
@@ -0,0 +1,25 @@
|
||||
# ########################################################################
|
||||
# test.domains
|
||||
# ########################################################################
|
||||
|
||||
# PRIMARY (`id`)
|
||||
# domain (`domain`)
|
||||
# unique_key_domain (`domain`)
|
||||
|
||||
# Uniqueness of domain ignored because unique_key_domain is a duplicate constraint
|
||||
# domain is a duplicate of unique_key_domain
|
||||
# Key definitions:
|
||||
# UNIQUE KEY `domain` (`domain`),
|
||||
# UNIQUE KEY `unique_key_domain` (`domain`)
|
||||
# Column types:
|
||||
# `domain` varchar(175) character set utf8 collate utf8_bin not null
|
||||
# To remove this duplicate index, execute:
|
||||
ALTER TABLE `test`.`domains` DROP INDEX `domain`;
|
||||
|
||||
# ########################################################################
|
||||
# Summary of indexes
|
||||
# ########################################################################
|
||||
|
||||
# Size Duplicate Indexes 527
|
||||
# Total Duplicate Indexes 1
|
||||
# Total Indexes 3
|
@@ -260,7 +260,12 @@ is(
|
||||
# --check-read-only
|
||||
# #############################################################################
|
||||
|
||||
diag(`/tmp/12345/use -u root -e "GRANT ALL ON *.* TO 'bob'\@'%' IDENTIFIED BY 'msandbox'"`);
|
||||
if ($sandbox_version ge '8.0') {
|
||||
diag(`/tmp/12345/use -u root -e "CREATE USER 'bob'\@'%' IDENTIFIED WITH mysql_native_password BY 'msandbox'"`);
|
||||
} else {
|
||||
diag(`/tmp/12345/use -u root -e "CREATE USER 'bob'\@'%' IDENTIFIED BY 'msandbox'"`);
|
||||
}
|
||||
diag(`/tmp/12345/use -u root -e "GRANT ALL ON *.* TO 'bob'\@'%'"`);
|
||||
diag(`/tmp/12345/use -u root -e "REVOKE SUPER ON *.* FROM 'bob'\@'%'"`);
|
||||
if ($sandbox_version ge '8.0') {
|
||||
diag(`/tmp/12345/use -u root -e "REVOKE CONNECTION_ADMIN ON *.* FROM 'bob'\@'%'"`);
|
||||
|
@@ -65,7 +65,12 @@ my $create_table_sql = <<__EOQ;
|
||||
__EOQ
|
||||
|
||||
$sb->do_as_root('master', "$create_table_sql");
|
||||
$sb->do_as_root('slave1', 'GRANT SELECT, INSERT, UPDATE, REPLICATION CLIENT ON *.* TO "unprivileged"@"localhost" IDENTIFIED BY "password"');
|
||||
if ($sandbox_version ge '8.0') {
|
||||
$sb->do_as_root('slave1', 'CREATE USER "unprivileged"@"localhost" IDENTIFIED WITH mysql_native_password BY "password"');
|
||||
} else {
|
||||
$sb->do_as_root('slave1', 'CREATE USER "unprivileged"@"localhost" IDENTIFIED BY "password"');
|
||||
}
|
||||
$sb->do_as_root('slave1', 'GRANT SELECT, INSERT, UPDATE, REPLICATION CLIENT ON *.* TO "unprivileged"@"localhost"');
|
||||
$sb->do_as_root('slave1', "FLUSH TABLES WITH READ LOCK;");
|
||||
$sb->do_as_root('slave1', "SET GLOBAL read_only = 1;");
|
||||
|
||||
|
@@ -87,9 +87,13 @@ like(
|
||||
"InnoDB section present"
|
||||
);
|
||||
|
||||
my $users_count = 2;
|
||||
if ($ENV{FORK} || "" eq 'mariadb') {
|
||||
$users_count = 8;
|
||||
}
|
||||
like(
|
||||
$out,
|
||||
qr/Users \| 2/,
|
||||
qr/Users \| $users_count/,
|
||||
"Security works"
|
||||
);
|
||||
|
||||
|
@@ -105,7 +105,7 @@ for my $i (2..7) {
|
||||
},
|
||||
"t/pt-mysql-summary/samples/expected_output_temp_enc00$i.txt",
|
||||
),
|
||||
"--read-samples works for t/pt-mysql-summary/temp00$i",
|
||||
"--read-samples works for t/pt-mysql-summary/temp_enc00$i",
|
||||
) or diag($test_diff);
|
||||
}
|
||||
|
||||
@@ -153,6 +153,8 @@ like(
|
||||
"Encrypted tablespaces included in report"
|
||||
) or diag $out;
|
||||
|
||||
$master_dbh->do("DROP TABLE IF EXISTS test.t1");
|
||||
$master_dbh->do("DROP TABLE IF EXISTS test.t2");
|
||||
$master_dbh->do("DROP DATABASE IF EXISTS test");
|
||||
$master_dbh->do("DROP TABLESPACE foo");
|
||||
|
||||
|
@@ -277,3 +277,4 @@ report-port = 12345
|
||||
log-error = mysqld.log
|
||||
innodb_lock_wait_timeout = 3
|
||||
# Memory management library ##################################
|
||||
# The End ####################################################
|
||||
|
@@ -220,3 +220,4 @@ report-port = 12345
|
||||
log-error = mysqld.log
|
||||
innodb_lock_wait_timeout = 3
|
||||
# Memory management library ##################################
|
||||
# The End ####################################################
|
||||
|
@@ -219,3 +219,4 @@ report-port = 12345
|
||||
log-error = mysqld.log
|
||||
innodb_lock_wait_timeout = 3
|
||||
# Memory management library ##################################
|
||||
# The End ####################################################
|
||||
|
@@ -292,3 +292,4 @@ report-port = 12345
|
||||
log-error = mysqld.log
|
||||
innodb_lock_wait_timeout = 3
|
||||
# Memory management library ##################################
|
||||
# The End ####################################################
|
||||
|
@@ -341,3 +341,4 @@ log_queries_not_using_indexes | OFF
|
||||
# Configuration File #########################################
|
||||
Config File | Cannot autodetect or find, giving up
|
||||
# Memory management library ##################################
|
||||
# The End ####################################################
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user