From: Yogesh J. (JIRA) <nh...@gm...> - 2011-02-17 15:44:26
|
3.0.0.4000 is not taking conventions into account when generating SQL for linq queries -------------------------------------------------------------------------------------- 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 Priority: Major Attachments: Generated SQL.txt 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 |