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

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

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

[OPENJPA-3028] Store chars as CHAR by default on Oracle

OracleDictionary still stored char and Character attributes as NUMBER
code points, so writing them into a pre-existing CHAR(1) column, such as
the ones of the Jakarta Persistence TCK schema, failed with ORA-12899
(the code point '97' is two characters). Oracle has a CHAR type, so use
the same default as Derby, H2, MySQL, MariaDB, SQL Server and PostgreSQL;
an explicit StoreCharsAsNumbers=true is still respected.

Oracle sizes columns in bytes by default (NLS_LENGTH_SEMANTICS=BYTE), so a
generated CHAR(1) column of an AL32UTF8 database would reject any
non-ASCII character, e.g. 'é' or '€', with ORA-12899. The generated column
of a char or Character attribute is therefore declared with character
length semantics, CHAR(1 CHAR), and holds every character the NUMBER
mapping could hold.

Behaviour change: schemas created by earlier releases on Oracle hold such
attributes in NUMBER columns and need StoreCharsAsNumbers=true (or a
migration to CHAR(1 CHAR)); newly generated columns are CHAR(1 CHAR). A
pre-existing byte sized CHAR(1) column only holds single-byte characters.
The migration notes and the StoreCharsAsNumbers reference say so.

TestStoreCharsAsNumbersDefaults covers the Oracle default and the
generated type name. TestCharStorage checks the default, round-trips
non-ASCII characters and, on Oracle only, accepts the NUMBER type Oracle
reports for integer columns.


> 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