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
A view created with a sub select sum with group by returns null for that sub select [CORE3159] #3535
Comments
Modified by: @dyemanovsecurity: Developers [ 10012 ] => |
Commented by: @dyemanov Could you please test it against the latest snapshot build (2.5.0.26089), because I'm unable to reproduce it there, so it could be already fixed. |
Commented by: @asfernandes This seems exact issue already fixed in CORE3141. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovQA Status: No test |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] QA Status: No test => Covered by another test(s) Test Details: Test case from this ticked has been added into core_3141.fbt |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] QA Status: Covered by another test(s) => Done successfully |
Submitted by: Andre van Zuydam (andrevanzuydam)
Duplicates CORE3141
When creating specific views with group by, sub select statements return null values. Please run the test scenario below, the problem is not obvious at first until a group by is added to the view.
--drop view view_test_withoutgroup;
--drop view view_test;
--drop table test;
--drop table source;
create table test (
id integer default 0 not null,
variance numeric (10,2),
anumber integer default 0,
primary key (id)
);
commit;
insert into test (id, variance, anumber)
values (1, 100.00, 10);
insert into test (id, variance, anumber)
values (2, 150.00, 10);
insert into test (id, variance, anumber)
values (3, 150.00, 12);
create table source (
id integer default 0 not null,
primary key (id)
);
commit;
insert into source (id) values (10);
insert into source (id) values (12);
commit;
create view view_test (databasename, testvalue, placer)
as
SELECT id, (select sum (variance) from test where anumber = 10), 10
FROM source
group by id;
commit;
create view view_test_withoutgroup (databasename, testvalue, placer)
as
SELECT id, (select sum (variance) from test where anumber = 10), 10
FROM source;
commit;
--select * from view_test_withoutgroup; --this one works
select * from view_test; --this one doesn't
====== Test Details ======
Test case from this ticked has been added into core_3141.fbt
The text was updated successfully, but these errors were encountered: