[fpc-devel] Patch to remove useless bookmark store in TDataset.DoInsertAppend

Luiz Américo pascalive at bol.com.br
Sat Jul 23 23:14:36 CEST 2005


As already commented in the code, the bookmarking done inside 
TDataset.DoInsertAppend is useless, not to say buggy.
It makes 2 records to have the same bookmark data but this is not 
noticed because the bookmarkdata is set to the correct value after 
Post->Resync.

In TDBF, if the bookmark is get just after a insert call this bookmark 
will point to the previous record (see the attached example).

The patch remove this code and also refactory a if statement.

Unfortunately, after applying the patch if a bookmark is get after 
insert this bookmark points to the first record. This occurs because 
TDBF inits a buffer with BookMarkData=0 and BookMarkFlag=bfCurrent 
instead of bfInserted (this makes bookmarkavailable returns true)

As far as i can understand it seems that is not allowed to get a 
bookmark in a not posted record, is it?

BTW is necessary/correct the SetBookMarkFlag call (inside DoInsert) in 
this procedure ?

Luiz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dataset.zip
Type: application/zip
Size: 720 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20050723/64f187f1/attachment.zip>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: simpledbf.pas
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20050723/64f187f1/attachment.ksh>


More information about the fpc-devel mailing list