This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new c0e6afd fix limit in show timeseries without tag
c0e6afd is described below
commit c0e6afdca927c708f870c58f40372f64d5f320ed
Author: qiaojialin <[email protected]>
AuthorDate: Mon Apr 27 10:47:33 2020 +0800
fix limit in show timeseries without tag
---
server/src/main/java/org/apache/iotdb/db/metadata/MTree.java | 2 +-
.../test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
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 3deceb3..3f6922f 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
@@ -541,7 +541,7 @@ public class MTree implements Serializable {
if (nodes.length <= idx) {
if (hasLimit) {
curOffset.set(curOffset.get() + 1);
- if (curOffset.get() < offset.get() || count == limit) {
+ if (curOffset.get() < offset.get() || count.get() == limit.get()) {
return;
}
}
diff --git
a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java
b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java
index 28e6727..595c23f 100644
---
a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java
+++
b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java
@@ -113,6 +113,7 @@ public class IoTDBSimpleQueryIT {
statement.execute("INSERT INTO root.sg1.d0(timestamp, s1) VALUES (5,
5)");
statement.execute("INSERT INTO root.sg1.d0(timestamp, s2) VALUES (5,
5)");
statement.execute("INSERT INTO root.sg1.d0(timestamp, s3) VALUES (5,
5)");
+ statement.execute("INSERT INTO root.sg1.d0(timestamp, s4) VALUES (5,
5)");
ResultSet resultSet = statement.executeQuery("show timeseries limit 2
offset 1");
@@ -122,6 +123,7 @@ public class IoTDBSimpleQueryIT {
Assert.assertEquals(exps[count++], resultSet.getString(1));
}
+ Assert.assertEquals(exps.length, count);
resultSet.close();
}
}