IBM Support

LI74152: A DECIMAL DIVISION RETURNS AN INCORRECT RESULT IF THE RESULTING PRECISION IS 32 AND MIN_DEC_DIV_3=YES

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • If you have set the min_dec_div_3 database configuration
    parameter to YES, a decimal division with a resulting precision
    of 32 and a scale of 3 returns incorrect results. The error
    message SQL0802N is not returned, this message should be
    returned when the resulting precision is higher than 31.
    
    The following examples show the results of decimal divisions
    when the min_dec_div_3 database configuration parameter is set
    to YES:
    
    Example #1:
    db2 "select 10000000000000000000000000000/1
    from sysibm.sysdummy1"
    
    Result for Example #1:
    1
    ---------------------------------
    0,000
    
    1 record(s) selected.
    
    Example #2:
    $  db2 "VALUES
    (DEC(100000000000000000000000000000,30,0)/DEC(10,2,0))"
    
    Result for Example #2:
    1
    ---------------------------------
     0.000
    
    
    Example #3:
    db2 "VALUES
    (DEC(100000000000000000000000000000,30,0)/DEC(1,1,0))"
    
    Result for Example #3:
    1
    ---------------------------------
    SQL0802N Arithmetic overflow or other arithmetic exception
    occurred. SQLSTATE=22003
    
    Example #1 and Example #2 should have returned the SQL0802N
    error message.
    

Local fix

  • Disable decimal division scale to 3 by setting the min_dec_div_3
    database configuration parameter to NO.
    

Problem summary

  • USERS AFFECTED: ALL
    PROBLEM DESCRIPTION: A DECIMAL DIVISION RETURNS AN INCORRECT
    RESULT IF THE RESULTING
    PRECISION IS 32 AND MIN_DEC_DIV_3=YES
    PROBLEM SUMMARY:
    ERROR DESCRIPTION:
    If you have set the min_dec_div_3 database configuration
    parameter to YES, a decimal division with a resulting precision
    of 32 and a scale of 3 returns incorrect results. The error
    message SQL0802N is not returned, this message should be
    returned when the resulting precision is higher than 31.
    
    The following examples show the results of decimal divisions
    when the min_dec_div_3 database configuration parameter is set
    to YES:
    
    Example #1:
    db2 "select 10000000000000000000000000000/1
    from sysibm.sysdummy1"
    
    Result for Example #1:
    1
    ---------------------------------
    0,000
    
    1 record(s) selected.
    
    Example #2:
    $  db2 "VALUES
    (DEC(100000000000000000000000000000,30,0)/DEC(10,2,0))"
    
    Result for Example #2:
    1
    ---------------------------------
     0.000
    
    
    Example #3:
    db2 "VALUES
    (DEC(100000000000000000000000000000,30,0)/DEC(1,1,0))"
    
    Result for Example #3:
    1
    ---------------------------------
    SQL0802N Arithmetic overflow or other arithmetic exception
    occurred. SQLSTATE=22003
    
    Example #1 and Example #2 should have returned the SQL0802N
    error message.
    

Problem conclusion

  • First fixed in DB2 UDB Version 9.5, FixPak 4
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI74152

  • Reported component name

    DB2 UDB QP LINU

  • Reported component ID

    5724E2504

  • Reported release

    950

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-01-26

  • Closed date

    2009-05-29

  • Last modified date

    2009-05-29

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

    LI74151

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

Fix information

  • Fixed component name

    DB2 UDB QP LINU

  • Fixed component ID

    5724E2504

Applicable component levels

  • R950 PSY UP

       LI74152

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGA","label":"DB2 Query Patroller"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"950","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
29 May 2009