Skip to content

Commit

Permalink
Fix wrong PreparedStatement cache invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael-telles committed Oct 12, 2021
1 parent a360784 commit fd9a492
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,8 @@ private static VectorSchemaRoot getSqlInfoRoot(final DatabaseMetaData metaData,
@Override
public void getStreamPreparedStatement(final CommandPreparedStatementQuery command, final CallContext context,
final Ticket ticket, final ServerStreamListener listener) {
StatementContext<PreparedStatement> statementContext =
preparedStatementLoadingCache.getIfPresent(command.getPreparedStatementHandle());
ByteString handle = command.getPreparedStatementHandle();
StatementContext<PreparedStatement> statementContext = preparedStatementLoadingCache.getIfPresent(handle);
assert statementContext != null;
try (PreparedStatement statement = statementContext.getStatement();
ResultSet resultSet = statement.executeQuery()) {
Expand All @@ -635,7 +635,7 @@ public void getStreamPreparedStatement(final CommandPreparedStatementQuery comma
listener.error(e);
} finally {
listener.completed();
commandExecutePreparedStatementLoadingCache.invalidate(command);
commandExecutePreparedStatementLoadingCache.invalidate(handle);
}
}

Expand Down

0 comments on commit fd9a492

Please sign in to comment.