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 $dbh = shift;
my $version = 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'; my $command = 'mysql';
if ( defined($portOrSocket) ) { if ( defined($portOrSocket) ) {
if ( $portOrSocket =~ /^\// ) { if ( $portOrSocket =~ /^\// ) {
@ -980,7 +980,7 @@ sub patchDB {
} else { } else {
$command .= ' -h'.$host.' -P'.$portOrSocket; $command .= ' -h'.$host.' -P'.$portOrSocket;
} }
} else { } elsif ( $host ) {
$command .= ' -h'.$host; $command .= ' -h'.$host;
} }
if ( $dbUser ) { if ( $dbUser ) {