
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
Linux & Windows XP, Firebird 2.5 Release Candidate 3
|
|
Issue Links:
|
Duplicate
|
|
|
|
This issue is duplicated by:
|
|
CORE-3159
A view created with a sub select sum with group by returns null for that sub select
|
|
|
|
|
Relate
|
|
|
|
This issue is related to:
|
|
|
|
|
|
CORE-1245
Incorrect column values with outer joins and views
|
|
|
|
|
|
|
| Planning Status: |
Unspecified
|
|
When selecting values from a view with sub selects the last column is returning a null even though it is not, it is possibly an API problem as the problem is duplicated in PHP compilation for 2.5RC3 and in Flamerobin. I've tested this on Windows 2.5 RC 3 & Linux and the problem replicates on both platforms. The reliability of views is compromised if the values returned are not trust worthy.
--drop table testvalues;
create table testvalues (id integer,
datum date,
sfield varchar (10),
num1 numeric (10,2),
num2 numeric (10,2),
primary key (id)
);
commit;
insert into testvalues values (1, 'now', 'A', 10, 0);
insert into testvalues values (2, 'now', 'B', 0, 10);
insert into testvalues values (3, 'now', 'A', 20, 0);
insert into testvalues values (4, 'now', 'B', 0, 20);
create view test_values
as
select
t.datum,
iif ((select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum) is null, 0, (select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum)) A,
iif ((select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum) is null, 0, (select sum(num1-num2) from testvalues where sfield = 'B' and datum <= t.datum)) B,
iif ((select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum) is null, 0, (select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum)) A1,
iif ((select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum) is null, 0, (select sum(num1-num2) from testvalues where sfield = 'B' and datum <= t.datum)) B1
from testvalues t
group by t.datum;
create view test_values2
as
select
t.datum,
0 as A,
0 as B,
0 as A1,
10 as B1
from testvalues t
group by t.datum;
commit;
select t.* from test_values t;
select t.* from test_values2 t;
|
|
Description
|
When selecting values from a view with sub selects the last column is returning a null even though it is not, it is possibly an API problem as the problem is duplicated in PHP compilation for 2.5RC3 and in Flamerobin. I've tested this on Windows 2.5 RC 3 & Linux and the problem replicates on both platforms. The reliability of views is compromised if the values returned are not trust worthy.
--drop table testvalues;
create table testvalues (id integer,
datum date,
sfield varchar (10),
num1 numeric (10,2),
num2 numeric (10,2),
primary key (id)
);
commit;
insert into testvalues values (1, 'now', 'A', 10, 0);
insert into testvalues values (2, 'now', 'B', 0, 10);
insert into testvalues values (3, 'now', 'A', 20, 0);
insert into testvalues values (4, 'now', 'B', 0, 20);
create view test_values
as
select
t.datum,
iif ((select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum) is null, 0, (select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum)) A,
iif ((select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum) is null, 0, (select sum(num1-num2) from testvalues where sfield = 'B' and datum <= t.datum)) B,
iif ((select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum) is null, 0, (select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum)) A1,
iif ((select sum(num1-num2) from testvalues where sfield = 'A' and datum <= t.datum) is null, 0, (select sum(num1-num2) from testvalues where sfield = 'B' and datum <= t.datum)) B1
from testvalues t
group by t.datum;
create view test_values2
as
select
t.datum,
0 as A,
0 as B,
0 as A1,
10 as B1
from testvalues t
group by t.datum;
commit;
select t.* from test_values t;
select t.* from test_values2 t; |
Show » |
|
CORE-1245. At least it disappears once the creation of the nod_derived_expr node in cmp.cpp are undone.