From: Matthias D. W. <mwa...@ya...> - 2012-07-03 08:56:06
|
Dear Farrago/LucidDB devs, I think that I have discovered a bug (or at least some strange behaviour) in respect to the SUM and SUM0 aggregate functions. The problem consists in the fact that these functions do always operate with the datatype of the input (SQLSumAggFunction.java and SQLSumEmptyIsZeroAggFunction.java). This is not an issue for big integers or big floating point values but it turns out to be fatal when summing up rather small values (TINYINT, SMALLINT, FLOAT) which likely ends up in overflows. Other database systems (eg. Postgres, http://www.postgresql.org/docs/8.2/static/functions-aggregate.html) perform implicit conversions to BIGINT, DOUBLE, NUMERIC before getting started. Thanks, Matthias Wallnöfer |