Subject Re: [firebird-support] sum of integers results in an overflow
Author Helen Borrie
At 08:04 AM 16/03/2007, you wrote:
>Hello,
>
>We recently converted our applications from Interbase 5.6 to Firebird
>1.5.3 Classic on linux. So far it has gone well and there have been a
>lot of nice query speed-ups without us having to do anything! However,
>I just received a defect notice from one of our developers that a report
>is now failing our regression tests. We traced it down to a "select
>sum" query that is adding up an integer column. We are using Dialect 1
>since we are still in the middle of converting our trigger and stored
>procedure code as well as trying to move off of the date-time fields.
>Selecting a sum of integers where the result would overflow an integer
>seems to work in Dialect 3, but not in Dialect 1. We can work around it
>by casting the field to a double which seems to cause the sum to return
>a double rather than an integer. However, I would prefer not to have to
>find out where else in the code this might happen. I am not even sure
>if this would overflow in Interbase since we never saw this behavior
>before. We converted all of our test servers over, so I will have to
>set one up and try it out...
>
>Anyways my question is: Is this a bug in Firebird with Dialect 1?

It might be....but you are using an old version of Firebird
1.5.x. The latest release is v.1.5.4: you might like to download
the release notes and check in the Bug Fixes section as to whether
you are looking at a bug that might have been fixed.

./heLen