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
Make EnterpriseDBDatabase detection less broad #2364
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wwillard7800
approved these changes
Jan 13, 2022
liquibase-core/src/main/java/liquibase/database/core/EnterpriseDBDatabase.java
Outdated
Show resolved
Hide resolved
StevenMassaro
approved these changes
Jan 13, 2022
suryaaki2
approved these changes
Jan 18, 2022
liquibase-core/src/main/java/liquibase/database/core/EnterpriseDBDatabase.java
Outdated
Show resolved
Hide resolved
I updated the code to check the connection to know if it's an edb database vs. purely relying on the url. I left the jdbc:edb and jdbc:postgres checks in there around it, though, for performance reasons. |
molivasdat
reviewed
Jan 19, 2022
liquibase-core/src/main/java/liquibase/database/core/EnterpriseDBDatabase.java
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The current implementation of EnterpriseDBDatabase picks up database with just "edb" in the url anywhere vs. an actual edb url.
Fixes #2363
Work Around
You can manually override the (wrongly) detected dialect with
databaseClass: liquibase.database.core.MySQLDatabase
ordatabaseClass: liquibase.database.core.DB2Database
etc. in your liquibase.properties file.Dev Handoff Notes (Internal Use)
Links
Testing
Dev Verification
Added automated test to catch the problem
Test Requirements (Liquibase Internal QA)
Manual Tests
Setup: Case 1
url:jdbc:mysql://localhost:3309/testedb1?useSSL=false&allowPublicKeyRetrieval=true
driver
name in liquibase.propertiesclasspath.
edb
. That is why the setup removes any reference to the driver class or driver jar. Liquibase does not ship with a MySQL jar in lib; we must add that manually to run this test.Error Message output By Bug
Verify non-Postgres/EDB JDBC URLs with “edb” do not try and use PG/EDB driver.
liquibase log-level INFO update-sql --changelog-file <any changelog>
Setup Case 2
url:jdbc:edb://localhost:5444/test
Verify the EDB driver is used for a connection that has “edb” AND “:5444”
liquibase log-level INFO update-sql --changelog-file <anychangelog>
Setup: Case 3
url: jdbc:postgresql://localhost:5432/test
Verify the Postgres driver is used for a connection that has “postgres” and “:5432”
liquibase log-level INFO update-sql --changelog-file <anychangelog>
Automated Tests
┆Issue is synchronized with this Jira Bug by Unito