zhztheplayer commented on a change in pull request #1132: [CALCITE-2955] SQL 
queries after first query in same statement have no results returned
URL: https://github.com/apache/calcite/pull/1132#discussion_r288011463
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
 ##########
 @@ -608,6 +608,10 @@ public MetaResultSet getTableTypes(ConnectionHandle ch) {
             new ArrayList<List<Object>>());
     boolean done = fetchMaxRowCount == 0 || rows.size() < fetchMaxRowCount;
     @SuppressWarnings("unchecked") List<Object> rows1 = (List<Object>) rows;
+    if (done) {
 
 Review comment:
   The logic looks still vulnerable. If the first iterator is not "done", then 
we execute second query the result will be wrong. I think the correct fix 
should relate to the CLOSE phase of ResultSet instances in client side, but I 
tested against calling `resultSet.close()` before executing the second query 
and nothing happened. Maybe something was wrong there.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to