[reporter="elin", created="Mon, 20 Nov 2006 12:16:28 -0500 (GMT-05:00)"]
To repro:
create schema s;
set schema 's';
-- if null is returned first with a select, no order by
-- then all the columns returned are null
create table null_first(i int primary key, d date);
insert into null_first values(1, null), (2, DATE'1987-2-5'), (3,DATE'1998-12-3');
select * from null_first;
select extract(day from ((current_date - d)day)) from null_first;
-- if null is returned last with a select, no order by
create table null_last(i int primary key, d date);
insert into null_last values(1, DATE'2008-1-1'), (2, DATE'1999-1-5'), (3,null);
select * from null_last;
select extract(day from ((current_date - d)day)) from null_last;
-- if null is returned in the middle with a select, no order by
create table null_middle(i int primary key, d date);
insert into null_middle values(1, DATE'2008-1-1'), (2, null), (3, DATE'1999-1-5');
select * from null_middle;
select extract(day from ((current_date - d)day)) from null_middle;
[author="jpham", created="Tue, 21 Nov 2006 14:06:20 -0500 (GMT-05:00)"]
We weren't setting nullability flags correctly. Should be fixed by eigenbase change 8198 in the main (lu) branch.
[reporter="elin", created="Mon, 20 Nov 2006 12:16:28 -0500 (GMT-05:00)"] To repro:
create schema s;
set schema 's';
-- if null is returned first with a select, no order by
-- then all the columns returned are null
create table null_first(i int primary key, d date);
insert into null_first values(1, null), (2, DATE'1987-2-5'), (3,DATE'1998-12-3');
select * from null_first;
select extract(day from ((current_date - d)day)) from null_first;
-- if null is returned last with a select, no order by
create table null_last(i int primary key, d date);
insert into null_last values(1, DATE'2008-1-1'), (2, DATE'1999-1-5'), (3,null);
select * from null_last;
select extract(day from ((current_date - d)day)) from null_last;
-- if null is returned in the middle with a select, no order by
create table null_middle(i int primary key, d date);
insert into null_middle values(1, DATE'2008-1-1'), (2, null), (3, DATE'1999-1-5');
select * from null_middle;
select extract(day from ((current_date - d)day)) from null_middle;