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

Fix error when downloading multiple jdbc drivers #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidecavestro
Copy link

The databaseDriverUrl config property is a string potentially defining a comma-separated list of urls.
It is splitted and iterated on every single url, download the jdbc driver jar and detect a proper file name for it (among other things).
Unfortunately the filename detection throws a StringIndexOutOfBoundsException when the databaseDriverUrl config property has multiple urls (i.e. https://jdbc.postgresql.org/download/postgresql-42.2.20.jar,https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc11/21.1.0.0/ojdbc11-21.1.0.0.jar).

It probably meant to use the substring from the last index of the "/" separator to the end of the url,
but it uses the position from the whole databaseDriverUrl property (unsplitted).

This fix proposes to get the last index of the "/" separator from the currently processed driver url
in order to compute the jar file name, so trying to follow the intention of the author.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Fix systematic "String index out of range" on jdbc driver filename detection
when  using automatic download for database drivers
@cniweb
Copy link

cniweb commented Aug 5, 2022

@prospero238 or @r2liquibase When does this continue? We need the update urgently too!

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