Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support of mariadb sequences fixes #883 #965

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

slavb18
Copy link
Contributor

@slavb18 slavb18 commented Nov 19, 2020

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

Signed-off-by: Vjacheslav Borisov <slavb@ilb.ru>
@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.

None yet

2 participants