Permalink
Browse files

fixes #446

  • Loading branch information...
1 parent 92890ac commit 80645f69d9576a3008dc56081f1f0a842919091b @systay committed Apr 23, 2012
View
@@ -1,3 +1,7 @@
+<NOT YET RELEASED>
+----------------
+o Fixes issue #446
+
1.7 (2012-04-18)
----------------
o Added the possibility to use multiple relationship types on patterns
@@ -53,7 +53,7 @@ class MatchBuilder extends PlanBuilder {
val resolvedStartPoints = start.map(si => x.possibleStartPoints.find(_.name == si.token.identifierName) match {
case Some(_) => si.solved
case None => true
- }).reduce(_ && _)
+ }).foldLeft(true)(_ && _)
lazy val pipeSatisfied = p.symbols.satisfies(x.predicate.dependencies)
@@ -1891,4 +1891,18 @@ RETURN x0.name?
assert(first.keys === Set("a", "b", "p"))
assert(first("p").asInstanceOf[Path] == PathImpl(a, r, b))
}
+
+ @Test def issue_446() {
+ val a = createNode()
+ val b = createNode()
+ val c = createNode()
+ val d = createNode()
+ relate(a,b, "age"->24)
+ relate(a,c, "age"->38)
+ relate(a,d, "age"->12)
+
+ val q = "start n=node(1) match n-[f]->() with n, max(f.age) as age match n-[f]->m where f.age = age return m"
+
+ assert( parseAndExecute(q).toList === List(Map("m"->c)))
+ }
}
@@ -79,6 +79,7 @@ class GraphDatabaseTestBase extends JUnitSuite {
def nodeIds = nodes.map(_.getId).toArray
def relate(a: Node, b: Node): Relationship = relate(a, b, "REL")
+ def relate(a: Node, b: Node, pk:(String,Any)*): Relationship = relate(a, b, "REL", pk.toMap)
def relate(n1: Node, n2: Node, relType: String, name: String): Relationship = relate(n1, n2, relType, Map("name" -> name))

0 comments on commit 80645f6

Please sign in to comment.