Skip to content
Permalink
Browse files
Silence dumb exceptions from mysql_ping() call. See https://www.heidi…
  • Loading branch information
ansgarbecker committed Mar 7, 2017
1 parent 654dace commit 209f398
Showing 1 changed file with 12 additions and 1 deletion.
@@ -2253,9 +2253,20 @@ procedure TAdoDBConnection.DoAfterConnect;


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

0 comments on commit 209f398

Please sign in to comment.