ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/journaling/fbintf/client/FBStatement.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/FBStatement.pas (file contents):
Revision 56 by tony, Mon Mar 6 10:20:02 2017 UTC vs.
Revision 263 by tony, Thu Dec 6 15:55:01 2018 UTC

# Line 45 | Line 45 | uses
45    FBTransaction;
46  
47   type
48 <  TPerfStatistics = array[psCurrentMemory..psFetches] of comp;
48 >  TPerfStatistics = array[psCurrentMemory..psFetches] of Int64;
49  
50    { TFBStatement }
51  
52    TFBStatement = class(TActivityReporter)
53    private
54      FAttachmentIntf: IAttachment;
55 +    FFirebirdClientAPI: TFBClientAPI;
56    protected
57      FTransactionIntf: ITransaction;
58      FExecTransactionIntf: ITransaction;
# Line 78 | Line 79 | type
79      procedure InternalPrepare;  virtual; abstract;
80      function InternalExecute(aTransaction: ITransaction): IResults;  virtual; abstract;
81      function InternalOpenCursor(aTransaction: ITransaction): IResultSet;   virtual; abstract;
82 +    procedure ProcessSQL(sql: AnsiString; GenerateParamNames: boolean; var processedSQL: AnsiString); virtual; abstract;
83      procedure FreeHandle;  virtual; abstract;
84      procedure InternalClose(Force: boolean); virtual; abstract;
85 +    function TimeStampToMSecs(const TimeStamp: TTimeStamp): Int64;
86    public
87      constructor Create(Attachment: IAttachment; Transaction: ITransaction;
88        sql: AnsiString; SQLDialect: integer);
# Line 89 | Line 92 | type
92      procedure Close;
93      procedure TransactionEnding(aTransaction: ITransaction; Force: boolean);
94      property SQLDialect: integer read FSQLDialect;
95 +    property FirebirdClientAPI: TFBClientAPI read FFirebirdClientAPI;
96  
97    public
98      function GetSQLParams: ISQLParams; virtual; abstract;
# Line 97 | Line 101 | type
101        DeleteCount: integer): boolean;
102      function GetSQLStatementType: TIBSQLStatementTypes;
103      function GetSQLText: AnsiString;
104 +    function GetProcessedSQLText: AnsiString;
105      function GetSQLDialect: integer;
106  
107      {GetDSQLInfo only supports isc_info_sql_stmt_type, isc_info_sql_get_plan, isc_info_sql_records}
# Line 135 | Line 140 | begin
140      IBError(ibxeNotInTransaction,[]);
141   end;
142  
143 + function TFBStatement.TimeStampToMSecs(const TimeStamp: TTimeStamp): Int64;
144 + begin
145 +  Result := TimeStamp.Time + Int64(timestamp.date)*msecsperday;
146 + end;
147 +
148   constructor TFBStatement.Create(Attachment: IAttachment;
149    Transaction: ITransaction; sql: AnsiString; SQLDialect: integer);
150   begin
151    inherited Create(Transaction as TFBTransaction,2);
152    FAttachmentIntf := Attachment;
153    FTransactionIntf := Transaction;
154 +  FFirebirdClientAPI := Attachment.getFirebirdAPI as TFBClientAPI;
155    FSQLDialect := SQLDialect;
156    FSQL := sql;
157   end;
# Line 222 | Line 233 | begin
233    Result := FSQL;
234   end;
235  
236 + function TFBStatement.GetProcessedSQLText: AnsiString;
237 + begin
238 +  if FProcessedSQL = '' then
239 +    ProcessSQL(FSQL,FGenerateParamNames,FProcessedSQL);
240 +  Result := FProcessedSQL
241 + end;
242 +
243   function TFBStatement.GetSQLDialect: integer;
244   begin
245    Result := FSQLDialect;
# Line 300 | Line 318 | end;
318  
319   function TFBStatement.GetDSQLInfo(Request: byte): ISQLInfoResults;
320   begin
321 <  Result := TSQLInfoResultsBuffer.Create;
321 >  Result := TSQLInfoResultsBuffer.Create(FFirebirdClientAPI);
322    GetDsqlInfo(Request,Result);
323   end;
324  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines