google-code-export / dblinq2007

Automatically exported from code.google.com/p/dblinq2007
Other
0 stars 0 forks source link

DBLinq changes empty set for set with empty element on LINQ queries #304

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. First of all think of sets
2. This is empty set: { }
3. This is set with one element, the element is "empty": { null }
4. when you query the empty set via for example Where(it => it...) the query 
should not even be executed because the set is empty
5. with DBLinq however it is run and "it" is equal to null
6. to check it, create empty table 
7. in C# write such catcher:
        bool foo()
        {
            throw new NotImplementedException();
        }
8. and write the query:
            var record = db.YourTable.SingleOrDefault(it => it==null?foo():false);

What is the expected output? What do you see instead?
The expected result is record is null. I see calling foo which should not 
happen.

What version of the product are you using? On what operating system?
0.20.1. Windows 7.0 64-bit, PostgreSQL, VS 2010.

Please provide any additional information below.

Original issue reported on code.google.com by pilichow...@gmail.com on 14 Feb 2011 at 7:47