Skip to content

Commit 8664601

Browse files
committed
Fix NH-2840 - SetFirstResult and SetMaxResults do not work correctly on Oracle (ODP.NET) (re-applied with corrected line endings)
Fixes the following tests on Oracle: NHibernate.Test.Criteria.CriteriaQueryTest.SimplePagination NHibernate.Test.Criteria.Lambda.IntegrationFixture.RowCount NHibernate.Test.Legacy.FooBarTest.Limit NHibernate.Test.Legacy.FooBarTest.PSCache NHibernate.Test.Legacy.SQLFunctionsTest.SQLFunctions NHibernate.Test.NHSpecificTest.NH1533.Fixture.Can_query_using_two_orderby_and_limit_altogether NHibernate.Test.NHSpecificTest.NH2251.Fixture.FuturePagedHql NHibernate.Test.NHSpecificTest.NH2251.Fixture.HqlWithOffsetAndLimit NHibernate.Test.NHSpecificTest.NH2251.Fixture.MultiplePagingParametersInSingleQuery NHibernate.Test.Pagination.PaginationFixture.PagTest NHibernate.Test.QueryTest.DetachedQueryFixture.ExecutableQuery
1 parent 5fe16c8 commit 8664601

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/NHibernate/Param/QueryTakeParameterSpecification.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void Bind(IDbCommand command, IList<Parameter> multiSqlQueryParametersLis
3737
if (effectiveParameterLocations.Any())
3838
{
3939
// if the dialect does not support variable limits the parameter may was removed
40-
int value = queryParameters.RowSelection.MaxRows;
40+
int value = Loader.Loader.GetLimitUsingDialect(queryParameters.RowSelection, session.Factory.Dialect) ?? queryParameters.RowSelection.MaxRows;
4141
int position = effectiveParameterLocations.Single();
4242
type.NullSafeSet(command, value, position, session);
4343
}

0 commit comments

Comments
 (0)