mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-18 02:06:49 +08:00
Replace MKDEBUG with PTDEBUG in modules.
This commit is contained in:
@@ -25,7 +25,7 @@ package CompareWarnings;
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use constant MKDEBUG => $ENV{MKDEBUG} || 0;
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
use Data::Dumper;
|
||||
$Data::Dumper::Indent = 1;
|
||||
@@ -76,7 +76,7 @@ sub before_execute {
|
||||
|
||||
if ( my $tbl = $self->{'clear-warnings-table'} ) {
|
||||
$sql = "SELECT * FROM $tbl LIMIT 1";
|
||||
MKDEBUG && _d($sql);
|
||||
PTDEBUG && _d($sql);
|
||||
eval {
|
||||
$dbh->do($sql);
|
||||
};
|
||||
@@ -91,15 +91,15 @@ sub before_execute {
|
||||
TABLE:
|
||||
foreach my $tbl ( @tbls ) {
|
||||
$sql = "SELECT * FROM $tbl LIMIT 1";
|
||||
MKDEBUG && _d($sql);
|
||||
PTDEBUG && _d($sql);
|
||||
eval {
|
||||
$dbh->do($sql);
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
MKDEBUG && _d('Failed to clear warnings');
|
||||
PTDEBUG && _d('Failed to clear warnings');
|
||||
}
|
||||
else {
|
||||
MKDEBUG && _d('Cleared warnings');
|
||||
PTDEBUG && _d('Cleared warnings');
|
||||
$ok = 1;
|
||||
last TABLE;
|
||||
}
|
||||
@@ -128,11 +128,11 @@ sub execute {
|
||||
my ($event, $dbh) = @args{@required_args};
|
||||
|
||||
if ( exists $event->{Query_time} ) {
|
||||
MKDEBUG && _d('Query already executed');
|
||||
PTDEBUG && _d('Query already executed');
|
||||
return $event;
|
||||
}
|
||||
|
||||
MKDEBUG && _d('Executing query');
|
||||
PTDEBUG && _d('Executing query');
|
||||
my $query = $event->{arg};
|
||||
my ( $start, $end, $query_time );
|
||||
|
||||
@@ -215,7 +215,7 @@ sub compare {
|
||||
my $event = $events->[$i];
|
||||
|
||||
if ( ($event0->{warning_count} || 0) != ($event->{warning_count} || 0) ) {
|
||||
MKDEBUG && _d('Warning counts differ:',
|
||||
PTDEBUG && _d('Warning counts differ:',
|
||||
$event0->{warning_count}, $event->{warning_count});
|
||||
$different_warning_counts++;
|
||||
$self->{diffs}->{warning_counts}->{$item}->{$sampleno}
|
||||
@@ -233,7 +233,7 @@ sub compare {
|
||||
foreach my $code ( keys %$w0 ) {
|
||||
if ( exists $w->{$code} ) {
|
||||
if ( $w->{$code}->{Level} ne $w0->{$code}->{Level} ) {
|
||||
MKDEBUG && _d('Warning levels differ:',
|
||||
PTDEBUG && _d('Warning levels differ:',
|
||||
$w0->{$code}->{Level}, $w->{$code}->{Level});
|
||||
# Save differences.
|
||||
$different_warning_levels++;
|
||||
@@ -246,7 +246,7 @@ sub compare {
|
||||
}
|
||||
else {
|
||||
# This warning code is on event0 but not on this event.
|
||||
MKDEBUG && _d('Warning gone:', $w0->{$code}->{Message});
|
||||
PTDEBUG && _d('Warning gone:', $w0->{$code}->{Message});
|
||||
# Save differences.
|
||||
$different_warnings++;
|
||||
$self->{diffs}->{warnings}->{$item}->{$sampleno}
|
||||
@@ -258,7 +258,7 @@ sub compare {
|
||||
# Any warning codes on this event not deleted above are new;
|
||||
# i.e. they weren't on event0.
|
||||
foreach my $code ( keys %$w ) {
|
||||
MKDEBUG && _d('Warning new:', $w->{$code}->{Message});
|
||||
PTDEBUG && _d('Warning new:', $w->{$code}->{Message});
|
||||
# Save differences.
|
||||
$different_warnings++;
|
||||
$self->{diffs}->{warnings}->{$item}->{$sampleno}
|
||||
|
||||
Reference in New Issue
Block a user