mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1126 - Regression bug in 10.4.5 with new line character use with SqlQuery, SqlUpdate and CallableSql
This commit is contained in:
@@ -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() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user