From e5ac6e95fa945d613796173f88c28e3311741daa Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Tue, 4 Feb 2014 15:30:04 -0600 Subject: [PATCH] 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. --- scripts/zmupdate.pl.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/zmupdate.pl.in b/scripts/zmupdate.pl.in index cc2e93467..d2a511597 100644 --- a/scripts/zmupdate.pl.in +++ b/scripts/zmupdate.pl.in @@ -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 } } }