mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Silence conversion errors while reading query history from registry. See pm from Thomas Hauck.
This commit is contained in:
@ -11057,19 +11057,27 @@ begin
|
|||||||
// Prevent from running into serious errors when registry has some non-numeric value
|
// Prevent from running into serious errors when registry has some non-numeric value
|
||||||
if j<>-1 then begin
|
if j<>-1 then begin
|
||||||
Item := TQueryHistoryItem.Create;
|
Item := TQueryHistoryItem.Create;
|
||||||
Item.RegValue := j;
|
try
|
||||||
Raw := AppSettings.ReadString(ValueNames[i]);
|
Item.RegValue := j;
|
||||||
p := Pos(DELIM, Raw);
|
Raw := AppSettings.ReadString(ValueNames[i]);
|
||||||
Item.Time := StrToDateTime(Copy(Raw, 1, p-1));
|
p := Pos(DELIM, Raw);
|
||||||
System.Delete(Raw, 1, p);
|
Item.Time := StrToDateTime(Copy(Raw, 1, p-1));
|
||||||
p := Pos(DELIM, Raw);
|
System.Delete(Raw, 1, p);
|
||||||
Item.Database := Copy(Raw, 1, p-1);
|
p := Pos(DELIM, Raw);
|
||||||
System.Delete(Raw, 1, p);
|
Item.Database := Copy(Raw, 1, p-1);
|
||||||
p := Pos(DELIM, Raw);
|
System.Delete(Raw, 1, p);
|
||||||
Item.Duration := StrToIntDef(Copy(Raw, 1, p-1), 0);
|
p := Pos(DELIM, Raw);
|
||||||
FMaxDuration := Max(FMaxDuration, Item.Duration);
|
Item.Duration := StrToIntDef(Copy(Raw, 1, p-1), 0);
|
||||||
Item.SQL := Copy(Raw, p+1, Length(Raw));
|
FMaxDuration := Max(FMaxDuration, Item.Duration);
|
||||||
Add(Item);
|
Item.SQL := Copy(Raw, p+1, Length(Raw));
|
||||||
|
Add(Item);
|
||||||
|
except
|
||||||
|
on E:Exception do begin
|
||||||
|
MainForm.LogSQL(E.ClassName+': '+E.Message, lcError);
|
||||||
|
Item.Free;
|
||||||
|
Continue;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
// Sort by date
|
// Sort by date
|
||||||
|
Reference in New Issue
Block a user