Update zmupdate.pl.in
mysql generates a warning, instead of an error, when trying to convert to InnoDB and that engine is not available. By temporarily elevating warnings to errors, we can catch these rather than silently failing.
This commit is contained in:
parent
4f2b09a36d
commit
e5ac6e95fa
|
@ -338,10 +338,12 @@ if ( @MyISAM_Tables ) {
|
|||
if ( $response =~ /^[yY]$/ ) {
|
||||
print "\nConverting MyISAM tables to InnoDB. Please wait.\n";
|
||||
foreach (@MyISAM_Tables) {
|
||||
$dbh->do(q|SET sql_mode='traditional'|); # Elevate warnings to errors
|
||||
my $sql = "ALTER TABLE $_ ENGINE = InnoDB";
|
||||
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||
my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() );
|
||||
$sth->finish();
|
||||
$dbh->do(q|SET sql_mode=''|); # Set mode back to default
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue