[ https://issues.apache.org/jira/browse/TINKERPOP-2893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17714333#comment-17714333 ]
ASF GitHub Bot commented on TINKERPOP-2893: ------------------------------------------- kenhuuu opened a new pull request, #2033: URL: https://github.com/apache/tinkerpop/pull/2033 Fixes https://issues.apache.org/jira/browse/TINKERPOP-2893 Predicates that contain negative numbers aren't handled correctly by the current CountStrategy implementation. In particular, the use of the highRange to determine when to use not() or to remove the count().is() doesn't account for these cases. This leads to the optimization being applied when it shouldn't be. This commit temporarily solves this by disabling the optimization in these cases. Further work could be done to selectively apply the optimization as there are some cases even with predicates that contain negative numbers where it could be applied. > Incorrectly comparing a counted value with multiple predicates > -------------------------------------------------------------- > > Key: TINKERPOP-2893 > URL: https://issues.apache.org/jira/browse/TINKERPOP-2893 > Project: TinkerPop > Issue Type: Bug > Components: process > Affects Versions: 3.5.5 > Reporter: Lei Tang > Priority: Critical > > We use a composition of two predicates inside(-1,1).and(lt(-1)) to filter > numbers that are greater than -1 and less -1. Obviously, no values satisfy > this condition. Therefore, we expect Tinkergraph returns an empty set. > However, a vertex is returned. > {code:java} > gremlin> :> g.V().where(__.in('knows').count().is(inside(-1,1).and(lt(-1)))) > ==>v[0] {code} > The graph of this example is as following. > {code:java} > Vertex bob = g.addV("person").property("name", "Bob").next(); // v[0] > Vertex alice = g.addV("person").property("name", "Alice").next(); // v[1] > Edge edge1 = g.addE("knows").from(bob).to(alice).next();{code} -- This message was sent by Atlassian Jira (v8.20.10#820010)