mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
#1126 - Regression bug in 10.4.5 with new line character use with SqlQuery, SqlUpdate and CallableSql
This commit is contained in:
1 parent
a6e4e181bf
commit
1e6678cbb4
8 files changed
+66
-16
No files matched your search
@@ -84,7 +84,7 @@ public class ExeCallableSql {
|
||||
cstmt = pstmtFactory.getCstmt(t, logSql, sql, request);
|
||||
} else {
|
||||
if (logSql) {
|
||||
t.logSql(sql);
|
||||
t.logSql(TrimLogSql.trim(sql));
|
||||
}
|
||||
cstmt = pstmtFactory.getCstmt(t, sql);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ExeUpdateSql {
|
||||
pstmt = pstmtFactory.getPstmt(t, logSql, sql, request);
|
||||
} else {
|
||||
if (logSql) {
|
||||
t.logSql(sql);
|
||||
t.logSql(TrimLogSql.trim(sql));
|
||||
}
|
||||
pstmt = pstmtFactory.getPstmt(t, sql);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package io.ebeaninternal.server.persist;
|
||||
|
||||
/**
|
||||
* Utility to improve logging of raw SQL that contains new line characters.
|
||||
*/
|
||||
public class TrimLogSql {
|
||||
|
||||
/**
|
||||
* Replace new line chars for nicer logging of multi-line sql strings.
|
||||
*/
|
||||
public static String trim(String sql) {
|
||||
return sql.replace("\n", "\\n ");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user