Hello,
I have a simple remote dbaccess application with mormot (http) and saving data in TBuffdataset.
I use function to execute SQL statement and return data into Bufdataset.
First time it execute fine but if I try to reexecute more times it generate the following infos:
007FA22B 8b34d6 mov (%esi,%edx,8),%esi
007FA22E 85f6 test %esi,%esi
007FA230 7409 je 0x7fa23b <BUFDATASET$_$TDOUBLELINKEDBUFINDEX_$__$$_COMPAREBOOKMARKS$PBUFBOOKMARK$PBUFBOOKMARK$$LONGINT+75>
007FA232 39f7 cmp %esi,%edi
007FA234 7405 je 0x7fa23b <BUFDATASET$_$TDOUBLELINKEDBUFINDEX_$__$$_COMPAREBOOKMARKS$PBUFBOOKMARK$PBUFBOOKMARK$$LONGINT+75>
007FA236 3b7334 cmp 0x34(%ebx),%esi
007FA239 75ed jne 0x7fa228 <BUFDATASET$_$TDOUBLELINKEDBUFINDEX_$__$$_COMPAREBOOKMARKS$PBUFBOOKMARK$PBUFBOOKMARK$$LONGINT+56>
007FA23B 39fe cmp %edi,%esi
007FA23D 7405 je 0x7fa244 <BUFDATASET$_$TDOUBLELINKEDBUFINDEX_$__$$_COMPAREBOOKMARKS$PBUFBOOKMARK$PBUFBOOKMARK$$LONGINT+84>
007FA23F f7d8 neg %eax
007FA241 8d7600 lea 0x0(%esi),%esi
007FA244 5f pop %edi
007FA245 5e pop %esi
007FA246 5b pop %ebx
007FA247 c3 ret
007FA248 0000 add %al,(%eax)
007FA24A 0000 add %al,(%eax)
007FA24C 0000 add %al,(%eax)
007FA24E 000085d2740d85c974098b02 add %al,(%eax)
BUFDATASET$_$TDOUBLELINKEDBUFINDEX_$__$$_SAMEBOOKMARKS$PBUFBOOKMARK$PBUFBOOKMARK$$BOOLEAN
007FA250 85d2 test %edx,%edx
If I execute outside the IDE then the application desapear.
I suspect a bug in the component: TBufDataset.
this is a function I use.
function fQueryOpen_fpc(var oQuery: TQuery; var oDs: TBufDataset;
iRecNumber: Integer; bGoLast: Boolean): Boolean;
var
Stmt: ISQLDBRows;
begin
Result := False;
Screen.Cursor := crHourGlass;
oDs.DisableControls;
try
if iRecNumber = -1 then
fQueryAddLimitSQL(oQuery, 150)
else if iRecNumber > 0 then
fQueryAddLimitSQL(oQuery, iRecNumber);
Stmt := gfP.Execute( oQuery.SQL.Text, [] );
if oDs.FieldCount = 0 then
begin
if ToClientDataSet( oDs, Stmt.Instance, 0, cdsNew, False ) then
begin
//oDs.Open;
Result := true;
end;
end else
begin
//with oDs do
//begin
// oDs.Clear;
// if Active then
// Close;
// oDs.ClearIndexes;
// oDs.FieldDefs.Clear;
//end;
if ToClientDataSet( oDs, Stmt.Instance, 0, cdsReplace, False ) then
begin
//oDs.Open;
Result := true;
end;
end;
finally
Screen.Cursor := crDefault;
oDs.EnableControls;
end;
end;
PS: It happens MOSTELY when I do navigate in Grid.
Help guys,
Help.