Handle no db_host specified, meaning local unix socket

This commit is contained in:
Isaac Connor 2020-06-04 11:28:26 -04:00
parent 87078dfc31
commit 6869710747
1 changed files with 2 additions and 2 deletions

View File

@ -972,7 +972,7 @@ sub patchDB {
my $dbh = shift;
my $version = shift;
my ( $host, $portOrSocket ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
my ( $host, $portOrSocket ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ ) if $Config{ZM_DB_HOST};
my $command = 'mysql';
if ( defined($portOrSocket) ) {
if ( $portOrSocket =~ /^\// ) {
@ -980,7 +980,7 @@ sub patchDB {
} else {
$command .= ' -h'.$host.' -P'.$portOrSocket;
}
} else {
} elsif ( $host ) {
$command .= ' -h'.$host;
}
if ( $dbUser ) {