Skip to content

Commit 00625b8

Browse files
committed
Issue HeidiSQL#1169: prefer OpenOrExecute over Open, in TInterbaseConnection.Query, and destroy unused FdQuery object. Fixes exception with "[FireDAC][Phys]-308" with non-result queries.
1 parent b6d221b commit 00625b8

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

source/dbconnection.pas

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3698,17 +3698,19 @@ procedure TInterbaseConnection.Query(SQL: String; DoStoreResult: Boolean=False;
36983698
try
36993699
FdQuery.ResourceOptions.CmdExecTimeout := Parameters.QueryTimeout;
37003700
if DoStoreResult then begin
3701-
FdQuery.Open(SQL);
3702-
FRowsFound := FdQuery.RecordCount;
3701+
FdQuery.SQL.Text := SQL;
3702+
if FdQuery.OpenOrExecute then begin
3703+
FRowsFound := FdQuery.RecordCount;
3704+
SetLength(FLastRawResults, Length(FLastRawResults)+1);
3705+
FLastRawResults[Length(FLastRawResults)-1] := FdQuery;
3706+
end;
37033707
end else begin
37043708
FdQuery.ExecSQL(SQL);
3705-
FRowsFound := 0;
3709+
FRowsAffected := FdQuery.RowsAffected;
3710+
FdQuery.Free;
37063711
end;
3707-
FRowsAffected := FdQuery.RowsAffected;
37083712
FLastQueryDuration := GetTickCount - TimerStart;
37093713
FLastQueryNetworkDuration := 0;
3710-
SetLength(FLastRawResults, Length(FLastRawResults)+1);
3711-
FLastRawResults[Length(FLastRawResults)-1] := FdQuery;
37123714
except
37133715
on E:EFDDBEngineException do begin
37143716
SetLength(FLastRawResults, 0);
@@ -7969,7 +7971,7 @@ procedure TInterbaseQuery.Execute(AddResult: Boolean; UseRawResult: Integer);
79697971
TypeIndex := dbdtBinary;
79707972
ftVarBytes:
79717973
TypeIndex := dbdtVarbinary;
7972-
ftFloat:
7974+
ftFloat, ftSingle:
79737975
TypeIndex := dbdtFloat;
79747976
ftDate:
79757977
TypeIndex := dbdtDate;

0 commit comments

Comments
 (0)