fixed pt-upgrade tests for 5.7 compatibility

This commit is contained in:
frank-cizmich
2016-01-16 19:50:18 -03:00
parent 223ad43ecd
commit 66470938d7
4 changed files with 43 additions and 1 deletions

View File

@@ -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.
# #############################################################################

View File

@@ -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.
# #############################################################################

View File

@@ -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.
# #############################################################################

View File

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