From: Kelly S. (JIRA) <nh...@gm...> - 2011-05-04 21:05:03
|
[ http://216.121.112.228/browse/NH-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20997#action_20997 ] Kelly Stuard commented on NH-2691: ---------------------------------- If anyone knows how to create tests that are specific to "long", I would love to have your input. Creating int.MaxValue+1 of Cats takes an extremely long time; even in SQLite. As such, I cannot make any failing tests of this issue and am requesting guidance. > Linq LongCount() behavior different from Count() > ------------------------------------------------ > > Key: NH-2691 > URL: http://216.121.112.228/browse/NH-2691 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Priority: Minor > > It seems to me that Count() and LongCount() should behave the same, except for the max value they return. I am finding this not to be the case. Consider the following example: > var query = > from cat in session.Query<Cat>() > orderby cat.Born > select cat; > var queryCount = query.Count(); > // NHibernate: select cast(count(*) as INTEGER) as col_0_0_ from Cat cat0_ > var queryLongCount = query.LongCount(); > // NHibernate: select cast(count(*) as INTEGER) as col_0_0_ from Cat cat0_ order by cat0_.Born > I am partial to the behavior of .Count() where it ignores the order. Also, it seems that LongCount() should probably cast as a long, instead of an int. -- 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 |