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 209f398dec7c08b7619c3cd310e9664215cfa2a1
Showing with 12 additions and 1 deletion.
  1. +12 −1 source/dbconnection.pas
View
@@ -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.