ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/runtime/nongui/IBDatabaseInfo.pas
(Generate patch)

Comparing ibx/trunk/runtime/nongui/IBDatabaseInfo.pas (file contents):
Revision 344 by tony, Fri Apr 17 10:26:08 2020 UTC vs.
Revision 345 by tony, Mon Aug 23 14:22:29 2021 UTC

# Line 47 | Line 47 | type
47      function GetDateDBCreated: TDateTime;
48      function GetEncrypted: boolean;
49      function GetEncryptionKeyName: string;
50 <    function GetPagesFree: Long;
51 <    function GetPagesUsed: Long;
52 <    function GetTransactionCount: Long;
50 >    function GetPagesFree: int64;
51 >    function GetPagesUsed: int64;
52 >    function GetTransactionCount: int64;
53    protected
54      FDatabase: TIBDatabase;
55      FUserNames   : TStringList;
# Line 62 | Line 62 | type
62      FReadSeqCount: TStringList;
63      FUpdateCount: TStringList;
64      procedure CheckDatabase;
65 <    function GetAllocation: Long;
66 <    function GetBaseLevel: Long;
65 >    function GetAllocation: int64;
66 >    function GetBaseLevel: byte;
67      function GetDBFileName: String;
68      function GetDBSiteName: String;
69 <    function GetDBImplementationNo: Long;
70 <    function GetDBImplementationClass: Long;
71 <    function GetNoReserve: Long;
72 <    function GetODSMinorVersion: Long;
73 <    function GetODSMajorVersion: Long;
74 <    function GetPageSize: Long;
69 >    function GetDBImplementationNo: byte;
70 >    function GetDBImplementationClass: byte;
71 >    function GetNoReserve: int64;
72 >    function GetODSMinorVersion: integer;
73 >    function GetODSMajorVersion: integer;
74 >    function GetPageSize: int64;
75      function GetVersion: String;
76 <    function GetCurrentMemory: Long;
77 <    function GetForcedWrites: Long;
78 <    function GetMaxMemory: Long;
79 <    function GetNumBuffers: Long;
80 <    function GetSweepInterval: Long;
76 >    function GetCurrentMemory: Int64;
77 >    function GetForcedWrites: Int64;
78 >    function GetMaxMemory: Int64;
79 >    function GetNumBuffers: Int64;
80 >    function GetSweepInterval: Int64;
81      function GetUserNames: TStringList;
82 <    function GetFetches: Long;
83 <    function GetMarks: Long;
84 <    function GetReads: Long;
85 <    function GetWrites: Long;
82 >    function GetFetches: Int64;
83 >    function GetMarks: Int64;
84 >    function GetReads: Int64;
85 >    function GetWrites: Int64;
86      function GetBackoutCount: TStringList;
87      function GetDeleteCount: TStringList;
88      function GetExpungeCount: TStringList;
# Line 92 | Line 92 | type
92      function GetReadSeqCount: TStringList;
93      function GetUpdateCount: TStringList;
94      function GetOperationCounts(DBInfoCommand: Integer; var FOperation: TStringList): TStringList;
95 <    function GetReadOnly: Long;
95 >    function GetReadOnly: Int64;
96      function GetStringDatabaseInfo(DatabaseInfoCommand: Integer): String;
97 <    function GetDBSQLDialect: Long;
97 >    function GetDBSQLDialect: Int64;
98    public
99      constructor Create(AOwner: TComponent); override;
100      destructor Destroy; override;
101 <    function GetLongDatabaseInfo(DatabaseInfoCommand: Integer): Long;
101 >    function GetLongDatabaseInfo(DatabaseInfoCommand: Integer): long;  deprecated 'Use GetIntDatabaseInfo instead';
102 >    function GetIntDatabaseInfo(DatabaseInfoCommand: Integer): Int64;
103      function GetDatabasePage(PageNo: integer): string;
104 <    property Allocation: Long read GetAllocation;
105 <    property BaseLevel: Long read GetBaseLevel;
104 >    property Allocation: Int64 read GetAllocation;
105 >    property BaseLevel: byte read GetBaseLevel;
106      property DateDBCreated: TDateTime read GetDateDBCreated;
107      property DBFileName: String read GetDBFileName;
108      property DBSiteName: String read GetDBSiteName;
109 <    property DBImplementationNo: Long read GetDBImplementationNo;
110 <    property DBImplementationClass: Long read GetDBImplementationClass;
109 >    property DBImplementationNo: byte read GetDBImplementationNo;
110 >    property DBImplementationClass: byte read GetDBImplementationClass;
111      property Encrypted: boolean read GetEncrypted;
112      property EncryptionKeyName: string read GetEncryptionKeyName;
113 <    property NoReserve: Long read GetNoReserve;
114 <    property ODSMinorVersion: Long read GetODSMinorVersion;
115 <    property ODSMajorVersion: Long read GetODSMajorVersion;
116 <    property PageSize: Long read GetPageSize;
113 >    property NoReserve: Int64 read GetNoReserve;
114 >    property ODSMinorVersion: integer read GetODSMinorVersion;
115 >    property ODSMajorVersion: integer read GetODSMajorVersion;
116 >    property PageSize: Int64 read GetPageSize;
117      property Version: String read GetVersion;
118 <    property CurrentMemory: Long read GetCurrentMemory;
119 <    property ForcedWrites: Long read GetForcedWrites;
120 <    property MaxMemory: Long read GetMaxMemory;
121 <    property NumBuffers: Long read GetNumBuffers;
122 <    property SweepInterval: Long read GetSweepInterval;
118 >    property CurrentMemory: Int64 read GetCurrentMemory;
119 >    property ForcedWrites: Int64 read GetForcedWrites;
120 >    property MaxMemory: Int64 read GetMaxMemory;
121 >    property NumBuffers: Int64 read GetNumBuffers;
122 >    property SweepInterval: Int64 read GetSweepInterval;
123      property UserNames: TStringList read GetUserNames;
124 <    property Fetches: Long read GetFetches;
125 <    property Marks: Long read GetMarks;
126 <    property Reads: Long read GetReads;
127 <    property Writes: Long read GetWrites;
128 <    property TransactionCount: Long read GetTransactionCount;
124 >    property Fetches: Int64 read GetFetches;
125 >    property Marks: Int64 read GetMarks;
126 >    property Reads: Int64 read GetReads;
127 >    property Writes: Int64 read GetWrites;
128 >    property TransactionCount: Int64 read GetTransactionCount;
129      property BackoutCount: TStringList read GetBackoutCount;
130      property DeleteCount: TStringList read GetDeleteCount;
131      property ExpungeCount: TStringList read GetExpungeCount;
# Line 133 | Line 134 | type
134      property ReadIdxCount: TStringList read GetReadIdxCount;
135      property ReadSeqCount: TStringList read GetReadSeqCount;
136      property UpdateCount: TStringList read GetUpdateCount;
137 <    property DBSQLDialect : Long read GetDBSQLDialect;
138 <    property PagesUsed: Long read GetPagesUsed;
139 <    property PagesFree: Long read GetPagesFree;
140 <    property ReadOnly: Long read GetReadOnly;
137 >    property DBSQLDialect : Int64 read GetDBSQLDialect;
138 >    property PagesUsed: Int64 read GetPagesUsed;
139 >    property PagesFree: Int64 read GetPagesFree;
140 >    property ReadOnly: Int64 read GetReadOnly;
141    published
142      property Database: TIBDatabase read FDatabase write FDatabase;
143    end;
# Line 187 | Line 188 | begin
188   end;
189  
190   function TIBDatabaseInfo.GetEncrypted: boolean;
191 < var ConnFlags: Long;
191 > var ConnFlags: Int64;
192   begin
193    Result := ODSMajorVersion >= 12;
194    if Result then
195    try
196 <    ConnFlags := GetLongDatabaseInfo(fb_info_conn_flags);
196 >    ConnFlags := GetIntDatabaseInfo(fb_info_conn_flags);
197      Result := (ConnFlags and fb_info_crypt_encrypted) <> 0;
198    except
199      Result := false; {Introduced in Firebird 3.0.3}
# Line 210 | Line 211 | begin
211       IBError(ibxeUnexpectedDatabaseInfoResp,[nil]);
212   end;
213  
214 < function TIBDatabaseInfo.GetPagesFree: Long;
214 > function TIBDatabaseInfo.GetPagesFree: int64;
215   begin
216 <  result := GetLongDatabaseInfo(fb_info_pages_used);
216 >  result := GetIntDatabaseInfo(fb_info_pages_used);
217   end;
218  
219 < function TIBDatabaseInfo.GetPagesUsed: Long;
219 > function TIBDatabaseInfo.GetPagesUsed: int64;
220   begin
221 <  result := GetLongDatabaseInfo(fb_info_pages_free);
221 >  result := GetIntDatabaseInfo(fb_info_pages_free);
222   end;
223  
224 < function TIBDatabaseInfo.GetTransactionCount: Long;
224 > function TIBDatabaseInfo.GetTransactionCount: int64;
225   begin
226 <  result := GetLongDatabaseInfo(isc_info_active_tran_count);
226 >  result := GetIntDatabaseInfo(isc_info_active_tran_count);
227   end;
228  
229   procedure TIBDatabaseInfo.CheckDatabase;
# Line 233 | Line 234 | begin
234      IBError(ibxeDatabaseClosed,[]);
235   end;
236  
237 < function TIBDatabaseInfo.GetAllocation: Long;
237 > function TIBDatabaseInfo.GetAllocation: int64;
238   begin
239 <  result := GetLongDatabaseInfo(isc_info_allocation);
239 >  result := GetIntDatabaseInfo(isc_info_allocation);
240   end;
241  
242 < function TIBDatabaseInfo.GetBaseLevel: Long;
242 > function TIBDatabaseInfo.GetBaseLevel: byte;
243   var Response: TByteArray;
244   begin
245    CheckDatabase;
# Line 278 | Line 279 | begin
279         IBError(ibxeUnexpectedDatabaseInfoResp,[nil]);
280   end;
281  
282 < function TIBDatabaseInfo.GetDBImplementationNo: Long;
282 > function TIBDatabaseInfo.GetDBImplementationNo: byte;
283   var Response: TByteArray;
284   begin
285    CheckDatabase;
# Line 292 | Line 293 | begin
293       IBError(ibxeUnexpectedDatabaseInfoResp,[nil]);
294   end;
295  
296 < function TIBDatabaseInfo.GetDBImplementationClass: Long;
296 > function TIBDatabaseInfo.GetDBImplementationClass: byte;
297   var Response: TByteArray;
298   begin
299    CheckDatabase;
# Line 306 | Line 307 | begin
307       IBError(ibxeUnexpectedDatabaseInfoResp,[nil]);
308   end;
309  
310 < function TIBDatabaseInfo.GetNoReserve: Long;
310 > function TIBDatabaseInfo.GetNoReserve: int64;
311   begin
312 <  result := GetLongDatabaseInfo(isc_info_no_reserve);
312 >  result := GetIntDatabaseInfo(isc_info_no_reserve);
313   end;
314  
315 < function TIBDatabaseInfo.GetODSMinorVersion: Long;
315 > function TIBDatabaseInfo.GetODSMinorVersion: integer;
316   begin
317    CheckDatabase;
318    Result := Database.Attachment.GetODSMinorVersion;
319   end;
320  
321 < function TIBDatabaseInfo.GetODSMajorVersion: Long;
321 > function TIBDatabaseInfo.GetODSMajorVersion: integer;
322   begin
323    CheckDatabase;
324    Result := Database.Attachment.GetODSMajorVersion;
325   end;
326  
327 < function TIBDatabaseInfo.GetPageSize: Long;
327 > function TIBDatabaseInfo.GetPageSize: int64;
328   begin
329 <  result := GetLongDatabaseInfo(isc_info_page_size);
329 >  result := GetIntDatabaseInfo(isc_info_page_size);
330   end;
331  
332   function TIBDatabaseInfo.GetVersion: String;
# Line 339 | Line 340 | begin
340       IBError(ibxeUnexpectedDatabaseInfoResp,[nil]);
341   end;
342  
343 < function TIBDatabaseInfo.GetCurrentMemory: Long;
343 > function TIBDatabaseInfo.GetCurrentMemory: Int64;
344   begin
345 <  result := GetLongDatabaseInfo(isc_info_current_memory);
345 >  result := GetIntDatabaseInfo(isc_info_current_memory);
346   end;
347  
348 < function TIBDatabaseInfo.GetForcedWrites: Long;
348 > function TIBDatabaseInfo.GetForcedWrites: Int64;
349   begin
350 <  result := GetLongDatabaseInfo(isc_info_forced_writes);
350 >  result := GetIntDatabaseInfo(isc_info_forced_writes);
351   end;
352  
353 < function TIBDatabaseInfo.GetMaxMemory: Long;
353 > function TIBDatabaseInfo.GetMaxMemory: Int64;
354   begin
355 <  result := GetLongDatabaseInfo(isc_info_max_memory);
355 >  result := GetIntDatabaseInfo(isc_info_max_memory);
356   end;
357  
358 < function TIBDatabaseInfo.GetNumBuffers: Long;
358 > function TIBDatabaseInfo.GetNumBuffers: Int64;
359   begin
360 <  result := GetLongDatabaseInfo(isc_info_num_buffers);
360 >  result := GetIntDatabaseInfo(isc_info_num_buffers);
361   end;
362  
363 < function TIBDatabaseInfo.GetSweepInterval: Long;
363 > function TIBDatabaseInfo.GetSweepInterval: Int64;
364   begin
365 <  result := GetLongDatabaseInfo(isc_info_sweep_interval);
365 >  result := GetIntDatabaseInfo(isc_info_sweep_interval);
366   end;
367  
368   function TIBDatabaseInfo.GetUserNames: TStringList;
# Line 376 | Line 377 | begin
377       IBError(ibxeUnexpectedDatabaseInfoResp,[nil]);
378   end;
379  
380 < function TIBDatabaseInfo.GetFetches: Long;
380 > function TIBDatabaseInfo.GetFetches: Int64;
381   begin
382 <  result := GetLongDatabaseInfo(isc_info_fetches);
382 >  result := GetIntDatabaseInfo(isc_info_fetches);
383   end;
384  
385 < function TIBDatabaseInfo.GetMarks: Long;
385 > function TIBDatabaseInfo.GetMarks: Int64;
386   begin
387 <  result := GetLongDatabaseInfo(isc_info_marks);
387 >  result := GetIntDatabaseInfo(isc_info_marks);
388   end;
389  
390 < function TIBDatabaseInfo.GetReads: Long;
390 > function TIBDatabaseInfo.GetReads: Int64;
391   begin
392 <  result := GetLongDatabaseInfo(isc_info_reads);
392 >  result := GetIntDatabaseInfo(isc_info_reads);
393   end;
394  
395 < function TIBDatabaseInfo.GetWrites: Long;
395 > function TIBDatabaseInfo.GetWrites: Int64;
396   begin
397 <  result := GetLongDatabaseInfo(isc_info_writes);
397 >  result := GetIntDatabaseInfo(isc_info_writes);
398   end;
399  
400   function TIBDatabaseInfo.GetOperationCounts(DBInfoCommand: Integer;
# Line 453 | Line 454 | begin
454    result := GetOperationCounts(isc_info_update_count,FUpdateCount);
455   end;
456  
457 < function TIBDatabaseInfo.GetReadOnly: Long;
457 > function TIBDatabaseInfo.GetReadOnly: Int64;
458   begin
459 <  result := GetLongDatabaseInfo(isc_info_db_read_only);
459 >  result := GetIntDatabaseInfo(isc_info_db_read_only);
460   end;
461  
462 < function TIBDatabaseInfo.GetLongDatabaseInfo(DatabaseInfoCommand: Integer): Long;
462 > function TIBDatabaseInfo.GetLongDatabaseInfo(DatabaseInfoCommand: Integer
463 >  ): long;
464 > begin
465 >  Result := GetIntDatabaseInfo(DatabaseInfoCommand);
466 > end;
467 >
468 > function TIBDatabaseInfo.GetIntDatabaseInfo(DatabaseInfoCommand: Integer
469 >  ): Int64;
470   begin
471    CheckDatabase;
472    with Database.Attachment.GetDBInformation([DatabaseInfoCommand]) do
# Line 491 | Line 499 | begin
499   end;
500  
501  
502 < function TIBDatabaseInfo.GetDBSQLDialect: Long;
502 > function TIBDatabaseInfo.GetDBSQLDialect: Int64;
503   begin
504    CheckDatabase;
505    with Database.Attachment.GetDBInformation([isc_info_db_SQL_Dialect]) do

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines