Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
Expand all | Collapse all

ROWID 8 BYTES

  • 1.  ROWID 8 BYTES

    Posted Tue March 25, 2025 06:58 PM

    Hello everyone

    Recently, as you may know, version 15 of IDS was released. I was running some tests, and among the issues that arose was the use of the ROWID by clients, especially from C# and/or ODBC. It turns out that when I include the line in the SELECT statement, it doesn't seem to respond; otherwise, I remove the line and it works correctly. It's worth mentioning that the ROWID isn't the best practice, but several of my programs depend on it.
    Informix SDK 4.10. C16W
    IDS: 15.0.0.0WE with the parameter: TABLE_SIZE SMALL

    Thanks



    ------------------------------
    Eduardo Rodriguez
    ------------------------------


  • 2.  RE: ROWID 8 BYTES

    Posted Tue March 25, 2025 07:19 PM
    Eduardo:
     
    What do you mean by "when I include the line in the SELECT statement, it doesn't seem to respond"? 
     
    I assume you mean that something goes wrong when you include ROWID in the projection list of the SELECT statement, but, what does "doesn't seem to respond" mean? Does the query hang? Does it fail with an error? If so what error codes? 
    If you have TABLE_SIZE SMALL set in your ONCONFIG file, and you have set the server to LARGE mode, new tables by default will still have only 32bit rowids, not 64 bit rowids. SMALL tables should be compatible with either CSDK 4.10, CSDK 4.50 or CSDK 15.0. However, any LARGE tables will ONLY be usable with code compile with CSDK v15.0 or later (when there are later ones). You will not be able to query any LARGE tables from any code compiled with CSDK v4.10.
    Anyway, try to be more specific as you your problem. Perhaps post the table schema and the code you are trying to use to query it.
    Art


    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 3.  RE: ROWID 8 BYTES

    Posted Tue March 25, 2025 07:44 PM

    Hello Art Kagel

    I mean, when I include the ROWID from my query in C#, I run the debug, but the program stops responding and doesn't send any errors. I monitor my session ID and get the following:
        tid     name       rstcb      flags             curstk status
    11708 sqlexec 5755c4b8 Y--P--- 3856 cond wait netnorm -
    C# when filling the datatable it freezes: cmd.CommandText = String.Format(@" SELECT ben_benef,
    ben_pater,
    ben_porcen,
    ben_fecha,
    ben_entfed,
    ent_nombre,
    ben_municiO,
    mun_nombre,
    ben_coloni,
    ben_codpos,
    benefis.ROWID
    FROM benefis,entidades,municipios WHERE
    ben_socio = ? AND ben_entfed = ent_number AND mun_entfed = ben_entfed 
    AND ben_munici = mun_numero ORDER BY ben_fecha DESC"); 
    cmd.Parameters.Clear(); 
    cmd.Parameters.Add(new OdbcParameter("@partner", PartnerNum)); 
    dadap.SelectCommand = cmd; 
    dadap.Fill(Beneficiaries);



    ------------------------------
    Eduardo Rodriguez
    ------------------------------



  • 4.  RE: ROWID 8 BYTES

    Posted Tue March 25, 2025 07:53 PM

    Eduardo:

    And are the tables (benefis, entidades, & municipios) all SMALL tables or LARGE tables or a mixture? Especially the benefis table? What does the dbschema -ss output for that table look like?

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 5.  RE: ROWID 8 BYTES

    Posted Tue March 25, 2025 08:16 PM
    This is the table layout:
    { TABLE "root".benefis row size = 310 number of columns = 17 index size = 9 }
     
    create table "root".benefis 
      (
        ben_socio integer,
        ben_pater char(40),
        ben_mater char(40),
        ben_benef char(50),
        ben_sexo char(1),
        ben_domic char(50),
        ben_coloni char(50),
        ben_munici smallint,
        ben_entfed smallint,
        ben_codpos char(5),
        ben_fecnac date,
        ben_paren char(10),
        ben_telef char(12),
        ben_fecha date,
        ben_porcen smallfloat,
        ben_rfc char(14),
        ben_curp char(18)
      );
     
    revoke all on "root".benefis from "public" as "root";
    { TABLE "root".entidades row size = 24 number of columns = 3 index size = 0 }
     
    create table "root".entidades 
      (
        ent_numero smallint,
        ent_nombre char(20),
        ent_puntos smallint
      );
     
    revoke all on "root".entidades from "public" as "root";
    { TABLE "root".municipios row size = 52 number of columns = 4 index size = 7 }
     
    create table "root".municipios 
      (
        mun_entfed smallint,
        mun_numero smallint,
        mun_nombre char(40),
        mun_locali char(8)
      );
     
    revoke all on "root".municipios from "public" as "root";



    ------------------------------
    Eduardo Rodriguez
    ------------------------------



  • 6.  RE: ROWID 8 BYTES

    Posted Wed March 26, 2025 03:33 AM

    Hi
    "cond wait netnorm" normally indicates that the server is waiting for the client.

    A very small test with dbaccess:

    CREATE TABLE tab1 ( c1 integer, c2 char (20));
    insert into tab1 values (1, "fff");
    insert into tab1 values (2, "fff");

    CREATE small TABLE tab2 (c1 integer, c2 char (20));
    insert into tab2 values (1, "fff");
    insert into tab2 values (2, "fff");

    select *, hex(rowid) from tab1;
    select *, hex(rowid) from tab2;

    is working fine for tab2 with dbaccess 14.10.FC11
    The select for tab1 throws "-21569  This client cannot create or open tables that use large rowids." as expected. 





    ------------------------------
    Hedwig Fuchs
    ------------------------------



  • 7.  RE: ROWID 8 BYTES

    Posted Wed March 26, 2025 06:54 AM

    Eduardo:

    I agree with Hedwig, the problem is that the benefis table is likely a LARGE table and you have compiled the application with CSDK v4.10 which has no way to process a 64bit ROWID. Likely in the code it is not checking for errors (or maybe it only checks for specific errors, so it is hung in a FETCH that cannot return or something similar.

    I don't know for sure because the dbschema output you posted was not made with the "-ss" option so it does not show whether the tables are LARGE or SMALL, unless they were created LARGE by default.

    Bottom line, as already mentioned, you can only access LARGE tables with code that was compiled with the latest v15.00 CSDK.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 8.  RE: ROWID 8 BYTES

    Posted Wed March 26, 2025 09:17 AM

    I'm concerned the large/small table theory may be off, because removing rowid from the query wouldn't lead to correct results in that case.

    Eduardo, you can determine for certain which tables are large with the following SQL:

    select tabname from systables where sysmaster:bitval_bigint(flags, '0x4000') = 1;

    That will return the names of all tables in your current database that are large.

    select tabname from systables where sysmaster:bitval_bigint(flags, '0x4000') = 0;

    That will return the names of all tables in your current database that are small.

    I'm assuming all tables in your query are small, in which case no client should have trouble accessing them, selecting rowids from them, etc. If any tables in your query are large, it should return error -21569 whether you select rowid or not.

    As an experiment would it be possible to use only the latest V15 client libraries when compiling your test program, to see if that gives you different behavior? As I said, you should get sane behavior even when using older client libraries: the query should either work properly or if any tables are large it should return an error.

    If all else fails it might be helpful to use SQLIDEBUG, to see the client/server conversation in detail.



    ------------------------------
    John Lengyel
    ------------------------------



  • 9.  RE: ROWID 8 BYTES

    Posted Wed March 26, 2025 12:06 PM

    hello John Lengyel 

    I ran the instructions and got the following

    > select *, hex(rowid) from tab1;


             c1 c2                   (expression)

              1 fff                  0x0000000000000101
              2 fff                  0x0000000000000102

    2 row(s) retrieved.

    > select *, hex(rowid) from tab2;


             c1 c2                   (expression)

              1 fff                  0x0000000000000101
              2 fff                  0x0000000000000102

    2 row(s) retrieved.

    select tabname from systables where sysmaster:bitval_bigint(flags, '0x4000') = 1; does not return any results

    select tabname from systables where sysmaster:bitval_bigint(flags, '0x4000') = 0; returns my tables

    It is worth mentioning that I am working with programs compiled for 32-bit C++ and C#. I searched FixCentral but I cannot find the V15 client for 32-bit.



    ------------------------------
    Eduardo Rodriguez
    ------------------------------



  • 10.  RE: ROWID 8 BYTES

    Posted Wed March 26, 2025 12:13 PM

    Eduardo:

    As far as I know, 32bit clients are no longer supported! There is no 32bit Windows CSDK any longer. You will have to use the 64bit CSDK.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 11.  RE: ROWID 8 BYTES

    Posted Wed March 26, 2025 12:20 PM

    That said, as John pointed out, these are SMALL tables which should let you query them from any CSDK version, even Windows 32bit. Try John's debugging ideas.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 12.  RE: ROWID 8 BYTES

    Posted Wed March 26, 2025 01:26 PM

    It seems that the position of the ROWID in the query influences

    cmd.CommandText = String.Format(@" SELECT benefis.ROWID,ben_benef,
    ben_pater,
    ben_porcen,
    ben_fecha,
    ben_entfed,
    ent_nombre,
    ben_municiO,
    mun_nombre,
    ben_coloni,
    ben_codpos
    FROM benefis,entidades,municipios WHERE
    ben_socio = ? AND ben_entfed = ent_number AND mun_entfed = ben_entfed 
    AND ben_munici = mun_numero ORDER BY ben_fecha DESC"); 
    cmd.Parameters.Clear(); 
    cmd.Parameters.Add(new OdbcParameter("@partner", PartnerNum)); 
    dadap.SelectCommand = cmd; 
    dadap.Fill(Beneficiaries);

    works without problems,change the ROWID from the end to the beginning of the query



    ------------------------------
    Eduardo Rodriguez
    ------------------------------



  • 13.  RE: ROWID 8 BYTES

    Posted Thu March 27, 2025 02:21 AM

    Hello,

    I wonder about the motivation to get large tables by default in V15...

    onconfig

        TABLE_SIZE    SMALL

    should be the default, so that existing apps using 32bit rowids are not broken.

    I guess it's to late now to change the server defaults.

    Maybe this could be addressed with a question during the installation?

    Seb



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



  • 14.  RE: ROWID 8 BYTES

    Posted Thu March 27, 2025 06:21 AM

    Sebastian:

    If you upgrade an existing instance to v15.0 it starts in "compatibilty mode" which does not even support LARGE tables at all. Once you migrate the instance to the expanded mode you can certainly set TABLE_SIZE to SMALL yourself. Only when you install a new instance does v15.0 start in its expanded mode with LARGE table support. Personally I think that is a good compromise.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 15.  RE: ROWID 8 BYTES

    Posted Thu March 27, 2025 08:25 AM

    Makes sense, Art.

    Seb



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



  • 16.  RE: ROWID 8 BYTES

    Posted Thu March 27, 2025 09:25 AM

    That was a good experiment, Eduardo. Thank you for that update. As far as I can tell this is unexpected behavior, regardless of your client. Please open a support case and provide the information we'll need to reproduce this issue on our end.

    Thanks.

    -jc



    ------------------------------
    John Lengyel
    ------------------------------



  • 17.  RE: ROWID 8 BYTES

    Posted Fri March 28, 2025 05:19 AM

    Hi
    I run a quick test with a 4.10.UC15 ESQL/C client.
    And the select is working fine.
    So maybe an issue with ODBC or  ... or ....

    I mean more investigation is needed in a support case 



    ------------------------------
    Hedwig Fuchs
    ------------------------------