Skip to content

Commit

Permalink
Fix worker connection leak in JDBC connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Parker authored and electrum committed Jan 24, 2017
1 parent bdc508e commit 5289297
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -258,12 +258,12 @@ public Connection getConnection(JdbcSplit split)
}

@Override
public PreparedStatement buildSql(JdbcSplit split, List<JdbcColumnHandle> columnHandles)
public PreparedStatement buildSql(Connection connection, JdbcSplit split, List<JdbcColumnHandle> columnHandles)
throws SQLException
{
return new QueryBuilder(identifierQuote).buildSql(
this,
getConnection(split),
connection,
split.getCatalogName(),
split.getSchemaName(),
split.getTableName(),
Expand Down
Expand Up @@ -41,7 +41,7 @@ public interface JdbcClient
Connection getConnection(JdbcSplit split)
throws SQLException;

PreparedStatement buildSql(JdbcSplit split, List<JdbcColumnHandle> columnHandles)
PreparedStatement buildSql(Connection connection, JdbcSplit split, List<JdbcColumnHandle> columnHandles)
throws SQLException;

JdbcOutputTableHandle beginCreateTable(ConnectorTableMetadata tableMetadata);
Expand Down
Expand Up @@ -73,7 +73,7 @@ public JdbcRecordCursor(JdbcClient jdbcClient, JdbcSplit split, List<JdbcColumnH

try {
connection = jdbcClient.getConnection(split);
statement = jdbcClient.buildSql(split, columnHandles);
statement = jdbcClient.buildSql(connection, split, columnHandles);
log.debug("Executing: %s", statement.toString());
resultSet = statement.executeQuery();
}
Expand Down

0 comments on commit 5289297

Please sign in to comment.