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

Fixes #18848: "Failed to parse query parameters from JDBC URL" when query is an empty string #18850

Merged
merged 4 commits into from
Dec 1, 2024

Conversation

plutaniano
Copy link
Contributor

Describe your changes:

Fixes #18848

When query is an empty string, indexOf returns -1, which results in subtring(0, -1), causing an error.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@@ -35,7 +35,7 @@ private static Map<String, String> parseQueryParams(String jdbcURL) {
URI uri = new URI(jdbcURL.substring(jdbcURL.indexOf(":") + 1));
Map<String, String> queryPairs = new LinkedHashMap<>();
String query = uri.getQuery();
if (query != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@plutaniano thanks for the PR. We actually have nullOrEmpty from CommonUtils you can use

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link

@harshach harshach merged commit cbe3241 into open-metadata:main Dec 1, 2024
7 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Add this label to run secure Github workflows on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Failed to parse query parameters from JDBC URL" when upgrading from 1.5.8 to 1.5.9
3 participants