mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 20:29:18 +02:00
* Fix issue ID #38358
git-svn-id: trunk@48409 -
(cherry picked from commit 6bdd7dc3b9
)
This commit is contained in:
parent
4620cd07a3
commit
c2edb12ac1
@ -92,7 +92,8 @@ type
|
|||||||
procedure GetFloat(CurrBuff, Buffer : pointer; Size : Byte);
|
procedure GetFloat(CurrBuff, Buffer : pointer; Size : Byte);
|
||||||
procedure SetFloat(CurrBuff: pointer; Dbl: Double; Size: integer);
|
procedure SetFloat(CurrBuff: pointer; Dbl: Double; Size: integer);
|
||||||
|
|
||||||
procedure CheckError(ProcName : string; Status : PISC_STATUS);
|
procedure CheckError(ProcName : string; Status : PISC_STATUS;IgnoreErrors : Array of Longint); overload;
|
||||||
|
procedure CheckError(ProcName : string; Status : PISC_STATUS); overload;
|
||||||
procedure SetParameters(cursor : TSQLCursor; aTransation : TSQLTransaction; AParams : TParams);
|
procedure SetParameters(cursor : TSQLCursor; aTransation : TSQLTransaction; AParams : TParams);
|
||||||
procedure FreeSQLDABuffer(var aSQLDA : PXSQLDA);
|
procedure FreeSQLDABuffer(var aSQLDA : PXSQLDA);
|
||||||
function IsDialectStored: boolean;
|
function IsDialectStored: boolean;
|
||||||
@ -170,6 +171,12 @@ const
|
|||||||
INVALID_DATA = -1;
|
INVALID_DATA = -1;
|
||||||
|
|
||||||
procedure TIBConnection.CheckError(ProcName : string; Status : PISC_STATUS);
|
procedure TIBConnection.CheckError(ProcName : string; Status : PISC_STATUS);
|
||||||
|
|
||||||
|
begin
|
||||||
|
CheckError(ProcName,Status,[]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIBConnection.CheckError(ProcName : string; Status : PISC_STATUS; IgnoreErrors : Array of Longint);
|
||||||
var
|
var
|
||||||
i,ErrorCode : longint;
|
i,ErrorCode : longint;
|
||||||
Msg, SQLState : string;
|
Msg, SQLState : string;
|
||||||
@ -181,6 +188,10 @@ begin
|
|||||||
if ((Status[0] = 1) and (Status[1] <> 0)) then
|
if ((Status[0] = 1) and (Status[1] <> 0)) then
|
||||||
begin
|
begin
|
||||||
ErrorCode := Status[1];
|
ErrorCode := Status[1];
|
||||||
|
if Length(IgnoreErrors)>0 then
|
||||||
|
for I in IgnoreErrors do
|
||||||
|
if I=ErrorCode then
|
||||||
|
Exit;
|
||||||
{$IFDEF LinkDynamically}
|
{$IFDEF LinkDynamically}
|
||||||
if assigned(fb_sqlstate) then // >= Firebird 2.5
|
if assigned(fb_sqlstate) then // >= Firebird 2.5
|
||||||
begin
|
begin
|
||||||
@ -967,7 +978,8 @@ begin
|
|||||||
if FSelectable and (CursorName<>'') then
|
if FSelectable and (CursorName<>'') then
|
||||||
begin
|
begin
|
||||||
if isc_dsql_free_statement(@Status, @StatementHandle, DSQL_close)<>0 then
|
if isc_dsql_free_statement(@Status, @StatementHandle, DSQL_close)<>0 then
|
||||||
CheckError('Close Cursor', Status); // Ignore this, it can already be closed.
|
// If transaction was closed (keepOpenOnCommit, then the cursor is already closed.
|
||||||
|
CheckError('Close Cursor', Status, [335544577]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user