Silence dumb exceptions from mysql_ping() call. See https://www.heidisql.com/forum.php?t=23483

This commit is contained in:
Ansgar Becker
2017-03-07 20:19:36 +00:00
parent 654dace688
commit 209f398dec

View File

@ -2253,9 +2253,20 @@ end;
function TMySQLConnection.Ping(Reconnect: Boolean): Boolean;
var
IsDead: Boolean;
begin
Log(lcDebug, 'Ping server ...');
if (FHandle=nil) or (mysql_ping(FHandle) <> 0) then begin
IsDead := True;
try
IsDead := (FHandle=nil) or (mysql_ping(FHandle) <> 0);
except
// silence dumb exceptions from mysql_ping
on E:Exception do
Log(lcError, E.Message);
end;
if IsDead then begin
// Be sure to release some stuff before reconnecting
Active := False;
if Reconnect then