From 915e72ee60bb0c72fa4879261fa189b28978ba39 Mon Sep 17 00:00:00 2001 From: wangweicugw Date: Thu, 27 Jul 2023 18:27:44 +0800 Subject: [PATCH] Optimizing streaming query performance. --- src/main/java/com/jd/jdbc/engine/RouteStream.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/jd/jdbc/engine/RouteStream.java b/src/main/java/com/jd/jdbc/engine/RouteStream.java index 5589a55..536c357 100644 --- a/src/main/java/com/jd/jdbc/engine/RouteStream.java +++ b/src/main/java/com/jd/jdbc/engine/RouteStream.java @@ -143,9 +143,11 @@ private VtRowList fetchOrdered(boolean wantFields) throws SQLException { } VtResultSet vtResultSet = new VtResultSet(); - if (wantFields && vtResultSet.getFields() == null) { + if (wantFields && fields == null) { vtResultSet.appendResult(this.routeEngine.getFields(vcursor, bindVariableMap)); fields = vtResultSet.getFields(); + } else if (wantFields) { + vtResultSet.setFields(fields); } if (sortedValues.isEmpty()) {