Skip to content

Conversation

@slavb18
Copy link
Contributor

@slavb18 slavb18 commented Nov 19, 2020

Add support of mariadb sequences
https://mariadb.com/kb/en/sequences/

@slavb18
Copy link
Contributor Author

slavb18 commented Nov 19, 2020

SEQUENCES supported only on mariadb 10.3+, tests fails

Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SEQUENCE AC_STUDENT_SEQ START WITH 25 INCREMENT BY 25' at line 1

May be there should be mysql server version check in method supportsSequenceObjects ?

Copy link
Contributor

@rfelcman rfelcman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but it seems, that this PR break compatibility with older MySQL versions (5.6, 5.7). See PR checks (Travis-CI output)
I see there possible solutions:

  1. Add to EclipseLink new platform e.g. org.eclipse.persistence.platform.database.MariaDB and inherit and override content from org.eclipse.persistence.platform.database.MySQLPlatform
  2. Check DB server version in origin org.eclipse.persistence.platform.database.MySQLPlatform see e.g. https://github.com/eclipse-ee4j/eclipselink/blob/master/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/platform/database/SQLServerPlatform.java#L79 and put Your changes in conditions, but as I checked some changes are similar like inherited from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform#buildSequenceObjectDeletionWriter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants