Subject | Re: [firebird-support] Re: Confused about Firebird releases |
---|---|
Author | Milan Babuskov |
Post date | 2008-12-28T18:01:54Z |
Alan McDonald wrote:
SELECT c1, c2, c3, c4 + coalesce(c5, 0), sum(c6)
FROM t1
GROUP BY c1, c2, c3, c4
...or...
SELECT c1, c2, c3, current_timestamp + coalesce(c5, 0), sum(c6)
FROM t1
GROUP BY c1, c2, c3
Firebird 2.0 allowed it, while 2.1 requires to add "c5" to GROUP BY
list. Column c4 is a timestamp, while c5 is integer. Firebird 2.1 works
correctly, 2.0 could produce wrong results.
I cannot recall the exact query, and I cannot read it in the code
because is dynamically created and I don't know what are all the options
my client selected to get it. Since FB 2.1 works properly, I did not
bother to report a bug (as it has already been fixed).
--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com
>> anymore. For example, I learned this the hard way yesterday as one ofI can't find it now, but it was something like this:
>> my
>> queries that had COALESCE(somecolumn, 0) stopped working because I did
>> not GROUP BY somecolumn. It did work properly before simply because
>> this
>> column was NULL in all databases (it was reserved for future usage).
>
> Milan,
> Can you explain this a litle more please?
> Can you show us a query which worked n 2.0 and now does not in 2.1?
SELECT c1, c2, c3, c4 + coalesce(c5, 0), sum(c6)
FROM t1
GROUP BY c1, c2, c3, c4
...or...
SELECT c1, c2, c3, current_timestamp + coalesce(c5, 0), sum(c6)
FROM t1
GROUP BY c1, c2, c3
Firebird 2.0 allowed it, while 2.1 requires to add "c5" to GROUP BY
list. Column c4 is a timestamp, while c5 is integer. Firebird 2.1 works
correctly, 2.0 could produce wrong results.
I cannot recall the exact query, and I cannot read it in the code
because is dynamically created and I don't know what are all the options
my client selected to get it. Since FB 2.1 works properly, I did not
bother to report a bug (as it has already been fixed).
--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com