[
https://issues.apache.org/jira/browse/TINKERPOP-2891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17712567#comment-17712567
]
ASF GitHub Bot commented on TINKERPOP-2891:
-------------------------------------------
xiazcy commented on code in PR #2021:
URL: https://github.com/apache/tinkerpop/pull/2021#discussion_r1167308767
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategy.java:
##########
@@ -178,7 +178,7 @@ public void apply(final Traversal.Admin<?, ?> traversal) {
}
}
} else {
- TraversalHelper.insertBeforeStep(new
RangeGlobalStep<>(traversal, 0L, highRange), curr, traversal);
+ TraversalHelper.insertBeforeStep(new
RangeGlobalStep<>(traversal, 0L, highRange < 0 ? 0 : highRange), curr,
traversal);
Review Comment:
Yes, this is more of a nit style/format comment since previous comparisons
are done as Long.
> Inconsistent behavior when comparing a counted value with a negative value
> --------------------------------------------------------------------------
>
> Key: TINKERPOP-2891
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2891
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.5.5
> Reporter: Lei Tang
> Priority: Critical
>
> I compare a value that should be greater than or equal to 0 with a negative
> value.
> {code:java}
> gremlin> :> g.V().where(__.in().count().is(eq(-3)))
> Not a legal range: [0, -2]
> gremlin> :> g.V().where(__.in().count().is(eq(-2))){code}
> I find that Tinkergraph throws an exception when comparing negative values
> less than -2, but does nothing when comparing with -2.
> I'm curious why they behave differently.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)