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

Problem in Driver class when performing the lookup for JDBC ini file in Windows environments #78

Open
maxrabbi opened this issue Jan 13, 2023 · 2 comments

Comments

@maxrabbi
Copy link

Driver version

2.1.0.10

Redshift version

PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.44903

Client Operating System

Windows 10

JAVA/JVM version

Temurin-11.0.17+8

Table schema

N/A

Problem description

The problem is caused by the line 920 of the Driver class (https://github.com/aws/amazon-redshift-jdbc-driver/blob/v2.1.0.10/src/main/java/com/amazon/redshift/Driver.java).
When the Driver class is loaded from a path location Windows like (i.e C:<my_folder>\redshift-jdbc42-2.1.0.10.jar), line 917, the next 920 fails to properly perform the substring operation since there is not / character.
This leads to a java.lang.StringIndexOutOfBoundsException exception.

JDBC trace logs

N/A

Reproduction code

N/A

@Brooke-white
Copy link
Contributor

Hi @maxrabbi, thanks for reaching out to us about this issue. it sounds like we need to look into modifying this line 920 to use an approach compatible with both windows and *nix platforms. mentioned line

You're more than welcome to open a PR with the fix for this since you've identified the issue, otherwise a member of our driver team can work to implement the fix. Just let us know your preference :) cc: @bhvkshah

@maxrabbi
Copy link
Author

Hi sorry for the late reply. I think it's probably better you work on that. I'm not sure I will be able to look at the PR process and submit it earlier than next mid-week.
Regards,
Massimo.

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

No branches or pull requests

2 participants