Skip to content

Commit

Permalink
Silence dumb exceptions from mysql_ping() call. See https://www.heidi…
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarbecker committed Mar 7, 2017
1 parent 654dace commit 209f398
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion source/dbconnection.pas
Expand Up @@ -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
Expand Down

0 comments on commit 209f398

Please sign in to comment.