You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by su...@apache.org on 2020/02/26 10:40:16 UTC

[incubator-iotdb] branch jira_444 created (now 95c7a56)

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

sunzesong pushed a change to branch jira_444
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at 95c7a56  Fix bug

This branch includes the following new commits:

     new 95c7a56  Fix bug

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.



[incubator-iotdb] 01/01: Fix bug

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

sunzesong pushed a commit to branch jira_444
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 95c7a56d852ec10285e34825ae46c573d567dffd
Author: samperson1997 <sz...@mails.tsinghua.edu.cn>
AuthorDate: Wed Feb 26 18:39:53 2020 +0800

    Fix bug
---
 server/src/main/java/org/apache/iotdb/db/metadata/MTree.java      | 4 ++--
 .../test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/MTree.java b/server/src/main/java/org/apache/iotdb/db/metadata/MTree.java
index a4b015c..9a07c20 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/MTree.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/MTree.java
@@ -513,7 +513,7 @@ public class MTree implements Serializable {
     } else {
       for (MNode child : node.getChildren().values()) {
         if (!Pattern.matches(nodeReg.replace("*", ".*"), child.getName())) {
-          return;
+          continue;
         }
         findPath(child, nodes, idx + 1, parent + node.getName() + PATH_SEPARATOR,
             timeseriesSchemaList);
@@ -563,7 +563,7 @@ public class MTree implements Serializable {
       if (node instanceof InternalMNode) {
         for (MNode child : node.getChildren().values()) {
           if (!Pattern.matches(nodeReg.replace("*", ".*"), child.getName())) {
-            return;
+            continue;
           }
           if (idx == length) {
             res.add(parent + node.getName());
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
index da87dfa..ba8a67f 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java
@@ -332,7 +332,7 @@ public class MManagerBasicTest {
         "[root.laptop.b1, root.laptop.b2, root.vehicle.b1, root.vehicle.b2]",
         "[root.laptop.b1.d1, root.laptop.b1.d2, root.vehicle.b1.d0, root.vehicle.b1.d2, root.vehicle.b1.d3]",
         "[root.laptop.b1.d1, root.laptop.b1.d2]",
-        "[root.laptop.b1.d1, root.laptop.b1.d2, root.laptop.b2.d1, root.laptop.b2.d2]",
+        "[root.vehicle.b1.d0, root.vehicle.b1.d2, root.vehicle.b1.d3, root.vehicle.b2.d0]",
         "[root.laptop.b1.d1.s0, root.laptop.b1.d1.s1, root.laptop.b1.d2.s0, root.laptop.b2.d1.s1, root.laptop.b2.d1.s3, root.laptop.b2.d2.s2]"
     };
 
@@ -354,12 +354,12 @@ public class MManagerBasicTest {
           CompressionType.GZIP, null);
       manager.createTimeseries("root.vehicle.b1.d0.s0", TSDataType.INT32, TSEncoding.PLAIN,
           CompressionType.GZIP, null);
-      manager.createTimeseries("root.vehicle.b2.d0.s1", TSDataType.INT32, TSEncoding.PLAIN,
-          CompressionType.GZIP, null);
       manager.createTimeseries("root.vehicle.b1.d2.s2", TSDataType.INT32, TSEncoding.PLAIN,
           CompressionType.GZIP, null);
       manager.createTimeseries("root.vehicle.b1.d3.s3", TSDataType.INT32, TSEncoding.PLAIN,
           CompressionType.GZIP, null);
+      manager.createTimeseries("root.vehicle.b2.d0.s1", TSDataType.INT32, TSEncoding.PLAIN,
+          CompressionType.GZIP, null);
 
       assertEquals(res[0], manager.getChildNodePathInNextLevel("root").toString());
       assertEquals(res[1], manager.getChildNodePathInNextLevel("root.laptop").toString());
@@ -367,7 +367,7 @@ public class MManagerBasicTest {
       assertEquals(res[3], manager.getChildNodePathInNextLevel("root.*").toString());
       assertEquals(res[4], manager.getChildNodePathInNextLevel("root.*.b1").toString());
       assertEquals(res[5], manager.getChildNodePathInNextLevel("root.l*.b1").toString());
-      assertEquals(res[6], manager.getChildNodePathInNextLevel("root.l*.*").toString());
+      assertEquals(res[6], manager.getChildNodePathInNextLevel("root.v*.*").toString());
       assertEquals(res[7], manager.getChildNodePathInNextLevel("root.l*.b*.*").toString());
     } catch (MetadataException e) {
       e.printStackTrace();