Informix

 View Only
  • 1.  Informix 15 CSDK compatibility indicator

    Posted Mon December 16, 2024 09:34 AM

    Hello,

    Since Informix 15 CSDK introduced changes for example in the sqlca definition, I was wondering if there is some way to distinguish at compile time when an ESQL/C compiler V15 or V4.50 is used, so we can maintain the same .ec source code for different versions of ESQL/C.

    I expected that the ESQLINTVERSION changed (even if it's not really public, I assume)

    But in CSDK 15, I see it has not increased:

    /opt3/dbs/ifx/CSDK-15.0.0.0/incl/esql/sqliapi.h:#define ESQLINTVERSION        1

    In CSDK 4.50:

    /opt3/dbs/ifx/CSDK-4.50.FC10/incl/esql/sqliapi.h:#define ESQLINTVERSION        1

    Is there another way to get this info to do

    #if XXX >= 15
      ...

    #else
      ...
    #endif

    ?

    Seb



    ------------------------------
    Sebastien FLAESCH
    ------------------------------


  • 2.  RE: Informix 15 CSDK compatibility indicator

    Posted Mon December 16, 2024 09:52 AM
    Set an env variable in the Makefile and pass via -D to the compiler ?

    Cheers
    Paul

    Paul Watson
    Oninit LLC
    +1-913-387-7529
    www.oninit.com
    Oninit®️ is a registered trademark of Oninit LLC





  • 3.  RE: Informix 15 CSDK compatibility indicator

    Posted Mon December 16, 2024 10:29 AM
    Edited by Kat Jarvis Thu December 19, 2024 11:13 AM

    Hi Paul,

    Obviously we can define a preprocessor constant for ex with -DIFX_CSDK_VERSION=1500 

    But if something would exist in the standard Informix CSDK headers it will be more elegant.

    Seb



    ------------------------------
    Sebastien FLAESCH
    ------------------------------



  • 4.  RE: Informix 15 CSDK compatibility indicator

    Posted Thu December 19, 2024 02:06 AM

    Hello,

    Regarding ESQL/C client library compatibility, I found this page in the doc:

    https://www.ibm.com/docs/en/informix-servers/15.0.0?topic=versions-check-api-version-library

    Is this still accurate with new client lib names like libifgen15a.so ?

    When comparing sqlhdr.h files of a CSDK 15.0.0.0 vs CSDK 4.50.FC10, the versions have not changed:

    /*
     * provide macro definition for the library versions
     * being used while generating client's application executable.
     */
    #define CLIENT_GEN_VER          710     /* libgen.so used for compiling application */
    #define CLIENT_OS_VER           710     /* libos.so used for compiling application  */
    #define CLIENT_SQLI_VER         720     /* libsql.so used for compiling application */
    #define CLIENT_GLS_VER          710     /* libgls.so used for compiling application */
    

    I believe this needs some clarification...

    Seb



    ------------------------------
    Sebastien FLAESCH
    ------------------------------



  • 5.  RE: Informix 15 CSDK compatibility indicator

    Posted Sat December 28, 2024 06:11 AM
    Hello,
    Starting with V15, is there a rule defining the CSDK compatibility with the client library names?
    CSDK 15.0.0.0 breaks compatibility with CSDK 4.50, and uses new lib names like   libifgen15a.so
    This is OK, even if it forces us to deliver 2 distinct binaries to support both CSDK 4.50 and CSDK 15.0
    (We DO NOT want to statically link with CSDK libs)
    But what will happen with future versions?
    With the next V15 like 15.1.0.0, will the lib names change again to something like  libifgen15b.so?
    And for V16.0.0.0, will there be a  libifgen16a.so ?
    That would be quite some cost for us to deliver and test binaries for all these versions.
    My suggestion is to NOT CHANGE the lib names, as long as the next CSDK version is compatible to 15.0.0.0.
    BTW, instead of 15x, I would have used a specific version number for the lib such as 2, 3, 4 to indicate compatibility.
    libifgen_2.so
    Seb


    ------------------------------
    Sebastien FLAESCH
    ------------------------------



  • 6.  RE: Informix 15 CSDK compatibility indicator

    Posted Mon December 30, 2024 11:20 AM

    The change from 09a etc to 15a was made because the libraries are incompatible - the sqlca structure changed dramatically.  Only if a change of similar magnitude is necessary will the numbers change again.  Informix doesn't like having to change the numbers, but previously compiled ESQL/C programs would have broken without the change.

    Incidentally, there was a question about getting BIGSERIAL (and SERIAL8) values a few weeks ago.  The sqlhdr.h header ($INFORMIXDIR/incl/esql/sqlhdr.h) declares two functions:

    MI_EXT_DECL void ifx_getbigserial(bigint *bigintp);
    MI_EXT_DECL void ifx_getserial8(ifx_int8_t *int8p);

    Do NOT use SERIAL8 or INT8 - they occupy 10 bytes on disk and 12 in memory, unlike BIGSERIAL and BIGINT (which occupy 8 bytes both on disk and in memory).  The BIGSERIAL and BIGINT types can be manipulated with far fewer instructions per operation than SERIAL8 or INT8.



    ------------------------------
    Jonathan Leffler
    ------------------------------



  • 7.  RE: Informix 15 CSDK compatibility indicator

    Posted Thu January 02, 2025 10:49 AM

    Thanks for your answer, Jonathan!

    Seb



    ------------------------------
    Sebastien FLAESCH
    ------------------------------