Fixed all tests for MySQL 5.7

Most of the failing tests were failing due to changes in MySQL 5.7
default sql_mode and because of invalid timestamps ('0000-00-00')
This commit is contained in:
Carlos Salguero
2017-05-03 15:48:11 -03:00
parent e6e54839bf
commit f6d2e89027
10 changed files with 747 additions and 142 deletions

View File

@@ -39,6 +39,7 @@ use Data::Dumper;
$Data::Dumper::Indent = 1;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Quotekeys = 0;
use VersionParser;
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
@@ -844,7 +845,14 @@ sub _explain_query {
$dbh->do($sql);
}
$sql = "EXPLAIN EXTENDED $query";
$self->{db_version} ||= VersionParser->new($dbh);
if ( $self->{db_version} < '5.7.3' ) {
$sql = "EXPLAIN EXTENDED $query";
}
else {
$sql = "EXPLAIN $query"; # EXTENDED is implicit as of 5.7.3
}
PTDEBUG && _d($dbh, $sql);
eval {
$dbh->do($sql); # don't need the result