Subject | Re: [firebird-support] sum of integers results in an overflow |
---|---|
Author | Ivan Prenosil |
Post date | 2007-03-16T13:29:16Z |
> create table TEST_TABLE (Which is correct, it is difficult to overflow double.
> integerValue INTEGER
> );
>
> insert into TEST_TABLE ( integerValue ) values ( 1000000000 );
> insert into TEST_TABLE ( integerValue ) values ( 2000000000 );
>
> select sum( cast( integerValue as DOUBLE PRECISION ) )
> from test_table;
>
> select sum( integerValue )
> from test_table;
>
> ***
>
> The first select sum works in Interbase 5.6, Firebird 1.5.3 Dialect 1,
> and Firebird 1.5.3 Dialect 3.
> The second select sum works in FirebirdWhich is correct too, since the sum is done using Bigint.
> 1.5.3 Dialect 3
> and throws an overflow exception in Firebird 1.5.3And it is correct too, the sum can' fit into Integer.
> Dialect 1 *and* Interbase 5.6...
>Right.
> So I guess it functions exactly how it did in Interbase which is what it
> is supposed to do.
Ivan