mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-17 17:27:57 +00:00
fixed pt-upgrade tests for 5.7 compatibility
This commit is contained in:
@@ -56,6 +56,16 @@ sub load_sample_sql_files {
|
||||
}
|
||||
}
|
||||
|
||||
# default 5.7 mode "STRICT_TRANS_TABLES" converts truncation warnings to errors
|
||||
# as this is simply a change in category of difference, we disable it for
|
||||
# test to work.
|
||||
|
||||
use SqlModes;
|
||||
my $modes_host1 = new SqlModes($dbh1, global=>1);
|
||||
my $modes_host2 = new SqlModes($dbh2, global=>1);
|
||||
$modes_host1->del('STRICT_TRANS_TABLES');
|
||||
$modes_host2->del('STRICT_TRANS_TABLES');
|
||||
|
||||
while ( my $sampleno = readdir $dh ) {
|
||||
next unless $sampleno =~ m/^\d+$/;
|
||||
|
||||
@@ -103,6 +113,9 @@ while ( my $sampleno = readdir $dh ) {
|
||||
|
||||
close $dh;
|
||||
|
||||
$modes_host1->restore_original_modes();
|
||||
$modes_host2->restore_original_modes();
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
@@ -59,6 +59,16 @@ sub load_sample_sql_files {
|
||||
}
|
||||
}
|
||||
|
||||
# default 5.7 mode "STRICT_TRANS_TABLES" converts truncation warnings to errors
|
||||
# as this is simply a change in category of difference, we disable it for
|
||||
# test to work.
|
||||
|
||||
use SqlModes;
|
||||
my $modes_host1 = new SqlModes($dbh1, global=>1);
|
||||
my $modes_host2 = new SqlModes($dbh2, global=>1);
|
||||
$modes_host1->del('STRICT_TRANS_TABLES');
|
||||
$modes_host2->del('STRICT_TRANS_TABLES');
|
||||
|
||||
while ( my $sampleno = readdir $dh ) {
|
||||
next unless $sampleno =~ m/^\d+$/;
|
||||
|
||||
@@ -123,6 +133,9 @@ while ( my $sampleno = readdir $dh ) {
|
||||
|
||||
close $dh;
|
||||
|
||||
$modes_host1->restore_original_modes();
|
||||
$modes_host2->restore_original_modes();
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
@@ -36,13 +36,26 @@ sub clear_warnings {
|
||||
$dbh2->do("SELECT /* clear warnings */ 1 FROM mysql.user");
|
||||
}
|
||||
|
||||
# default 5.7 mode "STRICT_TRANS_TABLES" converts truncation warnings to errors
|
||||
# as this is simply a change in category of difference, we disable it for
|
||||
# test to work.
|
||||
|
||||
use SqlModes;
|
||||
my $modes_host1 = new SqlModes($dbh1, global=>1);
|
||||
my $modes_host2 = new SqlModes($dbh2, global=>1);
|
||||
$modes_host1->del('STRICT_TRANS_TABLES');
|
||||
$modes_host2->del('STRICT_TRANS_TABLES');
|
||||
|
||||
$dbh1->do("INSERT INTO test.t VALUES (2, '', 123456789)");
|
||||
$dbh2->do("INSERT INTO test.t VALUES (3, '', 123456789)");
|
||||
|
||||
|
||||
my $event_exec = EventExecutor->new();
|
||||
my $w1 = $event_exec->get_warnings(dbh => $dbh1);
|
||||
my $w2 = $event_exec->get_warnings(dbh => $dbh2);
|
||||
|
||||
|
||||
|
||||
my $error_1264 = {
|
||||
code => '1264',
|
||||
level => 'Warning',
|
||||
@@ -111,6 +124,9 @@ is_deeply(
|
||||
'Ignore a warning'
|
||||
) or diag(Dumper($diffs));
|
||||
|
||||
$modes_host1->restore_original_modes();
|
||||
$modes_host2->restore_original_modes();
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
@@ -59,7 +59,7 @@ $output = output(
|
||||
my $t = time - $t0;
|
||||
|
||||
ok(
|
||||
$t >= 3 && $t <= 6,
|
||||
$t >= 3 && $t <= ($ENV{PERCONA_SLOW_BOX} ? 8 : 6),
|
||||
"Exec queries: ran for roughly --run-time seconds"
|
||||
) or diag($output, 'Actual run time:', $t);
|
||||
|
||||
|
Reference in New Issue
Block a user