mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Bugfix: regression - accidentally masked exceptions from Reconnect().
This commit is contained in:
@@ -5814,6 +5814,8 @@ end;
|
||||
|
||||
// Searchbox unfocused
|
||||
procedure TMainForm.CheckConnection;
|
||||
var
|
||||
connected: Boolean;
|
||||
begin
|
||||
if not FMysqlConn.IsAlive then begin
|
||||
LogSQL('Connection failure detected. Trying to reconnect.', true);
|
||||
@@ -5823,16 +5825,18 @@ begin
|
||||
TimerHostUptimeTimer(self);
|
||||
FQueryRunning := false;
|
||||
try
|
||||
connected := True;
|
||||
try
|
||||
// CheckConnected() doesn't really check anything, it
|
||||
// just sees if the driver has disposed of it's connection
|
||||
// by means of a Disconnect() or not. In which case there
|
||||
// is no point in doing a Reconnect(), it will NOP.
|
||||
FMysqlConn.Connection.CheckConnected;
|
||||
FMysqlConn.Connection.Reconnect;
|
||||
except
|
||||
FMysqlConn.Connection.Connect;
|
||||
connected := False;
|
||||
end;
|
||||
if connected then FMysqlConn.Connection.Reconnect
|
||||
else FMysqlConn.Connection.Connect;
|
||||
time_connected := 0;
|
||||
TimerConnected.Enabled := true;
|
||||
LogSQL('Connected. Thread-ID: ' + IntToStr( MySQLConn.Connection.GetThreadId ));
|
||||
|
||||
Reference in New Issue
Block a user