IBM Support

IT26894: ROUND() SCALAR FUNCTION MAY RETURN INCORRECT RESULT WITH FLOATING POINT NUMBER ON COLUMN-ORGANIZED TABLE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The precision handling of round() scalar function is not
    correctly processed on column-organized table and the result of
    round() scalar function with floating point expresion may be
    different from one on row-organized table around the rounding
    boundary.
    
      The following is a sample senario of round() scalar function
    on column-organized table.
    
    $ db2set -all
    [i] DB2_WORKLOAD=ANALYTICS
    [i] DB2_USE_ALTERNATE_PAGE_CLEANING=ON [DB2_WORKLOAD]
    [i] DB2_ANTIJOIN=EXTEND [DB2_WORKLOAD]
    
    $ db2 "create table TABROW ( COL_FLOAT float, COL_DECFLOAT
    decfloat ) organize by row"
    $ db2 "insert into  TABROW values ( 0.02875, 0.02875 )"
    $ db2 "create table TABCOL ( COL_FLOAT float, COL_DECFLOAT
    decfloat ) organize by column"
    $ db2 "insert into  TABCOL values ( 0.02875, 0.02875 )"
    
    $ db2 "select COL_FLOAT, round( COL_FLOAT, 4 ) ROUND4_COL_FLOAT
    from TABROW"
    
    COL_FLOAT                ROUND4_COL_FLOAT
    ------------------------ ------------------------
      +2.87500000000000E-002   +2.87000000000000E-002
    
      1 record(s) selected.
    
    $ db2 "select COL_FLOAT, round( COL_FLOAT, 4 ) ROUND4_COL_FLOAT
    from TABCOL"
    
    COL_FLOAT                ROUND4_COL_FLOAT
    ------------------------ ------------------------
      +2.87500000000000E-002   +2.88000000000000E-002
    
      1 record(s) selected.
    

Local fix

  • Use more precise numeric-expression2 in ROUND scalar function,
    then estimate your requiring precision like as below.
    
    $ db2 "select COL_FLOAT, round( COL_FLOAT, 3 ) ROUND3_COL_FLOAT,
    round( COL_FLOAT, 4 ) ROUND4_COL_FLOAT, round( COL_FLOAT, 5 )
    ROUND5_COL_FLOAT from TABROW"
    
    COL_FLOAT                ROUND3_COL_FLOAT
    ROUND4_COL_FLOAT         ROUND5_COL_FLOAT
    ------------------------ ------------------------
    ------------------------ ------------------------
      +2.87500000000000E-002   +2.90000000000000E-002
    +2.87000000000000E-002   +2.87500000000000E-002
    
      1 record(s) selected.
    
    $ db2 "select COL_FLOAT, round( COL_FLOAT, 3 )
    ROUND3_COL_FLOATT, round( COL_FLOAT, 4 ) ROUND4_COL_FLOAT,
    round( COL_FLOAT, 5 ) ROUND5_COL_FLOAT from TABCOL"
    
    COL_FLOAT                ROUND3_COL_FLOATT
    ROUND4_COL_FLOAT         ROUND5_COL_FLOAT
    ------------------------ ------------------------
    ------------------------ ------------------------
      +2.87500000000000E-002   +2.90000000000000E-002
    +2.88000000000000E-002   +2.87500000000000E-002
    
      1 record(s) selected.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 11.1 Mod 4 Fixpack 5 or higher                *
    ****************************************************************
    

Problem conclusion

  • First fixed in Db2 11.1 Mod 4 Fixpack 5
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT26894

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-11-08

  • Closed date

    2020-01-16

  • Last modified date

    2020-01-16

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • RB10 PSN

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
04 May 2022