Silence two crashes in QuotedDatabase and IsSameAs. See https://www.heidisql.com/forum.php?t=39040

This commit is contained in:
Ansgar Becker
2022-03-27 14:40:07 +02:00
parent 9a9b111c41
commit 3d90ce24d1
2 changed files with 24 additions and 12 deletions

View File

@@ -9895,13 +9895,19 @@ begin
if (not Assigned(CompareTo)) or (CompareTo = nil) then begin
Result := False;
end else begin
Result := FConnection.IdentifierEquals(Name, CompareTo.Name)
and (NodeType = CompareTo.NodeType)
and (Database = CompareTo.Database)
and (Schema = CompareTo.Schema)
and (Column = CompareTo.Column)
and (ArgTypes = CompareTo.ArgTypes)
and (Connection = CompareTo.Connection);
try
Result := FConnection.IdentifierEquals(Name, CompareTo.Name)
and (NodeType = CompareTo.NodeType)
and (Database = CompareTo.Database)
and (Schema = CompareTo.Schema)
and (Column = CompareTo.Column)
and (ArgTypes = CompareTo.ArgTypes)
and (Connection = CompareTo.Connection);
except
// No reproduction recipe yet, but numerous crashes from above were reported
on E:EAccessViolation do
Result := False;
end;
end;
end;

View File

@@ -10697,11 +10697,17 @@ begin
and (DataGridTable <> nil)
and Assigned(DataGridTable)
then begin
KeyName := DataGridTable.QuotedDatabase+'.'+DataGridTable.QuotedName;
FocusedCol := '';
if DataGrid.FocusedColumn > NoColumn then
FocusedCol := DataGrid.Header.Columns[DataGrid.FocusedColumn].Text;
DataGridFocusedCell.Values[KeyName] := IntToStr(DataGrid.FocusedNode.Index) + DELIM + FocusedCol;
try
KeyName := DataGridTable.QuotedDatabase+'.'+DataGridTable.QuotedName;
FocusedCol := '';
if DataGrid.FocusedColumn > NoColumn then
FocusedCol := DataGrid.Header.Columns[DataGrid.FocusedColumn].Text;
DataGridFocusedCell.Values[KeyName] := IntToStr(DataGrid.FocusedNode.Index) + DELIM + FocusedCol;
except
on E:EAccessViolation do begin
LogSQL('HandleDataGridAttributes: '+E.Message, lcError);
end;
end;
end;
DataGridFocusedNodeIndex := 0;
DataGridFocusedColumnName := '';