Skip site navigation (1) Skip section navigation (2)

pgsql: Fix float4/8 to handle Infinity and Nan consistently, e.g.

From: momjian(at)postgresql(dot)org (Bruce Momjian)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix float4/8 to handle Infinity and Nan consistently, e.g.
Date: 2007-01-02 20:00:50
Message-ID: 20070102200050.416F29F9CE3@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix float4/8 to handle Infinity and Nan consistently, e.g. Infinity is a
valid result from a computation if one of the input values was infinity.
The previous code assumed an operation that returned infinity was an
overflow. 

Handle underflow/overflow consistently, and add checks for aggregate
overflow.  

Consistently prevent Inf/Nan from being cast to integer data types.  

Fix INT_MIN % -1 to prevent overflow. 

Update regression results for new error text.

Per report from Roman Kononov.

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        float.c (r1.131 -> r1.132)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/float.c.diff?r1=1.131&r2=1.132)
        int.c (r1.75 -> r1.76)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/int.c.diff?r1=1.75&r2=1.76)
    pgsql/src/test/regress/expected:
        float4-exp-three-digits.out (r1.7 -> r1.8)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/float4-exp-three-digits.out.diff?r1=1.7&r2=1.8)
        float4.out (r1.13 -> r1.14)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/float4.out.diff?r1=1.13&r2=1.14)
        float8-exp-three-digits-win32.out (r1.7 -> r1.8)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/float8-exp-three-digits-win32.out.diff?r1=1.7&r2=1.8)
        float8-small-is-zero.out (r1.10 -> r1.11)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/float8-small-is-zero.out.diff?r1=1.10&r2=1.11)
        float8-small-is-zero_1.out (r1.4 -> r1.5)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/float8-small-is-zero_1.out.diff?r1=1.4&r2=1.5)
        float8.out (r1.24 -> r1.25)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/float8.out.diff?r1=1.24&r2=1.25)
    pgsql/src/test/regress/sql:
        float4.sql (r1.8 -> r1.9)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/float4.sql.diff?r1=1.8&r2=1.9)

pgsql-committers by date

Next:From: Bruce MomjianDate: 2007-01-02 20:50:35
Subject: pgsql: Add #include <float.h> for platforms that still need it.
Previous:From: User AndrewdDate: 2007-01-02 19:10:33
Subject: pgbuildfarm - client-code: Try to unlimit core files if possible, and

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group