From 80b97ac24dde0fe2ca1ff2d3a3156182b30de451 Mon Sep 17 00:00:00 2001 From: Paul Rogers Date: Mon, 12 Sep 2022 19:27:56 +0200 Subject: [PATCH] Create a copy of the shared JDBC context (#13049) --- .../java/org/apache/druid/sql/avatica/DruidConnection.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java b/sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java index addebc2f2da..a792e28b3a8 100644 --- a/sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java +++ b/sql/src/main/java/org/apache/druid/sql/avatica/DruidConnection.java @@ -97,7 +97,7 @@ public class DruidConnection final DruidJdbcStatement statement = new DruidJdbcStatement( connectionId, statementId, - context, + context.copy(), sqlStatementFactory ); @@ -109,7 +109,7 @@ public class DruidConnection public DruidJdbcPreparedStatement createPreparedStatement( SqlStatementFactory sqlStatementFactory, - SqlQueryPlus sqlRequest, + SqlQueryPlus sqlQueryPlus, final long maxRowCount) { final int statementId = statementCounter.incrementAndGet(); @@ -127,7 +127,7 @@ public class DruidConnection @SuppressWarnings("GuardedBy") final PreparedStatement statement = sqlStatementFactory.preparedStatement( - sqlRequest.withContext(context) + sqlQueryPlus.withContext(context.copy()) ); final DruidJdbcPreparedStatement jdbcStmt = new DruidJdbcPreparedStatement( connectionId,