diff options
Diffstat (limited to 'avx512-0037785/packages/fcl-db')
3 files changed, 23 insertions, 5 deletions
diff --git a/avx512-0037785/packages/fcl-db/src/sqldb/interbase/ibconnection.pp b/avx512-0037785/packages/fcl-db/src/sqldb/interbase/ibconnection.pp index 35fa20d25a..d145066788 100644 --- a/avx512-0037785/packages/fcl-db/src/sqldb/interbase/ibconnection.pp +++ b/avx512-0037785/packages/fcl-db/src/sqldb/interbase/ibconnection.pp @@ -92,7 +92,8 @@ type procedure GetFloat(CurrBuff, Buffer : pointer; Size : Byte); 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 FreeSQLDABuffer(var aSQLDA : PXSQLDA); function IsDialectStored: boolean; @@ -170,6 +171,12 @@ const INVALID_DATA = -1; 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 i,ErrorCode : longint; Msg, SQLState : string; @@ -181,6 +188,10 @@ begin if ((Status[0] = 1) and (Status[1] <> 0)) then begin ErrorCode := Status[1]; + if Length(IgnoreErrors)>0 then + for I in IgnoreErrors do + if I=ErrorCode then + Exit; {$IFDEF LinkDynamically} if assigned(fb_sqlstate) then // >= Firebird 2.5 begin @@ -967,7 +978,8 @@ begin if FSelectable and (CursorName<>'') then begin 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; diff --git a/avx512-0037785/packages/fcl-db/src/sqldb/mysql/mysqlconn.inc b/avx512-0037785/packages/fcl-db/src/sqldb/mysql/mysqlconn.inc index fe5858050b..3aff95a893 100644 --- a/avx512-0037785/packages/fcl-db/src/sqldb/mysql/mysqlconn.inc +++ b/avx512-0037785/packages/fcl-db/src/sqldb/mysql/mysqlconn.inc @@ -1058,7 +1058,7 @@ begin Result := 0 else Result := EncodeDate(EY, EM, ED); - Result := ComposeDateTime(Result, EncodeTime(EH, EN, ES, EMS)); + Result := ComposeDateTime(Result, EncodeTimeInterval(EH, EN, ES, EMS)); end; function TConnectionName.InternalStrToTime(C: pchar; Len: integer): TDateTime; diff --git a/avx512-0037785/packages/fcl-db/src/sqldb/sqldb.pp b/avx512-0037785/packages/fcl-db/src/sqldb/sqldb.pp index 88aca65cae..3118e0f545 100644 --- a/avx512-0037785/packages/fcl-db/src/sqldb/sqldb.pp +++ b/avx512-0037785/packages/fcl-db/src/sqldb/sqldb.pp @@ -802,6 +802,7 @@ type Property Proxy : TSQLConnection Read FProxy; Published Property ConnectorType : String Read FConnectorType Write SetConnectorType; + Property Port; end; TSQLConnectionClass = Class of TSQLConnection; @@ -1197,8 +1198,12 @@ end; procedure TCustomSQLStatement.DeAllocateCursor; begin - if Assigned(FCursor) and Assigned(Database) then - DataBase.DeAllocateCursorHandle(FCursor); + if Assigned(FCursor) then + begin + if Assigned(Database) then + DataBase.DeAllocateCursorHandle(FCursor); + FreeAndNil(FCursor); + end; end; function TCustomSQLStatement.ExpandMacros( OrigSQL : String ) : String; @@ -1515,6 +1520,7 @@ begin end; finally; DeAllocateCursorHandle(Cursor); + FreeAndNil(Cursor); end; end; |