Clearing a list used by Contains causes subsequent queries to fail
Description
If you clear a list that has been used in a linq query subsequent similar queries can fail.
The linq provider appears to be caching the list as if it were a constant, subsequent queries then see this list as empty at NHibernate.Linq.Visitors.ResultOperatorProcessers.ProcessContains.IsEmptyList and output the query as "WHERE 1 = 0".
Fixed in 3.3.x as d212c6bdeb33639e5ef602d0a7cf85e33d986248
Chris Chilvers
March 7, 2013 at 1:16 AM
Git bisect suggests that the change for (9a6e87f0) introduced/revealed the bug.
Reverting that commit from 3.3.3CR1 does make the test pass, though I'm not sure how changing the caching key actually caused the error. So I suspect the actual error might be elsewhere and that change revealed it.
Chris Chilvers
March 6, 2013 at 11:35 PM
Oh wait, just double checking and it did work in 3.3.1GA, stops working in 3.3.2GA, now to see if I can work out git bisect
If you clear a list that has been used in a linq query subsequent similar queries can fail.
The linq provider appears to be caching the list as if it were a constant, subsequent queries then see this list as empty at NHibernate.Linq.Visitors.ResultOperatorProcessers.ProcessContains.IsEmptyList and output the query as "WHERE 1 = 0".