HHH-11642 - Fix index out of range failure for SQLServerDialect.
This commit is contained in:
parent
fe0030c019
commit
b1a322d1f3
|
@ -39,7 +39,13 @@ public class TopLimitHandler extends AbstractLimitHandler {
|
|||
public boolean supportsLimitOffset() {
|
||||
return supportsVariableLimit;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean supportsVariableLimit() {
|
||||
return supportsVariableLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean bindLimitParametersFirst() {
|
||||
return bindLimitParametersFirst;
|
||||
}
|
||||
|
@ -56,14 +62,14 @@ public class TopLimitHandler extends AbstractLimitHandler {
|
|||
|
||||
StringBuilder sb = new StringBuilder( sql.length() + 8 )
|
||||
.append( sql );
|
||||
|
||||
|
||||
if ( supportsVariableLimit ) {
|
||||
sb.insert( insertionPoint, " TOP ? " );
|
||||
}
|
||||
else {
|
||||
sb.insert( insertionPoint, " TOP " + getMaxOrLimit( selection ) + " " );
|
||||
}
|
||||
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue