Bugfix for TZAbstractRODataset.GetActiveBuffer

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
wkrenn
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 31.05.2018, 12:36

Bugfix for TZAbstractRODataset.GetActiveBuffer

Post by wkrenn »

Hi,

In https://svn.code.sf.net/p/zeoslib/code- ... ataset.pas (rev. 4080) there is a bug that prevents filtering of e.g. rxdbgrid on computed columns. For my attemted fix, see below. I dunno if this has been fixed in trunk. BTW: I totally did not understand the magic casting of RowBuffer for GetCalcFields. Seems smelly....

Code: Select all

function TZAbstractRODataset.GetActiveBuffer(var RowBuffer: PZRowBuffer):
  Boolean;
//...
          if (ResultSet.GetRow = RowNo) or ResultSet.MoveAbsolute(RowNo) then
          begin
            if (State = dsOldValue) and (ResultSet.
              QueryInterface(IZCachedResultSet, CachedResultSet) = 0) then
              CachedResultSet.MoveToInitialRow;
            FetchFromResultSet(ResultSet, FieldsLookupTable, Fields, RowAccessor);
            RowBuffer.Index := RowNo;
            // >>>>>>> attempted fix
            {$IFDEF WITH_TRECORDBUFFER}
              GetCalcFields({$IFDEF WITH_GETCALCFIELDS_TRECBUF}NativeInt{$ELSE}TRecordBuffer{$ENDIF}(RowBuffer));
            {$ELSE}
              GetCalcFields(PChar(RowBuffer));
            {$ENDIF}
            // <<<<<<<<<<<<<<<< attemted fix
            ResultSet.MoveToCurrentRow;
          end
//...
Thanks,
Willibald
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Bugfix for TZAbstractRODataset.GetActiveBuffer

Post by marsupilami »

Hello Willibald,

for further reference I created a ticket on the Bugtracker. See here: https://sourceforge.net/p/zeoslib/tickets/253/
Best regards,

Jan
Post Reply