Subject Count(distinct ...) problem?
Author eos_dev
A short example (Firebird v1.5.3):

CREATE TABLE tbl(number INTEGER NOT NULL PRIMARY KEY);
INSERT INTO tbl VALUES(2147483647);

Now:

(1)
SELECT COUNT(DISTINCT number) FROM tbl;

returns this result:

COUNT
============
0

while:

(2)
SELECT COUNT(number) FROM tbl;

is ok (COUNT==1). If number < 2147483647 (2^31-1) everything is
right.

What am I missing? Is this a known bug?


Thanks!