Skip to content

Commit

Permalink
Release 2.1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
iggarish committed Apr 14, 2022
1 parent e0b86f3 commit 4ab5d75
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 14 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
Changelog
=========

v2.1.0.6 (2022-04-14)
---------------------
- Preserve server error in case of SSL Request's response
- Remove IAM Role check for V2 API as CDO team requested
- Get the caller application class name to use as application_name

v2.1.0.5 (2022-03-11)
------------
---------------------
- Fix INTERVAL type value issue in BINARY from date calculation. [ilesh
Garish]
- Fix [issue#45](https://github.com/aws/amazon-redshift-jdbc-driver/issues/45) [ilesh Garish]
- Fix external table's columns query. [ilesh Garish]

v2.1.0.4 (2022-01-30)
------------
---------------------
- Support GEOGRAPHY data type. [ilesh Garish]
- Fix [issue#39](https://github.com/aws/amazon-redshift-jdbc-driver/issues/39) [ilesh Garish]
- Support Native Auth with Browser Azure IDP
Expand Down
Binary file modified lib/aws-java-sdk-redshift-arcadia-internal-1.0.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>redshift-jdbc42</artifactId>
<packaging>bundle</packaging>
<name>Redshift JDBC Driver - JDBC 4.2</name>
<version>2.1.0.5</version>
<version>2.1.0.6</version>

<description>Java JDBC 4.2 (JRE 8+) driver for Redshift database</description>

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/amazon/redshift/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ public Connection connect(String url, Properties info) throws SQLException {
connLogger = getLogger(props);

if(RedshiftLogger.isEnable()) {
StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();

String temp = RedshiftLogger.maskSecureInfoInUrl(url);
logger.log(LogLevel.DEBUG, "===================================");
logger.log(LogLevel.DEBUG, "Connecting with URL: {0}", temp);
Expand All @@ -281,6 +283,11 @@ public Connection connect(String url, Properties info) throws SQLException {
// connLogger.log(LogLevel.DEBUG, "After merging JDBC INI FileName props:" + props);
}

connLogger.log(LogLevel.DEBUG, "Caller stack[{0}]: {1}",
Thread.currentThread().getName(),
stacktrace[stacktrace.length-1].toString());


/* String useProxyStr = System.getProperty("http.useProxy");
String proxyHost = System.getProperty("https.proxyHost");
String proxyPort = System.getProperty("https.proxyPort");
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/com/amazon/redshift/core/IamHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -897,10 +897,13 @@ private static int findTypeOfGetClusterCredentialsAPI(RedshiftJDBCSettings setti
if (!settings.m_groupFederation)
return GET_CLUSTER_CREDENTIALS_V1_API;
else {
if (providerType == CredentialProviderType.PROFILE) {
/* if (providerType == CredentialProviderType.PROFILE) {
// profile may have role based and it's not supported in V2 API
throw new AmazonClientException("Authentication with profile is not supported for group federation");
} else if (providerType != CredentialProviderType.PLUGIN)
}
else
*/
if (providerType != CredentialProviderType.PLUGIN)
return GET_CLUSTER_CREDENTIALS_IAM_V2_API;
else {
throw new AmazonClientException("Authentication with plugin is not supported for group federation");
Expand All @@ -919,10 +922,12 @@ private static int findTypeOfGetClusterCredentialsAPI(RedshiftJDBCSettings setti
if (!settings.m_groupFederation)
return GET_SERVERLESS_CREDENTIALS_V1_API;
else {
if (providerType == CredentialProviderType.PROFILE) {
/* if (providerType == CredentialProviderType.PROFILE) {
// profile may have role based and it's not supported in V2 API
throw new AmazonClientException("Authentication with profile is not supported for group federation");
} else if (providerType != CredentialProviderType.PLUGIN)
} else
*/
if (providerType != CredentialProviderType.PLUGIN)
return GET_CLUSTER_CREDENTIALS_IAM_V2_API; // Fallback to Provision
// API support in
// serverless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,23 @@ private List<String[]> getParametersForStartup(String user, String database, Pro
if (assumeVersion.getVersionNum() >= ServerVersion.v9_0.getVersionNum()) {
// User is explicitly telling us this is a 9.0+ server so set properties here:
paramList.add(new String[]{"extra_float_digits", "3"});
String appName = RedshiftProperty.APPLICATION_NAME.get(info);
if (appName != null) {
paramList.add(new String[]{"application_name", appName});
}
} else {
// User has not explicitly told us that this is a 9.0+ server so stick to old default:
paramList.add(new String[]{"extra_float_digits", "2"});
}

String appName = RedshiftProperty.APPLICATION_NAME.get(info);
if(appName == null)
{
StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
appName = "[" + Thread.currentThread().getName() + "]"
+ stacktrace[stacktrace.length-1].toString();
}

if (appName != null) {
paramList.add(new String[]{"application_name", appName});
}

if(driverOsVersionParams) {
String driver_version = DriverInfo.DRIVER_FULL_NAME;
paramList.add(new String[]{"driver_version",driver_version});
Expand Down Expand Up @@ -496,11 +504,24 @@ private RedshiftStream enableSSL(RedshiftStream pgStream, SslMode sslMode, Prope
case 'E':
if(RedshiftLogger.isEnable())
logger.log(LogLevel.DEBUG, " <=BE SSLError");


// An error occurred, so pass the error message to the
// user.
//
int elen = pgStream.receiveInteger4();

ServerErrorMessage errorMsg =
new ServerErrorMessage(pgStream.receiveErrorString(elen - 4));

if(RedshiftLogger.isEnable())
logger.log(LogLevel.DEBUG, " <=BE ErrorMessage({0})", errorMsg);

// Server doesn't even know about the SSL handshake protocol
if (sslMode.requireEncryption()) {
throw new RedshiftException(GT.tr("The server does not support SSL."),
RedshiftState.CONNECTION_REJECTED);
throw new RedshiftException(errorMsg, RedshiftProperty.LOG_SERVER_ERROR_DETAIL.getBoolean(info));

// throw new RedshiftException(GT.tr("The server does not support SSL."),
// RedshiftState.CONNECTION_REJECTED);
}

// We have to reconnect to continue.
Expand Down

0 comments on commit 4ab5d75

Please sign in to comment.