Skip to content

Commit f056c3b

Browse files
yrodiereDavideD
authored andcommitted
[#2314] Fix '?' parameters in limit/offset not being replaced with native equivalent when using PostgreSQL/MSSQL
Reverts some changes introduced in e257189, probably assuming this was more efficient and didn't break anything (understandably, considering tests did pass).
1 parent f102f78 commit f056c3b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveDeferredResultSetAccess.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ private CompletionStage<ResultSet> executeQuery() {
149149
return completedFuture( logicalConnection )
150150
.thenCompose( lg -> {
151151
LOG.tracef( "Executing query to retrieve ResultSet : %s", getFinalSql() );
152-
153152
Dialect dialect = DialectDelegateWrapper.extractRealDialect( executionContext.getSession().getJdbcServices().getDialect() );
154-
// I'm not sure calling Parameters here is necessary, the query should already have the right parameters
153+
154+
// This must happen at the very last minute in order to process parameters
155+
// added in org.hibernate.dialect.pagination.OffsetFetchLimitHandler.processSql
155156
final String sql = Parameters.instance( dialect ).process( getFinalSql() );
156157
Object[] parameters = PreparedStatementAdaptor.bind( super::bindParameters );
157158

0 commit comments

Comments
 (0)