Skip to content
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

Closed
firebird-automations opened this issue Oct 5, 2010 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

security: Developers [ 10012 ] =>

@firebird-automations
Copy link
Collaborator Author

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

This seems exact issue already fixed in CORE3141.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue duplicates CORE3141 [ CORE3141 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Duplicates CORE3141.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: 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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Covered by another test(s) => Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant