You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by hy...@apache.org on 2020/04/14 13:42:26 UTC

[calcite] branch master updated: [CALCITE-3324] Set updateCount when creating MetaResultSet (Robert Yokota)

This is an automated email from the ASF dual-hosted git repository.

hyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/master by this push:
     new f1857aa  [CALCITE-3324] Set updateCount when creating MetaResultSet (Robert Yokota)
f1857aa is described below

commit f1857aa305c99dca40ee3c940ee689d77f27eaee
Author: Robert Yokota <ra...@gmail.com>
AuthorDate: Wed Sep 4 15:43:19 2019 -0700

    [CALCITE-3324] Set updateCount when creating MetaResultSet (Robert Yokota)
    
    Close #1441
---
 core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
index 95d1502..c1fb22b 100644
--- a/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
+++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java
@@ -540,6 +540,7 @@ public class CalciteMetaImpl extends MetaImpl {
       PrepareCallback callback) throws NoSuchStatementException {
     final CalcitePrepare.CalciteSignature<Object> signature;
     try {
+      final int updateCount;
       synchronized (callback.getMonitor()) {
         callback.clear();
         final CalciteConnectionImpl calciteConnection = getConnection();
@@ -549,7 +550,6 @@ public class CalciteMetaImpl extends MetaImpl {
         final CalcitePrepare.Query<Object> query = toQuery(context, sql);
         signature = calciteConnection.parseQuery(query, context, maxRowCount);
         statement.setSignature(signature);
-        final int updateCount;
         switch (signature.statementType) {
         case CREATE:
         case DROP:
@@ -565,7 +565,7 @@ public class CalciteMetaImpl extends MetaImpl {
       }
       callback.execute();
       final MetaResultSet metaResultSet =
-          MetaResultSet.create(h.connectionId, h.id, false, signature, null);
+          MetaResultSet.create(h.connectionId, h.id, false, signature, null, updateCount);
       return new ExecuteResult(ImmutableList.of(metaResultSet));
     } catch (SQLException e) {
       throw new RuntimeException(e);