You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xu...@apache.org on 2022/01/17 12:40:44 UTC

[iotdb] branch fix_jdbc_bug_xkf created (now e7252bc)

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

xuekaifeng pushed a change to branch fix_jdbc_bug_xkf
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at e7252bc  fix bug and add test

This branch includes the following new commits:

     new e7252bc  fix bug and add test

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[iotdb] 01/01: fix bug and add test

Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xuekaifeng pushed a commit to branch fix_jdbc_bug_xkf
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit e7252bca21824454c6f62f125c2bff5ef263d137
Author: 151250176 <15...@smail.nju.edu.cn>
AuthorDate: Mon Jan 17 20:21:56 2022 +0800

    fix bug and add test
---
 jdbc/src/main/java/org/apache/iotdb/jdbc/Utils.java    |  2 +-
 .../src/test/java/org/apache/iotdb/jdbc/UtilsTest.java | 18 ++++++++++++------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/jdbc/src/main/java/org/apache/iotdb/jdbc/Utils.java b/jdbc/src/main/java/org/apache/iotdb/jdbc/Utils.java
index 2a965b8..17c30a1 100644
--- a/jdbc/src/main/java/org/apache/iotdb/jdbc/Utils.java
+++ b/jdbc/src/main/java/org/apache/iotdb/jdbc/Utils.java
@@ -102,7 +102,7 @@ public class Utils {
       switch (key) {
         case RPC_COMPRESS:
           if ("true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value)) {
-            Config.rpcThriftCompressionEnable = Boolean.getBoolean(value);
+            Config.rpcThriftCompressionEnable = Boolean.parseBoolean(value);
           } else {
             return false;
           }
diff --git a/jdbc/src/test/java/org/apache/iotdb/jdbc/UtilsTest.java b/jdbc/src/test/java/org/apache/iotdb/jdbc/UtilsTest.java
index 82d1e5a..3c888ca 100644
--- a/jdbc/src/test/java/org/apache/iotdb/jdbc/UtilsTest.java
+++ b/jdbc/src/test/java/org/apache/iotdb/jdbc/UtilsTest.java
@@ -18,19 +18,18 @@
  */
 package org.apache.iotdb.jdbc;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.Properties;
 import org.apache.iotdb.rpc.RpcUtils;
 import org.apache.iotdb.rpc.TSStatusCode;
 import org.apache.iotdb.service.rpc.thrift.TSStatus;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.util.Properties;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
 public class UtilsTest {
 
   @Before
@@ -125,4 +124,11 @@ public class UtilsTest {
     }
     fail();
   }
+
+  @Test
+  public void testRpcCompress() throws IoTDBURLException {
+    Properties properties = new Properties();
+    Utils.parseUrl("jdbc:iotdb://127.0.0.1:6667?rpc_compress=true", properties);
+    assertTrue(Config.rpcThriftCompressionEnable);
+  }
 }