mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-16 11:42:12 +08:00
Issue #1169: prefer OpenOrExecute over Open, in TInterbaseConnection.Query, and destroy unused FdQuery object. Fixes exception with "[FireDAC][Phys]-308" with non-result queries.
This commit is contained in:
@ -3698,17 +3698,19 @@ begin
|
|||||||
try
|
try
|
||||||
FdQuery.ResourceOptions.CmdExecTimeout := Parameters.QueryTimeout;
|
FdQuery.ResourceOptions.CmdExecTimeout := Parameters.QueryTimeout;
|
||||||
if DoStoreResult then begin
|
if DoStoreResult then begin
|
||||||
FdQuery.Open(SQL);
|
FdQuery.SQL.Text := SQL;
|
||||||
FRowsFound := FdQuery.RecordCount;
|
if FdQuery.OpenOrExecute then begin
|
||||||
|
FRowsFound := FdQuery.RecordCount;
|
||||||
|
SetLength(FLastRawResults, Length(FLastRawResults)+1);
|
||||||
|
FLastRawResults[Length(FLastRawResults)-1] := FdQuery;
|
||||||
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
FdQuery.ExecSQL(SQL);
|
FdQuery.ExecSQL(SQL);
|
||||||
FRowsFound := 0;
|
FRowsAffected := FdQuery.RowsAffected;
|
||||||
|
FdQuery.Free;
|
||||||
end;
|
end;
|
||||||
FRowsAffected := FdQuery.RowsAffected;
|
|
||||||
FLastQueryDuration := GetTickCount - TimerStart;
|
FLastQueryDuration := GetTickCount - TimerStart;
|
||||||
FLastQueryNetworkDuration := 0;
|
FLastQueryNetworkDuration := 0;
|
||||||
SetLength(FLastRawResults, Length(FLastRawResults)+1);
|
|
||||||
FLastRawResults[Length(FLastRawResults)-1] := FdQuery;
|
|
||||||
except
|
except
|
||||||
on E:EFDDBEngineException do begin
|
on E:EFDDBEngineException do begin
|
||||||
SetLength(FLastRawResults, 0);
|
SetLength(FLastRawResults, 0);
|
||||||
@ -7969,7 +7971,7 @@ begin
|
|||||||
TypeIndex := dbdtBinary;
|
TypeIndex := dbdtBinary;
|
||||||
ftVarBytes:
|
ftVarBytes:
|
||||||
TypeIndex := dbdtVarbinary;
|
TypeIndex := dbdtVarbinary;
|
||||||
ftFloat:
|
ftFloat, ftSingle:
|
||||||
TypeIndex := dbdtFloat;
|
TypeIndex := dbdtFloat;
|
||||||
ftDate:
|
ftDate:
|
||||||
TypeIndex := dbdtDate;
|
TypeIndex := dbdtDate;
|
||||||
|
Reference in New Issue
Block a user