igor-tkachev/bltoolkit — pull request #197 by jack128 (2013-03-20 12:30:16+00:00)
Title: Nullable<>.HasValue and unnecessary select from select

from grandChild in db.GrandChild
from child in db.Child
where grandChild.ChildID.HasValue
select grandChild;

generate

SELECT
t3.ParentID as ParentID1,
t3.ChildID as ChildID1,
t3.GrandChildID as GrandChildID1
FROM
(
SELECT -- what is it ????
t1.ChildID,
t1.ParentID,
t1.GrandChildID
FROM
GrandChild t1,
Child t2
) t3
WHERE
t3.ChildID IS NOT NULL

I think, bltoolkit should generate
SELECT
t1.ChildID,
t1.ParentID,
t1.GrandChildID
FROM
GrandChild t1,
Child t2
t1.ChildID IS NOT NULL