Page 1 of 1

Bugfix for TZAbstractRODataset.GetActiveBuffer

Posted: 31.05.2018, 12:44
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

Re: Bugfix for TZAbstractRODataset.GetActiveBuffer

Posted: 31.05.2018, 17:01
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