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

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

Commit 8182e184ebead655c05509c37e44dac711b2a584 in openjpa's branch 
refs/heads/OPENJPA-3038 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=8182e184e ]

[OPENJPA-3038] Name MySQL/MariaDB constraints with CONSTRAINT <name>

MySQLDictionary and MariaDBDictionary used constraintNameMode=mid and
emitted named constraints as FOREIGN KEY <name> (...), UNIQUE <name> (...)
and PRIMARY KEY <name> (...). Switch both to the default
CONSTRAINT <name> FOREIGN KEY / UNIQUE / PRIMARY KEY form.

MySQL: since 8.0.16 the name in FOREIGN KEY <name> (...) only names the
backing index; the constraint gets a generated <table>_ibfk_<n> name, so
DROP FOREIGN KEY <name> in generated drop scripts fails.

MySQL and MariaDB: schema generation scripts must contain the spec form
CONSTRAINT <name> FOREIGN KEY / UNIQUE, which the TCK checks for.

Behaviour change for MySQL users: an explicit foreign key name is now an
InnoDB constraint name, which must be unique per database rather than
per table, so reusing the same @ForeignKey(name=...) on several tables
now fails at DDL time. Named primary keys are emitted as
CONSTRAINT <name> PRIMARY KEY (MySQL ignores the name). The previous
form can be restored with DBDictionary ConstraintNameMode=mid.


> MySQL: mapping, order column and map key tests fail
> ---------------------------------------------------
>
>                 Key: OPENJPA-3038
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3038
>             Project: OpenJPA
>          Issue Type: Sub-task
>            Reporter: Richard Zowalla
>            Priority: Major
>
> These tests fail on MySQL and only report "failed", the cause has to be found 
> from the TCK logs:
> * {{Client.associationOverride}}, {{mapKeyClass}}, {{mapKeyJoinColumn}}, 
> {{mapKeyJoinColumnTest}}
> * {{Client1.orderByTest1}} to {{orderByTest4}}, {{orderColumn}}, 
> {{orderColumnTest}}
> * {{annotationMappingTest1}}, {{3}} to {{8}}, {{mappingTest1}} to {{8}}, 
> {{biDirMXMTest1}}
> * {{DIDTest}}, {{didTest}}, {{test1}}, {{joinTableTest}}, 
> {{secondaryTableTest}}, {{uniqueConstraintTest}}
> * {{Client1.setParameterParameterCalendarTemporalTypeTest}} (also on SQL 
> Server)



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

Reply via email to