|
From: Andrei (JIRA) <nh...@gm...> - 2011-05-30 18:11:45
|
[ http://216.121.112.228/browse/NH-2737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21231#action_21231 ]
Andrei commented on NH-2737:
----------------------------
Sorry Fabio,
I cloned the request before you reopened the NH-2736. I didn't know that the request can be reopened and that the messages posted on a closed request are taken in consideration.
Andrei
> CLONE -Inverted parameters in HQL statement using take
> ------------------------------------------------------
>
> Key: NH-2737
> URL: http://216.121.112.228/browse/NH-2737
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.2.0Beta2
> Reporter: Andrei
> Attachments: NH2736.patch
>
>
> Hello,
> When I create a HQL query using parameters the parameters are inverted.
> Here is an example (I'll attach a test as soon as I have the issue number):
> var query = session.CreateQuery("select o.Id, i.Id from SalesOrder o left join o.Items i with i.Quantity = :p0 take :p1");
> query.SetParameter("p0", 1);
> query.SetParameter("p1", 2);
> var result = query.List();
> Assert.That(result.Count, Is.EqualTo(2));
> The SQL Statement is:
> exec sp_executesql N'select TOP (@p0) salesorder0_.Id as col_0_0_, items1_.Id as col_1_0_ from SalesOrder salesorder0_ left outer join Item items1_ on salesorder0_.Id=items1_.SalesOrder and (items1_.Quantity=@p1)',N'@p0 int,@p1 int',@p0=1,@p1=2
> So the query selects the top 1 rows and the quantity column is filtered with 2.
> Probably this bug is related with the implementation that allows to specify the take rows using parameters.
> Thanks,
> Andrei
--
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
|