#1126 - Regression bug in 10.4.5 with new line character use with SqlQuery, SqlUpdate and CallableSql

This commit is contained in:
rob bygrave
2017-09-13 21:14:19 +12:00
parent a6e4e181bf
commit 1e6678cbb4
8 changed files with 66 additions and 16 deletions
@@ -17,6 +17,32 @@ import static org.junit.Assert.assertEquals;
public class SqlQueryTests extends BaseTestCase {
@Test
public void newline_replacedInLogsOnly() {
ResetBasicData.reset();
String sql = "select * -- \n from o_customer";
SqlQuery sqlQuery = Ebean.createSqlQuery(sql);
List<SqlRow> list = sqlQuery.findList();
assertThat(list).isNotEmpty();
}
@Test
public void newLineLiteral_replacedInLogsOnly() {
ResetBasicData.reset();
String sql = "select 'hello\nthere' as hello from o_customer";
SqlQuery sqlQuery = Ebean.createSqlQuery(sql);
List<SqlRow> list = sqlQuery.findList();
assertThat(list).isNotEmpty();
assertThat(list.get(0).getString("hello")).isEqualTo("hello\nthere");
}
@Test
public void firstRowMaxRows() {