rzo1 commented on code in PR #208:
URL: https://github.com/apache/openjpa/pull/208#discussion_r4220947817
##########
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java:
##########
@@ -113,12 +113,22 @@ public void appendTo(Select sel, ExpContext ctx, ExpState
state,
// escape out characters by using the database's escape sequence
DBDictionary dict = ctx.store.getDBDictionary();
- if (_escape != null) {
+ // an empty escape character means the same as none at all; the
+ // JPQL grammar accepts ESCAPE '' and some databases reject it
+ if (_escape != null && !_escape.isEmpty()) {
Review Comment:
Good catch — both places now use `StringUtil.isNotEmpty(...)`
(`org.apache.openjpa.lib.util.StringUtil`, already imported in both files for
other uses): the JDBC `MatchesExpression` and the in-memory one in
openjpa-kernel. Re-ran the LIKE and escape tests on Derby and H2, all green.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]