Skip to content

fix: parse nested options #988

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

Merged
merged 2 commits into from
May 9, 2024
Merged

fix: parse nested options #988

merged 2 commits into from
May 9, 2024

Conversation

karenc-bq
Copy link
Contributor

Description

The driver was incorrectly truncating nested connection options when parsing connection urls.
Connecting with a string similar to ?options=-c%20search_path=test,public,pg_catalog%20-c%20statement_timeout=90000 would result in unexpected errors:

Exception in thread "main" org.postgresql.util.PSQLException: FATAL: -c search_path requires a value

This PR updates the parsing logic to properly handle nested options.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@karenc-bq karenc-bq marked this pull request as ready for review May 8, 2024 19:15
@karenc-bq karenc-bq added the ready for review Pull requests that are ready to be reviewed label May 8, 2024
Copy link

github-actions bot commented May 8, 2024

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

  1. Register at Qodana Cloud and configure the action
  2. Use GitHub Code Scanning with Qodana
  3. Host Qodana report at GitHub Pages
  4. Inspect and use qodana.sarif.json (see the Qodana SARIF format for details)

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2023.3.1
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@karenc-bq karenc-bq force-pushed the fix/parse-nested-options branch from cda77c8 to 82ca861 Compare May 8, 2024 20:06
@sergiyvamz
Copy link
Contributor

I'd expect such parameter value to be encoded:

?options=-c%20search_path%3Dtest%2Cpublic%2Cpg_catalog%20-c%20statement_timeout%3D90000

@karenc-bq karenc-bq merged commit e62061d into main May 9, 2024
10 checks passed
@karenc-bq karenc-bq deleted the fix/parse-nested-options branch May 9, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Pull requests that are ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants