Wrong boundary for minimum value for BIGINT/DECIMAL(18)
-------------------------------------------------------

                 Key: CORE-4258
                 URL: http://tracker.firebirdsql.org/browse/CORE-4258
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 3.0 Alpha 1
         Environment: Firebird 3.0.0.30717 (64 bit Windows) (also reproducible 
with and 3.0.0.30708)
            Reporter: Mark Rotteveel


A test in Jaybird creates a table with a DECIMAL(18) field and inserts the 
maximum and minimum values into this table (and retrieves this).

The minimum value for a BIGINT / DECIMAL(18) should be -2^63 (or 
0x8000000000000000 or -9223372036854775808), but when inserting this Firebird 3 
throws error 335544779. Integer overflow.  The result of an integer operation 
caused the most significant bit of the result to carry.

Add 1 to the value and it works, so it looks like it is a boundary issue (it 
seems to use -1 * maximum value (2^63 - 1) as the boundary). The problem also 
occurs with a BIGINT.

This works correctly in Firebird 2.5 and in Firebird 3 Alpha 1 (build 305666)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to