mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-15 07:34:57 +00:00
HHH-12369 Testcase that ensures the max rows don't overflow
This commit is contained in:
parent
690fb6c334
commit
5aaabb0f03
@ -8,6 +8,7 @@
|
||||
|
||||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.engine.spi.RowSelection;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.mapping.Column;
|
||||
@ -15,6 +16,7 @@
|
||||
import org.hibernate.testing.junit4.BaseUnitTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* DB2 dialect related test cases
|
||||
@ -63,4 +65,17 @@ public void testGetExplicitBinaryTypeName() {
|
||||
actual
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue(jiraKey = "HHH-12369")
|
||||
public void testIntegerOverflowForMaxResults() {
|
||||
RowSelection rowSelection = new RowSelection();
|
||||
rowSelection.setFirstRow(1);
|
||||
rowSelection.setMaxRows(Integer.MAX_VALUE);
|
||||
String sql = dialect.getLimitHandler().processSql( "select a.id from tbl_a a order by a.id", rowSelection );
|
||||
assertTrue(
|
||||
"Integer overflow for max rows in: " + sql,
|
||||
sql.contains("fetch first 2147483647 rows only")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user