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()) {