You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2021/08/05 09:57:50 UTC

[iotdb] branch issue-3690-0.12 created (now 4b78fd4)

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

rong pushed a change to branch issue-3690-0.12
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at 4b78fd4  [ISSUE-3690] Memory leaks on the server when cpp client invokes checkTimeseriesExists

This branch includes the following new commits:

     new 4b78fd4  [ISSUE-3690] Memory leaks on the server when cpp client invokes checkTimeseriesExists

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: [ISSUE-3690] Memory leaks on the server when cpp client invokes checkTimeseriesExists

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

rong pushed a commit to branch issue-3690-0.12
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 4b78fd4eefe3e1a44ab2780f7debec08fd39ca77
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Thu Aug 5 17:57:15 2021 +0800

    [ISSUE-3690] Memory leaks on the server when cpp client invokes checkTimeseriesExists
---
 client-cpp/src/main/Session.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/client-cpp/src/main/Session.cpp b/client-cpp/src/main/Session.cpp
index 3d48aaa..1b1e095 100644
--- a/client-cpp/src/main/Session.cpp
+++ b/client-cpp/src/main/Session.cpp
@@ -1020,8 +1020,10 @@ void Session::createMultiTimeseries(vector <string> paths, vector <TSDataType::T
 
 bool Session::checkTimeseriesExists(string path) {
     try {
-        string sql = "SHOW TIMESERIES " + path;
-        return executeQueryStatement(sql)->hasNext();
+        std::unique_ptr <SessionDataSet> dataset = executeQueryStatement("SHOW TIMESERIES " + path);
+        bool isExisted = dataset->hasNext();
+        dataset->closeOperationHandle();
+        return isExisted;
     }
     catch (exception e) {
         throw IoTDBConnectionException(e.what());