Fixes for MasterSlave.pm

This commit is contained in:
Carlos Salguero
2018-01-22 16:27:36 -03:00
parent a828b7af54
commit 045c656839
9 changed files with 16 additions and 11 deletions

View File

@@ -2306,7 +2306,7 @@ report_mysql_summary () {
name_val "InnoDB compression" "$(get_plugin_status "$dir/mysql-plugins" "INNODB_CMP")"
local has_query_cache=$(get_var have_query_cache "$dir/mysql-variables")
if [ "$has_query_cache == 'YES' ]; then
if [ "$has_query_cache" = 'YES' ]; then
section "Query cache"
local query_cache_size=$(get_var query_cache_size "$dir/mysql-variables")
local used=$(( ${query_cache_size} - $(get_var Qcache_free_memory "$dir/mysql-status") ))

View File

@@ -7015,7 +7015,7 @@ sub query_report {
}
}
my $partitions_msg = $self->{no_partitions} ? '' : '/*!50100 PARTITIONS */';
my $partitions_msg = $self->{no_partitions} ? '' : '/*!50100 PARTITIONS*/';
if ( $groupby eq 'fingerprint' ) {
my $samp_query = $qr->shorten($vals->{samp_query}, $self->{options}->{shorten})
if $self->{options}->{shorten};
@@ -7750,7 +7750,7 @@ sub explain_report {
}
my $sth;
eval {
$sth = $dbh->prepare("EXPLAIN /*!50100 PARTITIONS */ $query");
$sth = $dbh->prepare("EXPLAIN /*!50100 PARTITIONS*/ $query");
$sth->execute();
};
if ($EVAL_ERROR) { # MySQL 8.0+ doesn't support PARTITIONS

View File

@@ -2012,7 +2012,7 @@ sub main {
my $grant = $_;
PTDEBUG && _d($grant);
my ( $grants, $on_what, $user ) = $grant
=~ m/GRANT (.*?) ON (.*?) TO ([`'][^'`]*[`']\@[`'][^'`]*[`'])/;
=~ m/GRANT (.*?) ON (.*?) TO ([`'][^'`]*[`']\@[`'][^'`]*[`'])/; # MySQL 8 uses ` instead of ' for `user`@`host`
PTDEBUG && _d('grants:', $grants, 'on_what:', $on_what,
'user:', $user);

View File

@@ -467,7 +467,7 @@ sub query_report {
}
}
my $partitions_msg = $self->{no_partitions} ? '' : '/*!50100 PARTITIONS */';
my $partitions_msg = $self->{no_partitions} ? '' : '/*!50100 PARTITIONS*/';
if ( $groupby eq 'fingerprint' ) {
# Shorten it if necessary (issue 216 and 292).
my $samp_query = $qr->shorten($vals->{samp_query}, $self->{options}->{shorten})
@@ -1308,7 +1308,7 @@ sub explain_report {
}
my $sth;
eval {
$sth = $dbh->prepare("EXPLAIN /*!50100 PARTITIONS */ $query");
$sth = $dbh->prepare("EXPLAIN /*!50100 PARTITIONS*/ $query");
$sth->execute();
};
if ($EVAL_ERROR) { # MySQL 8.0+ doesn't support PARTITIONS

Binary file not shown.

View File

@@ -3,7 +3,6 @@ user = msandbox
password = msandbox
port = PORT
socket = /tmp/PORT/mysql_sandboxPORT.sock
loose-local-infile=1
[mysqld]
port = PORT

View File

@@ -326,12 +326,17 @@ like($EVAL_ERROR, qr/has no connected slaves/, 'slave 1 is not slave of slave 2'
map { $ms->stop_slave($_) } @slaves;
map { $ms->start_slave($_) } @slaves;
# Give the slaves so time to restart
sleep(5);
my $res;
$res = $ms->wait_for_master(
master_status => $ms->get_master_status($dbh),
slave_dbh => $slaves[0],
timeout => 1,
timeout => 10,
);
warn "res->{result}: $res->{result}";
ok($res->{result} >= 0, 'Wait was successful');
$ms->stop_slave($slaves[0]);

View File

@@ -59,8 +59,9 @@ ok(
# entirely by the first iteration.
ok(
no_diff($run_with . 'slow002.txt --iterations 2 --report-format=query_report,profile --limit 1',
"t/pt-query-digest/samples/slow002_iters_2.txt"),
'--iterations'
"t/pt-query-digest/samples/slow002_iters_2.txt",
),
'--iterations' ,
);
# #############################################################################

View File

@@ -36,7 +36,7 @@ update db2.tuningdetail_21_265507 n
inner join db1.gonzo a using(gonzo)
set n.column1 = a.column1, n.word3 = a.word3\G
# Converted for EXPLAIN
# EXPLAIN /*!50100 PARTITIONS*/
# EXPLAIN /*!50100 PARTITIONS */
select n.column1 = a.column1, n.word3 = a.word3 from db2.tuningdetail_21_265507 n
inner join db1.gonzo a using(gonzo) \G