Nested aggregation is allowed
-----------------------------

                 Key: CORE-5848
                 URL: http://tracker.firebirdsql.org/browse/CORE-5848
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 3.0.3, 2.5.8, 4.0 Alpha 1
            Reporter: Pavel Zotov


Following query should NOT be allowed (nested aggregation):

with
rf as (
    select 1 as p from rdb$database union all
    select 3 from rdb$database union all
    select 5 from rdb$database union all
    select 7 from rdb$database
)
,dual as (
    select 1 x from rdb$database
)
 
select
    count(
        sum (
            (select sum(rf.p) from rf)
        )
    )
from dual;


But:
1) it returns "internal Firebird consistency check (EVL_expr: invalid operation 
(232), file: evl.cpp line: 1220)" on WI-V2.5.9.27111
2) it runs without any error on WI-V3.0.4.32988 and WI-T4.0.0.1008 Firebird 
(and returns: 0 - which is also wrong because argument of COUNT is NOT-null 
value :)).

PS.
I've opened this separate ticket after discuss with dimitr, related to CORE-5563

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to