View Issue Details

IDProjectCategoryView StatusLast Update
0022304LazarusLCLpublic2013-09-24 18:46
ReporterLuiz AmericoAssigned ToJesus Reyes 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version1.2.0Fixed in Version1.2.0 
Summary0022304: DBGrid crash with filtered dataset after scroll
DescriptionTo get the crash.

Run the attached example
Click filter
Try to scroll down using the thumb -> sigsegv

The attached patch fixes, but i'm not sure if this is the best fix
TagsNo tags attached.
Fixed in Revision39124
LazTarget1.2
Widgetset
Attached Files
  • dbgridfiltered.diff (465 bytes)
    Index: lcl/dbgrids.pas
    ===================================================================
    --- lcl/dbgrids.pas	(revision 37738)
    +++ lcl/dbgrids.pas	(working copy)
    @@ -1205,7 +1205,7 @@
               ' Position=', dbgs(Message.Pos),' OldPos=',Dbgs(FOldPosition));
       {$endif}
     
    -  IsSeq := FDatalink.DataSet.IsSequenced;
    +  IsSeq := FDatalink.DataSet.IsSequenced and not FDataLink.DataSet.Filtered;
       case Message.ScrollCode of
         SB_TOP:
           DsGoto(True);
    
    dbgridfiltered.diff (465 bytes)
  • DBGridFiltered.zip (2,331 bytes)

Relationships

related to 0025052 closedJesus Reyes TSQLQuery.Filter produces issues with TDBGrid 

Activities

2012-06-23 13:39

 

dbgridfiltered.diff (465 bytes)
Index: lcl/dbgrids.pas
===================================================================
--- lcl/dbgrids.pas	(revision 37738)
+++ lcl/dbgrids.pas	(working copy)
@@ -1205,7 +1205,7 @@
           ' Position=', dbgs(Message.Pos),' OldPos=',Dbgs(FOldPosition));
   {$endif}
 
-  IsSeq := FDatalink.DataSet.IsSequenced;
+  IsSeq := FDatalink.DataSet.IsSequenced and not FDataLink.DataSet.Filtered;
   case Message.ScrollCode of
     SB_TOP:
       DsGoto(True);
dbgridfiltered.diff (465 bytes)

Luiz Americo

2012-06-23 13:39

developer   ~0060658

Using Lazarus 1.1 r37738 FPC 2.6.0 i386-win32-win32/win64

2012-06-23 13:40

 

DBGridFiltered.zip (2,331 bytes)

Jesus Reyes

2012-06-26 22:50

developer   ~0060683

I think your patch is ok, however dbgrid is not very well tested with non-sequenced datasets, further patches are welcomed :)

Jesus Reyes

2012-10-18 05:11

developer   ~0063258

I commited the workaround. I don't know however if all kinds of dataset are affected by this problem, or if this is the problem in just some of them. Now they all will be treated as non-sequenced.

Issue History

Date Modified Username Field Change
2012-06-23 13:39 Luiz Americo New Issue
2012-06-23 13:39 Luiz Americo File Added: dbgridfiltered.diff
2012-06-23 13:39 Luiz Americo LazTarget => -
2012-06-23 13:39 Luiz Americo Note Added: 0060658
2012-06-23 13:40 Luiz Americo File Added: DBGridFiltered.zip
2012-06-25 19:50 Jesus Reyes Status new => assigned
2012-06-25 19:50 Jesus Reyes Assigned To => Jesus Reyes
2012-06-26 22:50 Jesus Reyes Note Added: 0060683
2012-10-18 05:11 Jesus Reyes Fixed in Revision => 39124
2012-10-18 05:11 Jesus Reyes LazTarget - => 1.2
2012-10-18 05:11 Jesus Reyes Status assigned => resolved
2012-10-18 05:11 Jesus Reyes Fixed in Version => 1.2.0
2012-10-18 05:11 Jesus Reyes Resolution open => fixed
2012-10-18 05:11 Jesus Reyes Note Added: 0063258
2012-10-18 05:11 Jesus Reyes Target Version => 1.2.0
2012-11-08 02:57 Luiz Americo Status resolved => closed
2013-09-24 18:46 Jesus Reyes Relationship added related to 0025052