mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 18:12:05 +08:00
Silence dumb exceptions from mysql_ping() call. See https://www.heidisql.com/forum.php?t=23483
This commit is contained in:
@ -2253,9 +2253,20 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
function TMySQLConnection.Ping(Reconnect: Boolean): Boolean;
|
function TMySQLConnection.Ping(Reconnect: Boolean): Boolean;
|
||||||
|
var
|
||||||
|
IsDead: Boolean;
|
||||||
begin
|
begin
|
||||||
Log(lcDebug, 'Ping server ...');
|
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
|
// Be sure to release some stuff before reconnecting
|
||||||
Active := False;
|
Active := False;
|
||||||
if Reconnect then
|
if Reconnect then
|
||||||
|
Reference in New Issue
Block a user