Menu

#253 Bugfix for TZAbstractRODataset.GetActiveBuffer

7.2.4
closed
None
2018-06-06
2018-05-31
No

A copy from the Zeos Forums (http://zeoslib.sourceforge.net/viewtopic.php?f=40&t=76424):

Hi,

In https://svn.code.sf.net/p/zeoslib/code-0/trunk/src/component/ZAbstractRODataset.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....

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

Discussion

  • marsupilami79

    marsupilami79 - 2018-05-31

    I will put my plans on a new Zeos 7.2 realease on hold until I know more about this.

     
  • EgonHugeist

    EgonHugeist - 2018-06-06
    • status: open --> closed
    • assigned_to: EgonHugeist
     
  • EgonHugeist

    EgonHugeist - 2018-06-06

    applied! thanks

     

Log in to post a comment.