Skip to content

Commit 2df4802

Browse files
committed
fix(core): reset hstore range scan offset
1 parent ebc31c8 commit 2df4802

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphIndexTransaction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ private List<HugeIndex> querySortedRangeIndexes(IndexLabel indexLabel,
799799
LockUtil.Locks locks = new LockUtil.Locks(spaceGraph);
800800
ConditionQuery scanQuery = query.copy();
801801
scanQuery.page(null);
802+
scanQuery.offset(0L);
802803
scanQuery.limit(Query.NO_LIMIT);
803804
try {
804805
locks.lockReads(LockUtil.INDEX_LABEL_DELETE, indexLabel.id());

hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/VertexCoreTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4415,6 +4415,14 @@ public void testQueryByDateProperty() {
44154415
Assert.assertEquals(dates[1], vertices.get(0).value("birth"));
44164416
Assert.assertEquals(dates[2], vertices.get(1).value("birth"));
44174417

4418+
// range with offset
4419+
vertices = graph.traversal().V().hasLabel("person")
4420+
.has("birth", P.between(dates[1], dates[4]))
4421+
.range(1, 3).toList();
4422+
Assert.assertEquals(2, vertices.size());
4423+
Assert.assertEquals(dates[2], vertices.get(0).value("birth"));
4424+
Assert.assertEquals(dates[3], vertices.get(1).value("birth"));
4425+
44184426
// limit after delete
44194427
graph.traversal().V().hasLabel("person")
44204428
.has("birth", P.between(dates[1], dates[4]))

0 commit comments

Comments
 (0)