-
-
Notifications
You must be signed in to change notification settings - Fork 258
Closed
Description
Many of our integration tests seem to fail when we upgrade our own emulation of linear regression functions to Firebird 4.0.0's native support.
Try this, for example:
select regr_avgx(a, b)
from (
select 1, 1 from RDB$DATABASE union all
select 2, 1 from RDB$DATABASE union all
select 3, 2 from RDB$DATABASE union all
select 4, 2 from RDB$DATABASE
) t (a, b);
Firebird 4.0 produces the value 4
, when it should produce 1.5
like these database products:
Maybe, this gives you a hint about the bug?
select regr_avgx(a, b), regr_avgx(cast(a as bigint), cast(b as bigint))
from (
select 1, 1 from RDB$DATABASE union all
select 2, 1 from RDB$DATABASE union all
select 3, 2 from RDB$DATABASE union all
select 4, 2 from RDB$DATABASE
) t (a, b);
select regr_avgx(cast(a as bigint), cast(b as bigint)), regr_avgx(a, b)
from (
select 1, 1 from RDB$DATABASE union all
select 2, 1 from RDB$DATABASE union all
select 3, 2 from RDB$DATABASE union all
select 4, 2 from RDB$DATABASE
) t (a, b);
In both cases, I'm getting this, now:
|REGR_AVGX|REGR_AVGX|
|---------|---------|
|4.0 |0 |