Issue #2165: support perconaserverclient.so for MySQL/MariaDB mode, and filter away libraries like libmariadbd.so

This commit is contained in:
Ansgar Becker
2025-05-09 09:55:02 +02:00
parent 8035252f07
commit cb293a98b0

View File

@ -1870,27 +1870,24 @@ begin
rx.ModifierI := True; rx.ModifierI := True;
case NetTypeGroup of case NetTypeGroup of
ngMySQL: ngMySQL:
{$IfDef LINUX} {$If defined(LINUX)}
// libmariadb.so.0 (libc,...) => /lib/x86_64-linux-gnu/libmariadb.so // libmariadb.so.0 (libc,...) => /lib/x86_64-linux-gnu/libmariadb.so
rx.Expression := '^\s*lib(mysqlclient|mariadb)[^=]+=>\s*(\S+)$'; rx.Expression := '^\s*lib(mysqlclient|mariadb|perconaserverclient)\.[^=]+=>\s*(\S+)$';
{$EndIf} {$ElseIf defined(WINDOWS)}
{$IfDef WINDOWS}
rx.Expression := '^lib(mysql|mariadb).*\.' + GetDynLibExtension; rx.Expression := '^lib(mysql|mariadb).*\.' + GetDynLibExtension;
{$EndIf} {$EndIf}
ngMSSQL: // Allow unsupported ADODB providers per registry hack ngMSSQL: // Allow unsupported ADODB providers per registry hack
rx.Expression := IfThen(AppSettings.ReadBool(asAllProviders), '^', '^(MSOLEDBSQL|SQLOLEDB)'); rx.Expression := IfThen(AppSettings.ReadBool(asAllProviders), '^', '^(MSOLEDBSQL|SQLOLEDB)');
ngPgSQL: ngPgSQL:
{$IfDef LINUX} {$If defined(LINUX)}
rx.Expression := '^\s*(libpq)[^=]+=>\s*(\S+)$'; rx.Expression := '^\s*(libpq)[^=]+=>\s*(\S+)$';
{$EndIf} {$ElseIf defined(WINDOWS)}
{$IfDef WINDOWS}
rx.Expression := '^libpq.*\.' + GetDynLibExtension; rx.Expression := '^libpq.*\.' + GetDynLibExtension;
{$EndIf} {$EndIf}
ngSQLite: begin ngSQLite: begin
{$IfDef LINUX} {$If defined(LINUX)}
rx.Expression := '^\s*(libsqlite3)[^=]+=>\s*(\S+)$'; rx.Expression := '^\s*(libsqlite3)[^=]+=>\s*(\S+)$';
{$EndIf} {$ElseIf defined(WINDOWS)}
{$IfDef WINDOWS}
if NetType = ntSQLite then if NetType = ntSQLite then
rx.Expression := '^sqlite.*\.' + GetDynLibExtension rx.Expression := '^sqlite.*\.' + GetDynLibExtension
else else
@ -1902,7 +1899,7 @@ begin
end; end;
case NetTypeGroup of case NetTypeGroup of
ngMySQL, ngPgSQL, ngSQLite, ngInterbase: begin ngMySQL, ngPgSQL, ngSQLite, ngInterbase: begin
{$IfDef LINUX} {$If defined(LINUX)}
// See https://serverfault.com/a/513938 // See https://serverfault.com/a/513938
Process.RunCommand('/sbin/ldconfig', ['-p'], LibMapOutput); Process.RunCommand('/sbin/ldconfig', ['-p'], LibMapOutput);
LibMapLines := Explode(sLineBreak, LibMapOutput); LibMapLines := Explode(sLineBreak, LibMapOutput);
@ -1911,8 +1908,7 @@ begin
FoundLibs.Add(rx.Match[2]); FoundLibs.Add(rx.Match[2]);
end; end;
end; end;
{$EndIf} {$ElseIf defined(WINDOWS)}
{$IfDef WINDOWS}
Dlls := FindAllFiles(ExtractFilePath(ParamStr(0)), '*.' + GetDynLibExtension, False); Dlls := FindAllFiles(ExtractFilePath(ParamStr(0)), '*.' + GetDynLibExtension, False);
for DllPath in Dlls do begin for DllPath in Dlls do begin
DllFile := ExtractFileName(DllPath); DllFile := ExtractFileName(DllPath);