I have a question/remark for tonyw.
<snip>
If compatibility is a problem the TIBDatabaseInfo.GetVersion could still be for isc_info_version but there could be a TIBDatabaseInfo.GetFirebirdVersion. But who uses the GetVersion for Interbase nowadays in IBX for Lazarus which is meant for actual Firebird(?). GetVersion isn't actually giving back the correct version for Firebird now (which could be confusing for Firebird/Lazarus users).
From the docs:
isc_info_version - interbase server version identification string
isc_info_firebird_version - firebird server version identification string
const
isc_info_isc_version = 12;
isc_info_firebird_version = 103;
isc_info_version = isc_info_isc_version;
(which is already defined in inf_pub.inc but never used)
If you run the example dbinfo program you will see the following output (using Linux mint 20.3 and Firebird 3)
Authentication Method = Srp
Remote Protocol = TCPv4
Attachment SQLDialect = 3
Firebird/Linux/AMD/Intel/x64 (access method), version "LI-V3.0.5.33220 Firebird 3.0"
Firebird/Linux/AMD/Intel/x64 (remote server), version "LI-V3.0.5.33220 Firebird 3.0/tcp (zeus)/P15:CZ"
Firebird/Linux/AMD/Intel/x64 (remote interface), version "LI-V3.0.5.33220 Firebird 3.0/tcp (zeus)/P15:CZ"
on disk structure version 12.0
Firebird Library Pathname = /lib/x86_64-linux-gnu/libfbclient.so.2
DB SQLDialect = 3
Allocation = 307
Base Level = 4
DB File Name = /usr/share/doc/firebird3.0-common/examples/employee.fdb
DB Site Name = zeus
DB Implementation No = 7
Database Created: 9-1-20 13:13:45
DB Implementation Class = 0
Space is Reserved
ODS Minor Version = 0
ODS Major Version = 12
Page Size = 8192
Version = LI-V6.3.5.33220 Firebird 3.0
Current Memory = 19236544
Forced Writes Enabled
Max Memory = 19376272
Number of Buffers = 2048
Sweep Interval = 20000
User Names: SYSDBA
Fetches = 674
Marks = 8
Reads = 66
Writes = 2
Pages Free = 300
Pages Used = 7
Transaction Count = 1
The legacy version property is as you say. However note that the firebird version strings are returned as the top of the output. This is done by a call to the underlying Firebird IAttachment Interface as implemented as part of the Firebird Pascal API.
The underlying code for GetVersion is
function TIBDatabaseInfo.GetVersion: String;
var Version: byte;
begin
CheckDatabase;
with Database.Attachment.GetDBInformation([isc_info_version]) do
if (Count > 0) and (Items[0].GetItemType = isc_info_version) then
Items[0].DecodeVersionString(Version,Result)
else
IBError(ibxeUnexpectedDatabaseInfoResp,[nil]);
end;
It's easy enough to modify to use isc_info_firebird_version. Maybe I will provide a FirebirdVersion property for the next release.