View Issue Details

IDProjectCategoryView StatusLast Update
0028688LazarusLCLpublic2015-09-28 19:12
ReporterLuiz AmericoAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version1.4.4Fixed in Version1.5 (SVN) 
Summary0028688: Fix crash when inserting a record attached to a TDBGrid with multiselect
DescriptionReported previously at http://forum.lazarus.freepascal.org/index.php?topic=29660.0;topicseen

It affects both Sqlite3Dataset and Sqldb (TSqlQuery)

Attached is a patch that fixes it by checking for nil in TBookmarkList.Find
TagsNo tags attached.
Fixed in Revision49856
LazTarget1.4.4
Widgetset
Attached Files
  • fixdbgrid.diff (264 bytes)
    diff --git lcl/dbgrids.pas lcl/dbgrids.pas
    index d28e210..8e99d93 100644
    --- lcl/dbgrids.pas
    +++ lcl/dbgrids.pas
    @@ -4520,6 +4520,8 @@ begin
       {$endif}
     
       Result := False;
    +  if Item = nil then
    +    Exit;
       if FCanDoBinarySearch then
         BinarySearch
       else
    
    fixdbgrid.diff (264 bytes)

Activities

Luiz Americo

2015-09-17 15:19

developer  

fixdbgrid.diff (264 bytes)
diff --git lcl/dbgrids.pas lcl/dbgrids.pas
index d28e210..8e99d93 100644
--- lcl/dbgrids.pas
+++ lcl/dbgrids.pas
@@ -4520,6 +4520,8 @@ begin
   {$endif}
 
   Result := False;
+  if Item = nil then
+    Exit;
   if FCanDoBinarySearch then
     BinarySearch
   else
fixdbgrid.diff (264 bytes)

Jesus Reyes

2015-09-21 05:35

developer   ~0086013

Aplpied thanks.

Jesus Reyes

2015-09-23 06:14

developer   ~0086042

In the linked topic it seems the fix has caused unwished secondary effects. Please test.

Luiz Americo

2015-09-28 19:12

developer   ~0086131

It uncovered another bug that is already fixed in sqlite3dataset.

Issue History

Date Modified Username Field Change
2015-09-17 15:19 Luiz Americo New Issue
2015-09-17 15:19 Luiz Americo File Added: fixdbgrid.diff
2015-09-18 05:14 Jesus Reyes Assigned To => Jesus Reyes
2015-09-18 05:14 Jesus Reyes Status new => assigned
2015-09-21 05:35 Jesus Reyes Fixed in Revision => 49856
2015-09-21 05:35 Jesus Reyes LazTarget - => 1.4.4
2015-09-21 05:35 Jesus Reyes Note Added: 0086013
2015-09-21 05:35 Jesus Reyes Status assigned => resolved
2015-09-21 05:35 Jesus Reyes Fixed in Version => 1.5 (SVN)
2015-09-21 05:35 Jesus Reyes Resolution open => fixed
2015-09-21 05:35 Jesus Reyes Target Version => 1.4.4
2015-09-23 06:14 Jesus Reyes Note Added: 0086042
2015-09-23 06:14 Jesus Reyes Status resolved => feedback
2015-09-28 19:12 Luiz Americo Note Added: 0086131
2015-09-28 19:12 Luiz Americo Status feedback => assigned
2015-09-28 19:12 Luiz Americo Status assigned => closed