rzo1 commented on code in PR #278:
URL: https://github.com/apache/openjpa/pull/278#discussion_r4495835436
##########
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java:
##########
Review Comment:
Thanks, checked it on Oracle Free 23: `SUBSTR('Jane', 10)` is NULL, but in
Oracle NULL is the empty string (`'' IS NULL` is true), so that is the empty
string JPA expects and there is nothing else it could return. LEFT is
`SUBSTR(s, 0, n)`, and `SUBSTR('Jane', 0, 10)` gives `Jane`, so it already
works for lengths beyond the string (`testLeftLongerThanString`). RIGHT was
different, `SUBSTR(s, -n)` gives NULL instead of the whole string when n is
beyond the length.
I added `testSubstringBeyondString` (NULL on Oracle, empty string
elsewhere); it passes on Oracle, Derby and H2.
--
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]