IBM Support

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

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

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":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 January 2020