New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: List of aggregation is not checked properly [CORE4807] #5105
Comments
Commented by: @asfernandes And why you say the bug is in FB 3? This equivalent query works without error in Oracle: select t.dummy, (select 1 from dual where t.dummy='1'), count(*) |
Commented by: Alex Bekhtin (afgm) > And why you say the bug is in FB 3? 1. I don't know what sql standard says about it |
Commented by: @asfernandes This topic was discussed in fb-devel. If you don't know how it should work, nor want to test others DBMS, search the list. |
Commented by: Alex Bekhtin (afgm) >This topic was discussed in fb-devel. SQL 2008, SQL 2014 return error for this: declare @TBL table(fld1 int, fld2 int) select t.fld1, (select top(1) 1 from @TBL where t.fld2 = 1), count(*) PostgreSQL 9.3 create table test_table ( select t.fld1, (select 1 from test_table where t.fld2 = 1), count(*) |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Commented by: @hvlad Adriano, In the ticket query field t.rdb$system_flag not present in GROUP BY clause and therefore can't be used in SELECT list as is (only as argument of some aggregation function). I think we have a regression in FB3 |
Commented by: @asfernandes Reopening after Vlad's observation. |
Modified by: @asfernandesstatus: Closed [ 6 ] => Reopened [ 4 ] assignee: Adriano dos Santos Fernandes [ asfernandes ] resolution: Won't Fix [ 2 ] => |
Modified by: @asfernandesstatus: Reopened [ 4 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Beta 2 [ 10586 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Alex Bekhtin (afgm)
FB 2.5
select t.rdb$field_name, (select 1 from rdb$database where t.rdb$system_flag=1), count(*)
from rdb$types t
group by t.rdb$field_name
-------------------------
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause).
In FB 3.0 it works without error.
Commits: 1b7f77b FirebirdSQL/fbt-repository@494266e
The text was updated successfully, but these errors were encountered: