HHH-11650 - Add test for issue

This commit is contained in:
Andrea Boriero 2017-04-20 12:55:25 +02:00 committed by Chris Cranford
parent 562f09d14b
commit 17fd76ad21
1 changed files with 12 additions and 0 deletions

View File

@ -386,6 +386,18 @@ public class SQLServer2005DialectTestCase extends BaseUnitTestCase {
);
}
@Test
@TestForIssue(jiraKey = "HHH-11650")
public void testGetLimitWithStringValueContainingParenthesis() {
final String query = "select t1.c1 as col_0_0 FROM table1 t1 where t1.c1 = '(123' ORDER BY t1.c1 ASC";
assertEquals(
"WITH query AS (SELECT inner_query.*, ROW_NUMBER() OVER (ORDER BY CURRENT_TIMESTAMP) as __hibernate_row_nr__ FROM ( " +
"select TOP(?) t1.c1 as col_0_0 FROM table1 t1 where t1.c1 = '(123' ORDER BY t1.c1 ASC ) inner_query ) SELECT col_0_0 FROM query WHERE __hibernate_row_nr__ >= ? AND __hibernate_row_nr__ < ?",
dialect.getLimitHandler().processSql( query, toRowSelection( 1, 5 ) )
);
}
@Test
@TestForIssue(jiraKey = "HHH-11324")
public void testGetLimitStringWithSelectClauseNestedQueryUsingParenthesisOnlyTop() {