aws / aws/amazon-redshift-jdbc-driver
Problem in Driver class when performing the lookup for JDBC ini file in Windows environments
- Dominant language
- Java
- Stars
- 71
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
## 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:\\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
Contributor guide
Research direction
Start in src/main/java/com/amazon/redshift/Driver.java around lines 917-920 and inspect the lookup path handling that fails for a Windows JAR location. Reproduce loading the Driver from a Windows-style path and verify it no longer raises StringIndexOutOfBoundsException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100