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
|
||||
if j<>-1 then begin
|
||||
Item := TQueryHistoryItem.Create;
|
||||
Item.RegValue := j;
|
||||
Raw := AppSettings.ReadString(ValueNames[i]);
|
||||
p := Pos(DELIM, Raw);
|
||||
Item.Time := StrToDateTime(Copy(Raw, 1, p-1));
|
||||
System.Delete(Raw, 1, p);
|
||||
p := Pos(DELIM, Raw);
|
||||
Item.Database := Copy(Raw, 1, p-1);
|
||||
System.Delete(Raw, 1, p);
|
||||
p := Pos(DELIM, Raw);
|
||||
Item.Duration := StrToIntDef(Copy(Raw, 1, p-1), 0);
|
||||
FMaxDuration := Max(FMaxDuration, Item.Duration);
|
||||
Item.SQL := Copy(Raw, p+1, Length(Raw));
|
||||
Add(Item);
|
||||
try
|
||||
Item.RegValue := j;
|
||||
Raw := AppSettings.ReadString(ValueNames[i]);
|
||||
p := Pos(DELIM, Raw);
|
||||
Item.Time := StrToDateTime(Copy(Raw, 1, p-1));
|
||||
System.Delete(Raw, 1, p);
|
||||
p := Pos(DELIM, Raw);
|
||||
Item.Database := Copy(Raw, 1, p-1);
|
||||
System.Delete(Raw, 1, p);
|
||||
p := Pos(DELIM, Raw);
|
||||
Item.Duration := StrToIntDef(Copy(Raw, 1, p-1), 0);
|
||||
FMaxDuration := Max(FMaxDuration, Item.Duration);
|
||||
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;
|
||||
// Sort by date
|
||||
|
Reference in New Issue
Block a user