alexMarian704 opened a new pull request, #3483:
URL: https://github.com/apache/hugegraph/pull/3483
## Purpose of the PR
- close #2216
`g.V().range(2, 3).barrier().range(0, 1)` throws `Invalid range: [2, 1)`
instead of returning 1 vertex.
extractRange() walks past the barrier and pushes both ranges into the same
Query, so Query.range() treats the second range as if it was on the original
stream. Only the first range should go to the backend, the second one applies
to what's left after the first.
While testing I found two more cases with the same cause that don't throw
but return wrong results:
- `g.V().range(1, 6).barrier().range(3, 8)` returns 3 vertices instead of 2
- `g.V(id).out().range(2, 3).barrier().range(0, 1)` returns 0 instead of 1
## Main Changes
- extractRange() now stops after the first range step, the rest stay as
normal local range steps
- removed the RangeGlobalStep check from the loop condition since it can't
be reached anymore
- added tests in VertexCoreTest and EdgeCoreTest for the cases above
Adjacent ranges like `range(1, 6).range(4, 8)` aren't affected, TinkerPop
merges them before our strategy runs.
## Verifying these changes
- [ ] Trivial rework / code cleanup without any test coverage. (No Need)
- [ ] Already covered by existing tests, such as *(please modify tests
here)*.
- [x] Need tests and can be verified as follows:
- new tests fail on master and pass with the fix
- ran CoreTestSuite and UnitTestSuite locally on the memory backend, all
passing
## Does this PR potentially affect the following parts?
- [ ] Dependencies ([add/update
license](https://hugegraph.apache.org/docs/contribution-guidelines/contribute/#321-check-licenses)
info &
[regenerate_known_dependencies.sh](../install-dist/scripts/dependency/regenerate_known_dependencies.sh))
- [ ] Modify configurations
- [ ] The public API
- [ ] Other affects (typed here)
- [x] Nope
## Documentation Status
- [ ] `Doc - TODO`: required documentation is pending; complete it before
merging.
- [ ] `Doc - Done`: documentation is included here or linked below.
- [x] `Doc - No Need`: no user-visible documentation is affected.
Documentation files in this PR or paired hugegraph-doc PR:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]