MDEV-37852 mytop: fix connection to localhost

If a port is specified and DBD-MariaDB is used. This resulted in in:

("Connection error: port cannot be specified when host is localhost or embedded")

Fixes Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1109394
This commit is contained in:
jweisbuch 2025-07-16 18:00:34 +02:00 committed by Daniel Black
parent 9220be8866
commit b9c3ee3bb5

View File

@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
# $Id: mytop,v 1.99-maria6 2019/10/22 14:53:51 jweisbuch Exp $
# $Id: mytop,v 1.99-maria8 2025/07/16 17:59:26 jweisbuch Exp $
=pod
@ -21,7 +21,7 @@ use Socket;
use List::Util qw(min max);
use File::Basename;
$main::VERSION = "1.99-maria6";
$main::VERSION = "1.99-maria8";
my $path_for_script = dirname($0);
$| = 1;
@ -256,7 +256,11 @@ if (eval {DBI->install_driver("MariaDB")}) {
if ($config{socket} and -S $config{socket})
{
$dsn .= "${prefix}_socket=$config{socket}";
$dsn .= "${prefix}_socket=$config{socket}";
}
elsif($config{host} eq "localhost")
{
$dsn .= "host=$config{host}";
}
else
{