Skip to content

Commit

Permalink
Release 2.1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
iggarish committed Sep 4, 2021
1 parent d10463c commit 7ff7414
Show file tree
Hide file tree
Showing 36 changed files with 486 additions and 2,660 deletions.
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
Changelog
=========

v2.1.0.1 (2021-09-04)
---------------------
- Fix stack overflow for "unknown" type. [ilesh Garish]
- Fix SQLWorkbench issue for underscore in database name. [ilesh Garish]
- Support VARBYTE data type. [ilesh Garish]
- Use derived user from JWT as role session name for JWT SSO. [ilesh Garish]
- Fix Varying length precision and scale for numeric types. [ilesh
Garish]
- Fix getColumns exception in federated query due to missing varchar
length. [ilesh Garish]
- Fix for AuthProfile with IDP parameters. [ilesh Garish]


v2.0.0.7 (2021-07-23)
------------
---------------------
- Support nonProxyHosts system property for STS and Redshift coral service. [ilesh Garish]
- Support of reading connection properties using an authentication profile. [ilesh Garish]
- Fix nano second issue with Timestamp to string conversion. [ilesh Garish]
- Fix [issue#26](https://github.com/aws/amazon-redshift-jdbc-driver/issues/26). [ilesh Garish]
- Return current database instead of NULL for getSchemas() API. [ilesh Garish]

v2.0.0.6 (2021-06-29)
------------
---------------------
- Fix [issue#27](https://github.com/aws/amazon-redshift-jdbc-driver/issues/27). [ilesh Garish]
- Add support for Profile process credentials. [Laurent Goujon]
- Bump httpclient from 4.5.2 to 4.5.13. [dependabot[bot]]
Expand Down
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.0.0.7</version>
<version>2.1.0.1</version>

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

Expand Down
8 changes: 0 additions & 8 deletions src/main/java/com/amazon/redshift/RedshiftProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ public enum RedshiftProperty {
"DisableIsValidQuery",
"false",
"Disable isValid query"),

/**
* The Redshift fetch rows using both a ring buffer and a processing buffer on separate threads.
*
*/
ENABLE_FETCH_READ_AND_PROCESS_BUFFERS("enableFetchReadAndProcessBuffers",
"true",
"The Redshift fetch rows using both a ring buffer and a processing buffer on separate threads"),

/**
* The Redshift fetch rows using a ring buffer on a separate thread.
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/com/amazon/redshift/core/BaseConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,6 @@ ResultSet execSQLQuery(String s, int resultSetType, int resultSetConcurrency)
*/
Object getObject(String type, String value, byte[] byteValue) throws SQLException;

/**
* <p>Construct and return an appropriate object for the given type and value. This only considers
* the types registered via {@link com.amazon.redshift.RedshiftConnection#addDataType(String, Class)} and
* {@link com.amazon.redshift.RedshiftConnection#addDataType(String, String)}.</p>
*
* <p>If no class is registered as handling the given type, then a generic
* {@link com.amazon.redshift.util.RedshiftObject} instance is returned.</p>
*
* @param type the backend typename
* @param value the type-specific string representation of the value
* @param bbs the Byte Buffer Subsequence pointing to the type-specific binary representation of the value
* @return an appropriate object; never null.
* @throws SQLException if something goes wrong
*/
Object getObject(String type, String value, ByteBufferSubsequence bbs) throws SQLException;

Encoding getEncoding() throws SQLException;

TypeInfo getTypeInfo();
Expand Down
15 changes: 5 additions & 10 deletions src/main/java/com/amazon/redshift/core/BaseStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@

import com.amazon.redshift.RedshiftStatement;
import com.amazon.redshift.core.v3.MessageLoopState;
import com.amazon.redshift.core.v3.RedshiftByteBufferBlockingQueue;
import com.amazon.redshift.core.v3.RedshiftRowsBlockingQueue;

import java.nio.ByteBuffer;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;

/**
* Driver-internal statement interface. Application code should not use this interface.
Expand Down Expand Up @@ -51,21 +48,19 @@ public interface BaseStatement extends RedshiftStatement, Statement {
* @param originalQuery the query that generated this resultset; used when dealing with updateable
* resultsets
* @param fields the column metadata for the resultset
* @param tuples the offsets to the resultset data
* @param tuples the resultset data
* @param cursor the cursor to use to retrieve more data from the server; if null, no additional
* data is present.
* @param queueTuples the offsets to the actual data in a blocking queue. If this is set then tuples will be null.
* @param queuePages the pages in memory that are available to be read from
* @param queueTuples the actual data in a blocking queue. If this is set then tuples will be null.
* @param rowCount number of rows fetched from the socket.
* @param ringBufferThread a thread to fetch data in the buffer.
* @param processBufferThread a thread to process data from the buffer
* @param ringBufferThread a thread to fetch rows in the limited rows buffer.
*
* @return the new ResultSet
* @throws SQLException if something goes wrong
*/
ResultSet createResultSet(Query originalQuery, Field[] fields, List<Tuple> tuples,
ResultCursor cursor, RedshiftRowsBlockingQueue<Tuple> queueTuples, RedshiftByteBufferBlockingQueue<ByteBuffer> queuePages,
int[] rowCount, Thread ringBufferThread, Thread processBufferThread) throws SQLException;
ResultCursor cursor, RedshiftRowsBlockingQueue<Tuple> queueTuples,
int[] rowCount, Thread ringBufferThread) throws SQLException;

/**
* Execute a query, passing additional query flags.
Expand Down
26 changes: 0 additions & 26 deletions src/main/java/com/amazon/redshift/core/ByteBufferSubsequence.java

This file was deleted.

26 changes: 0 additions & 26 deletions src/main/java/com/amazon/redshift/core/Encoding.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.nio.charset.Charset;
import java.util.HashMap;

import com.amazon.redshift.core.ByteBufferSubsequence;
import com.amazon.redshift.logger.LogLevel;
import com.amazon.redshift.logger.RedshiftLogger;

Expand Down Expand Up @@ -261,31 +260,6 @@ public String decode(byte[] encodedString) throws IOException {
return decode(encodedString, 0, encodedString.length);
}

/**
* Decode an array of bytes into a string.
*
* @param bbs the Byte Buffer Subsequence pointing to a byte array containing the string to decode
* @param offset the offset in <code>bbs</code> of the first byte of the encoded
* representation
* @param length the length, in bytes, of the encoded representation
* @return the decoded string
* @throws IOException if something goes wrong
*/
public String decode(ByteBufferSubsequence bbs, int offset, int length) throws IOException {
return new String(bbs.page, bbs.index+offset, length, encoding);
}

/**
* Decode an array of bytes into a string.
*
* @param bbs the Byte Buffer Subsequence pointing to a byte array containing the string to decode
* @return the decoded string
* @throws IOException if something goes wrong
*/
public String decode(ByteBufferSubsequence bbs) throws IOException {
return decode(bbs, 0, bbs.length);
}

/**
* Get a Reader that decodes the given InputStream using this encoding.
*
Expand Down
19 changes: 8 additions & 11 deletions src/main/java/com/amazon/redshift/core/QueryExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import com.amazon.redshift.RedshiftNotification;
import com.amazon.redshift.copy.CopyOperation;
import com.amazon.redshift.core.v3.RedshiftByteBufferBlockingQueue;
import com.amazon.redshift.core.v3.RedshiftRowsBlockingQueue;
import com.amazon.redshift.core.v3.TypeTransferModeRegistry;
import com.amazon.redshift.jdbc.AutoSave;
Expand All @@ -18,7 +17,6 @@
import com.amazon.redshift.util.HostSpec;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.util.List;
Expand Down Expand Up @@ -495,20 +493,19 @@ Object createQueryKey(String sql, boolean escapeProcessing, boolean isParameteri
String getParameterStatus(String parameterName);

/**
* Close the last active buffer threads.
* @param queueRows the blocking queue rows
* @param queuePages the blocking queue pages
* @param ringBufferThread the thread fetching rows in the buffer.
* @param processBufferThread the thread processing rows in the blocking queue.
* Close the last active ring buffer thread.
*
* @param queueRows the blocking queue rows
* @param ringBufferThread the thread fetching rows in the blocking queue.
*/
void closeResultBufferThreads(RedshiftRowsBlockingQueue<Tuple> queueRows, RedshiftByteBufferBlockingQueue<ByteBuffer> queuePages, Thread ringBufferThread, Thread processBufferThread);
void closeRingBufferThread(RedshiftRowsBlockingQueue<Tuple> queueRows, Thread ringBufferThread);

/**
* Check for a running buffer threads.
* Check for a running ring buffer thread.
*
* @return returns true if any buffer threads are running, otherwise false.
* @return returns true if Ring buffer thread is running, otherwise false.
*/
boolean areResultBufferThreadsRunning();
boolean isRingBufferThreadRunning();

/**
* Close the statement and portal when statement get closed.
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/com/amazon/redshift/core/QueryExecutorBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import com.amazon.redshift.RedshiftNotification;
import com.amazon.redshift.RedshiftProperty;
import com.amazon.redshift.core.v3.RedshiftByteBufferBlockingQueue;
import com.amazon.redshift.core.v3.RedshiftRowsBlockingQueue;
import com.amazon.redshift.jdbc.AutoSave;
import com.amazon.redshift.jdbc.EscapeSyntaxCallMode;
Expand All @@ -21,7 +20,6 @@
import com.amazon.redshift.util.ServerErrorMessage;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.util.ArrayList;
Expand All @@ -32,7 +30,6 @@

public abstract class QueryExecutorBase implements QueryExecutor {

private Properties info;
protected RedshiftLogger logger;
protected final RedshiftStream pgStream;
private final String user;
Expand Down Expand Up @@ -75,7 +72,6 @@ public abstract class QueryExecutorBase implements QueryExecutor {
protected QueryExecutorBase(RedshiftStream pgStream, String user,
String database, int cancelSignalTimeout, Properties info,
RedshiftLogger logger) throws SQLException {
this.info = info;
this.logger = logger;
this.pgStream = pgStream;
this.user = user;
Expand Down Expand Up @@ -522,20 +518,20 @@ protected void onParameterStatus(String parameterName, String parameterStatus) {
}

/**
* Close the last active buffer threads.
* Close the last active ring buffer thread.
*/
@Override
public void closeResultBufferThreads(RedshiftRowsBlockingQueue<Tuple> queueRows, RedshiftByteBufferBlockingQueue<ByteBuffer> queuePages, Thread ringBufferThread, Thread processBufferThread) {
public void closeRingBufferThread(RedshiftRowsBlockingQueue<Tuple> queueRows, Thread ringBufferThread) {
// Does nothing
}

/**
* Check for a running buffer thread.
* Check for a running ring buffer thread.
*
* @return returns true if a buffer thread is running, otherwise false.
* @return returns true if Ring buffer thread is running, otherwise false.
*/
@Override
public boolean areResultBufferThreadsRunning() {
public boolean isRingBufferThreadRunning() {
return false;
}

Expand Down
10 changes: 2 additions & 8 deletions src/main/java/com/amazon/redshift/core/RedshiftStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ public class RedshiftStream implements Closeable, Flushable {
private long resultBufferByteCount = 0;
private RedshiftLogger logger;

private int bufferSize = 8192;

/**
* Constructor: Connect to the Redshift back end and return a stream connection.
*
Expand Down Expand Up @@ -194,8 +192,8 @@ public void changeSocket(Socket socket) throws IOException {
connection.setTcpNoDelay(true);

// Buffer sizes submitted by Sverre H Huseby <[email protected]>
pgInput = new VisibleBufferedInputStream(connection.getInputStream(), bufferSize);
pgOutput = new BufferedOutputStream(connection.getOutputStream(), bufferSize);
pgInput = new VisibleBufferedInputStream(connection.getInputStream(), 8192);
pgOutput = new BufferedOutputStream(connection.getOutputStream(), 8192);

if (encoding != null) {
setEncoding(encoding);
Expand Down Expand Up @@ -690,8 +688,4 @@ private void increaseByteCounter(long value) throws SQLException {
public boolean isClosed() {
return connection.isClosed();
}

public int getBufferSize() {
return bufferSize;
}
}
12 changes: 4 additions & 8 deletions src/main/java/com/amazon/redshift/core/ResultHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

package com.amazon.redshift.core;

import java.nio.ByteBuffer;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.util.List;

import com.amazon.redshift.core.v3.MessageLoopState;
import com.amazon.redshift.core.v3.RedshiftByteBufferBlockingQueue;
import com.amazon.redshift.core.v3.RedshiftRowsBlockingQueue;

/**
Expand All @@ -38,16 +36,14 @@ public interface ResultHandler {
* specific (e.g. it may be a query that includes multiple statements).
* @param fields column metadata for the resultset; might be <code>null</code> if
* Query.QUERY_NO_METADATA was specified.
* @param tuples the offset to the actual data. If this is set then queueTuples will be null.
* @param tuples the actual data. If this is set then queueTuples will be null.
* @param cursor a cursor to use to fetch additional data; <code>null</code> if no further results
* are present.
* @param queueTuples the offset to the actual data in a blocking queue. If this is set then tuples will be null.
* @param queuePages the pages in memory that are available to be read from
* @param queueTuples the actual data in a blocking queue. If this is set then tuples will be null.
* @param rowCount number of rows fetched from the socket.
* @param ringBufferThread a thread to fetch data in the buffer.
* @param processBufferThread a thread to process data in the buffer
* @param ringBufferThread a thread to fetch rows in the limited rows buffer.
*/
void handleResultRows(Query fromQuery, Field[] fields, List<Tuple> tuples, ResultCursor cursor, RedshiftRowsBlockingQueue<Tuple> queueTuples, RedshiftByteBufferBlockingQueue<ByteBuffer> queuePages, int[] rowCount, Thread ringBufferThread, Thread processBufferThread);
void handleResultRows(Query fromQuery, Field[] fields, List<Tuple> tuples, ResultCursor cursor, RedshiftRowsBlockingQueue<Tuple> queueTuples, int[] rowCount, Thread ringBufferThread);

/**
* Called when a query that did not return a resultset completes.
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/amazon/redshift/core/ResultHandlerBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

package com.amazon.redshift.core;

import java.nio.ByteBuffer;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.util.List;

import com.amazon.redshift.core.v3.MessageLoopState;
import com.amazon.redshift.core.v3.RedshiftByteBufferBlockingQueue;
import com.amazon.redshift.core.v3.RedshiftRowsBlockingQueue;

/**
Expand All @@ -31,8 +29,8 @@ public class ResultHandlerBase implements ResultHandler {

@Override
public void handleResultRows(Query fromQuery, Field[] fields, List<Tuple> tuples,
ResultCursor cursor, RedshiftRowsBlockingQueue<Tuple> queueTuples, RedshiftByteBufferBlockingQueue<ByteBuffer> queuePages,
int[] rowCount, Thread ringBufferThread, Thread processBufferThread) {
ResultCursor cursor, RedshiftRowsBlockingQueue<Tuple> queueTuples,
int[] rowCount, Thread ringBufferThread) {
}

@Override
Expand Down
Loading

0 comments on commit 7ff7414

Please sign in to comment.