MDEV-25878: mytop bugs: check for mysql driver and sockets

mytop fall-back to DBD::mysql if DBD::MariaDB is not available

Apply #1546
This commit is contained in:
Jean Weisbuch 2020-05-18 15:18:56 +02:00 committed by Anel Husakovic
parent c3a1ba0fd9
commit 59e3ac2e67

View File

@ -242,7 +242,11 @@ my $dsn;
## Socket takes precedence.
$dsn ="DBI:MariaDB:database=$config{db};mariadb_read_default_group=mytop;";
if (eval {DBI->install_driver("MariaDB")}) {
$dsn = "DBI:MariaDB:database=$config{db};mariadb_read_default_group=mytop;";
} else {
$dsn = "DBI:mysql:database=$config{db};mysql_read_default_group=mytop;";
}
if ($config{socket} and -S $config{socket})
{
@ -2095,7 +2099,7 @@ following:
* Perl 5.005 or newer
* Getopt::Long
* DBI and DBD::MariaDB
* DBI and DBD::MariaDB or DBD::mysql
* Term::ReadKey from CPAN
Most systems are likely to have all of those installed--except for