From e827f5d458969579d4d41ecdc8dfc17ca9bde7d0 Mon Sep 17 00:00:00 2001 From: wangweicugw <38103831+wangweicugw@users.noreply.github.com> Date: Thu, 24 Aug 2023 16:59:36 +0800 Subject: [PATCH] Optimizing streaming query performance. (#133) --- 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()) {