Commit 59e3ac2e authored by Jean Weisbuch's avatar Jean Weisbuch Committed by Anel Husakovic

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

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

Apply #1546
parent c3a1ba0f
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment