Hi!

We previously decided that we does not need to maintain API
compatibility within mistakes done in alpha/beta versions.

So interfaces does not need to be versioned between unstable releases.
Well, you may not need to maintain API compatibility, but there does need to be a clear and systematic way of signalling which version of an interface you are working with.

The IUtil interface is a case in point.

For Firebird 3 it's version 13.

For Firebird 4 beta 1 it's version 21 and the following got appended to the interface

    IUtilImpl_vTable.getDecFloat16 := @IUtilImpl_getDecFloat16Dispatcher;
    IUtilImpl_vTable.getDecFloat34 := @IUtilImpl_getDecFloat34Dispatcher;
    IUtilImpl_vTable.getTransactionByHandle := @IUtilImpl_getTransactionByHandleDispatcher;     IUtilImpl_vTable.getStatementByHandle := @IUtilImpl_getStatementByHandleDispatcher;
    IUtilImpl_vTable.decodeTimeTz := @IUtilImpl_decodeTimeTzDispatcher;
    IUtilImpl_vTable.decodeTimeStampTz := @IUtilImpl_decodeTimeStampTzDispatcher;
    IUtilImpl_vTable.encodeTimeTz := @IUtilImpl_encodeTimeTzDispatcher;
    IUtilImpl_vTable.encodeTimeStampTz := @IUtilImpl_encodeTimeStampTzDispatcher;

For Firebird 4 beta 2, it's version 24 and the interface gets more appended to it i.e.

       function getInt128(status: IStatus): IInt128;
        procedure decodeTimeTzEx(status: IStatus; timeTz: ISC_TIME_TZ_EXPtr; hours: CardinalPtr; minutes: CardinalPtr; seconds: CardinalPtr; fractions: CardinalPtr; timeZoneBufferLength: Cardinal; timeZoneBuffer: PAnsiChar);         procedure decodeTimeStampTzEx(status: IStatus; timeStampTz: ISC_TIMESTAMP_TZ_EXPtr; year: CardinalPtr; month: CardinalPtr; day: CardinalPtr; hours: CardinalPtr; minutes: CardinalPtr; seconds: CardinalPtr; fractions: CardinalPtr; timeZoneBufferLength: Cardinal; timeZoneBuffer: PAnsiChar);

For Firebird 4 RC1, the version number gets reset to 4 and the Firebird 4 extensions change such that

    IUtilImpl_vTable.getTransactionByHandle := @IUtilImpl_getTransactionByHandleDispatcher;     IUtilImpl_vTable.getStatementByHandle := @IUtilImpl_getStatementByHandleDispatcher;

are removed. I fell into the usual trap this morning of testing out IBX with an updated Firebird.pas and forgetting to replace the Firebird beta 1 client library. Result a call to what should have been decodeTimeTz came back with a "Transaction Handle error"! This took a little while to work out.

The result is that you cannot treat the version number as anything other than an identifier with version 13 and version 4 being currently the only valid values - and a consequential need to update the list of valid values everytime a new version of the Firebird API comes out, rather than being able to rely on a monotonically increasing sequence for backwards compatibility.

Perhaps what is really needed is a separate version no and "stable" flag for each interface.

On 17/02/2021 15:33, Adriano dos Santos Fernandes wrote:
So it does not make sense to me to have more than one "version:" between
official releases.

We currently have in Util:

version:    // 3.0 => 4.0 Alpha1
version:    // 4.0 Beta1 => 4.0 Beta2

Should we use only one version here for v4?


Adriano



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to