Skip to content

Commit

Permalink
Update libmysql.dll to libmariadb.dll from the current 10.2.12 GA rel…
Browse files Browse the repository at this point in the history
…ease. Leave support for libmysql, for users which don't yet have the new file in their Heidi directory. Should fix non working SSL connections, like described here: https://www.heidisql.com/forum.php?t=19494
  • Loading branch information
ansgarbecker committed Jan 6, 2018
1 parent 001c52f commit d385628
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 5 deletions.
5 changes: 3 additions & 2 deletions out/heidisql-appx.iss
Expand Up @@ -77,6 +77,7 @@ Name: "activate_statistics"; Description: "Automatically report client and serve
[InstallDelete]
Type: files; Name: "{app}\libmysql40.dll"
Type: files; Name: "{app}\libmysql41.dll"
Type: files; Name: "{app}\libmysql.dll"
Type: files; Name: "{app}\{#ProgExeName}.manifest"
Type: files; Name: "{app}\{#ProgNameLower}.url"
Type: files; Name: "{app}\{#ProgNameLower}_forum.url"
Expand All @@ -88,8 +89,8 @@ Source: "{#ProgNameLower}64.exe"; DestDir: "{app}"; DestName: "{#ProgExeName}";
Source: "{#ProgNameLower}32.exe"; DestDir: "{app}"; DestName: "{#ProgExeName}"; Check: not Is64BitInstallMode; Flags: ignoreversion
Source: "license.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "gpl.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "libmysql64.dll"; DestDir: "{app}"; DestName: "libmysql.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
Source: "libmysql32.dll"; DestDir: "{app}"; DestName: "libmysql.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
Source: "libmariadb64.dll"; DestDir: "{app}"; DestName: "libmariadb.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
Source: "libmariadb32.dll"; DestDir: "{app}"; DestName: "libmariadb.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
Source: "libpq64.dll"; DestDir: "{app}"; DestName: "libpq.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
Source: "libpq32.dll"; DestDir: "{app}"; DestName: "libpq.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
Source: "libintl-864.dll"; DestDir: "{app}"; DestName: "libintl-8.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
Expand Down
5 changes: 3 additions & 2 deletions out/heidisql.iss
Expand Up @@ -77,6 +77,7 @@ Name: "activate_statistics"; Description: "Automatically report client and serve
[InstallDelete]
Type: files; Name: "{app}\libmysql40.dll"
Type: files; Name: "{app}\libmysql41.dll"
Type: files; Name: "{app}\libmysql.dll"
Type: files; Name: "{app}\{#ProgExeName}.manifest"
Type: files; Name: "{app}\{#ProgNameLower}.url"
Type: files; Name: "{app}\{#ProgNameLower}_forum.url"
Expand All @@ -88,8 +89,8 @@ Source: "{#ProgNameLower}64.exe"; DestDir: "{app}"; DestName: "{#ProgExeName}";
Source: "{#ProgNameLower}32.exe"; DestDir: "{app}"; DestName: "{#ProgExeName}"; Check: not Is64BitInstallMode; Flags: ignoreversion
Source: "license.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "gpl.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "libmysql64.dll"; DestDir: "{app}"; DestName: "libmysql.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
Source: "libmysql32.dll"; DestDir: "{app}"; DestName: "libmysql.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
Source: "libmariadb64.dll"; DestDir: "{app}"; DestName: "libmariadb.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
Source: "libmariadb32.dll"; DestDir: "{app}"; DestName: "libmariadb.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
Source: "libpq64.dll"; DestDir: "{app}"; DestName: "libpq.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
Source: "libpq32.dll"; DestDir: "{app}"; DestName: "libpq.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
Source: "libintl-864.dll"; DestDir: "{app}"; DestName: "libintl-8.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
Expand Down
Binary file added out/libmariadb32.dll
Binary file not shown.
Binary file added out/libmariadb64.dll
Binary file not shown.
Binary file removed out/libmysql32.dll
Binary file not shown.
Binary file removed out/libmysql64.dll
Binary file not shown.
10 changes: 9 additions & 1 deletion source/dbconnection.pas
Expand Up @@ -704,7 +704,7 @@ function mysql_authentication_dialog_ask(
{$I const.inc}

var
LibMysqlPath: String = 'libmysql.dll';
LibMysqlPath: String;
LibMysqlHandle: HMODULE; // Shared module handle

mysql_affected_rows: function(Handle: PMYSQL): Int64; stdcall;
Expand Down Expand Up @@ -2085,9 +2085,17 @@ procedure TMySQLConnection.DoBeforeConnect;
msg: String;
begin
// Init libmysql before actually connecting.
// Try newer libmariadb version at first, and fall back to libmysql
if LibMysqlHandle = 0 then begin
LibMysqlPath := 'libmariadb.dll';
Log(lcDebug, f_('Loading library file %s ...', [LibMysqlPath]));
LibMysqlHandle := LoadLibrary(PWideChar(LibMysqlPath));
if LibMysqlHandle = 0 then begin
Log(lcDebug, f_('Could not load %s', [LibMysqlPath]));
LibMysqlPath := 'libmysql.dll';
Log(lcDebug, f_('Loading library file %s ...', [LibMysqlPath]));
LibMysqlHandle := LoadLibrary(PWideChar(LibMysqlPath));
end;
if LibMysqlHandle = 0 then begin
msg := f_('Cannot find a usable %s. Please launch %s from the directory where you have installed it.', [LibMysqlPath, ExtractFileName(ParamStr(0))]);
if Windows.GetLastError <> 0 then
Expand Down

0 comments on commit d385628

Please sign in to comment.