From: Patrick E. (JIRA) <nh...@gm...> - 2011-02-22 20:57:13
|
[ http://216.121.112.228/browse/NH-2540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20579#action_20579 ] Patrick Earl commented on NH-2540: ---------------------------------- Thanks for the test case Yogesh. I will look into this. > Linq ignoring configured query-substitutions > -------------------------------------------- > > Key: NH-2540 > URL: http://216.121.112.228/browse/NH-2540 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: Yogesh Jagota > Assignee: Patrick Earl > Priority: Major > Attachments: Generated SQL.txt, NH2540.zip > > > Query: > var items = (from b in session.Query<InvoiceDetail>() > where b.Customer == AddressedToCustomer && b.IsCreditNote == !addInvoices > orderby b.DueDate , b.InvoiceNumber > select b).ToList(); > This query works fine on 3.0.0.1002, but fails on 3.0.0.4000. Generated SQL is attached. > Reason: > I am using a convention to convert bools into ints (true=1, false=0). The previous version is doing this conversion, the newer version isn't. The bool is converted to a string in the newer version (as is the default in sqlite driver), but it should be converted to int according to the convention. > From generated SQL: > "!addInvoices" is passed as a string in the sql query and int in the previous version: > 3.0.0.1002: @p1 = True [Type: Int32 (0)] > 3.0.0.4000: @p1 = 'True' [Type: String (0)] > Also, the IsCreditNote database field is compared to 'true' and 'false' in the new version, and with 1 and 0 in the previous version. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |