[ 
https://issues.apache.org/jira/browse/OPENJPA-3028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18139646#comment-18139646
 ] 

ASF subversion and git services commented on OPENJPA-3028:
----------------------------------------------------------

Commit 1130678186fa440217bf5ee91be7542126d4c557 in openjpa's branch 
refs/heads/OPENJPA-3028-oracle-functions from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=113067818 ]

[OPENJPA-3028] Fix RIGHT for lengths beyond the string on Oracle

RIGHT(str, n) was rendered as SUBSTR(str, -n), which Oracle evaluates
to NULL when n is larger than the length of the string, so for example
RIGHT(name, 100) returned NULL instead of the whole name. The start
position is now computed from the length of the string, so RIGHT returns
the whole string when n exceeds its length. The string occurs twice in
the SQL, so a string parameter is bound twice.

Behaviour change on Oracle: RIGHT(str, 0) returned the whole string,
because SUBSTR(str, 0) starts at the first character; it now returns
NULL, which is the empty string of Oracle. A negative n, which JPA does
not define, returned the substring starting at position -n when given as
a parameter, and now returns NULL as well.

TestOracleDictionary checks the SQL of RIGHT, and TestEJBQLFunction
checks RIGHT with a length of 0 on every database.


> Jakarta Persistence 3.2 TCK failures on Derby, MySQL and SQL Server
> -------------------------------------------------------------------
>
>                 Key: OPENJPA-3028
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3028
>             Project: OpenJPA
>          Issue Type: Epic
>            Reporter: Richard Zowalla
>            Assignee: Richard Zowalla
>            Priority: Major
>         Attachments: run_de.tar.xz, run_ms.tar.xz, run_my.tar.xz, 
> run_or.tar.xz
>
>
> Results of the Jakarta Persistence 3.2 TCK with 
> {{openjpa-integration/tck/run-tck32.sh}} (reported by Maxim Solodovnik on 
> dev@):
> * PostgreSQL 16: passed
> * MySQL 8.4.8: 2134 tests, 43 errors
> * SQL Server 2017-CU12: 2134 tests, 45 errors
> * Derby: 2134 tests, 184 errors
> The sub-tasks group the errors by cause. Several groups show up on more than 
> one database. Where the TCK output only says "<test> failed", the cause still 
> has to be found from the TCK logs.
> Note: the TCK build does not work with Maven 3.10.0; 3.9.x works.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to