From 28eb7627fdaa15b4bf1126913db2b4c9bf7d6788 Mon Sep 17 00:00:00 2001 From: wlx5575 Date: Fri, 26 Aug 2022 15:59:04 +0800 Subject: [PATCH] fix subquery and quer with limit --- .../java/com/jd/jdbc/engine/PulloutSubqueryEngine.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/jd/jdbc/engine/PulloutSubqueryEngine.java b/src/main/java/com/jd/jdbc/engine/PulloutSubqueryEngine.java index 214294f..f809cfa 100644 --- a/src/main/java/com/jd/jdbc/engine/PulloutSubqueryEngine.java +++ b/src/main/java/com/jd/jdbc/engine/PulloutSubqueryEngine.java @@ -84,7 +84,12 @@ public IExecute.ExecuteMultiShardResponse execute(IContext ctx, Vcursor vcursor, * @return */ private BindVarsResponse execSubqery(IContext ctx, Vcursor vcursor, Map bindVariableMap, boolean wantFields) throws SQLException { - IExecute.ExecuteMultiShardResponse subResultSet = this.subquery.execute(ctx, vcursor, bindVariableMap, wantFields); + + Map subBindVarMap = bindVariableMap; + if (bindVariableMap != null) { + subBindVarMap = new HashMap<>(bindVariableMap); + } + IExecute.ExecuteMultiShardResponse subResultSet = this.subquery.execute(ctx, vcursor, subBindVarMap, wantFields); if (subResultSet.getVtRowList() == null) { throw new SQLException("VtRowList is null"); }