Informix 15 CSDK compatibility indicator
Posted in 2024
Sebastien Flaesch asked for a compile-time way to tell ESQL/C CSDK 15 from 4.50, since ESQLINTVERSION and sqlhdr.h versions were unchanged. Paul Watson suggested passing a -D define from the Makefile. Sebastien asked if the new library names (libifgen15a) would keep changing. Jonathan Leffler said the names changed because the sqlca structure changed, and will change again only for a similarly incompatible change.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
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 ------------------------------
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
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 ------------------------------ 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
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 ------------------------------
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 libifgen 15a .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 libifgen 15b .so ? And for V16.0.0.0, will there be a libifgen 16a .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 ------------------------------
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 ------------------------------
Thanks for your answer, Jonathan! Seb ------------------------------ Sebastien FLAESCH ------------------------------