-
Notifications
You must be signed in to change notification settings - Fork 697
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
fix: Add support for creating sequence in MariaDB #2324
Conversation
I'll fix some tests |
This reverts commit e6bb1df.
TransactionManager.current().db.isVersionCovers(SEQUENCE_MIN_MAJOR_VERSION, SEQUENCE_MIN_MINOR_VERSION) | ||
} | ||
|
||
// actually MariaDb supports it but jdbc driver prepares statement without RETURNING clause |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we implement this by ourselves? I looked how Oracle do this. As I understand Exposed sends sql without returning clause and jdbc driver add it after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look into it and we can deal with it in a separate pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. I wanted to do it by myself earlier but I'm too busy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @devgor88. Thank you for your contribution! I left some comments.
exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/vendors/MariaDBDialect.kt
Outdated
Show resolved
Hide resolved
exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/vendors/MariaDBDialect.kt
Outdated
Show resolved
Hide resolved
Hi @joc-a. Thank you for reviewing my contribution. I answered your comments. |
Thank you, @devgor88. Looks good to me. Just one more thing to address before merging: You've ticked "Is breaking change" in the description. Could you please specify what is the breaking change? I don't think there is one, but let me know if you have a different opinion, and if you do, then it would be best to include a note about it in Breaking-Changes.md. |
exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/shared/ddl/SequencesTests.kt
Outdated
Show resolved
Hide resolved
exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/vendors/MariaDBDialect.kt
Outdated
Show resolved
Hide resolved
Thank you for approving, @joc-a! I wrote some comments that bothered me. I've ticked "Is breaking change" because |
@devgor88 Since you are neither modifying nor removing an existing public API method, but rather adding new ones, it is not a breaking change. So there is no need to tick "Is breaking change". |
@devgor88 Thank you for your contribution. |
Description
Summary of the change: Add support for creating sequence in MariaDB.
Detailed description:
What: Variable supportsCreateSequence overrided from MysqlDialect(). Now it checks db version and return true for version greater than or equal to 10.3.
Why: It was necessary because existing isVersionCovers compares version as BigDecimal. Due to it 10.11 < 10.3.
How: There were added majorVersion and minorVersion in ExposedDatabaseMetadata. They were implemented in JdbcDatabaseMetadataImpl. isVersionCovers function implemented with two parameters major and minor versions.
Type of Change
Please mark the relevant options with an "X":
Updates/remove existing public API methods:
Affected databases:
Checklist
Related Issues