From 558bb4b366e417faf2d8a1026b523bbb13b556fa Mon Sep 17 00:00:00 2001 From: Luigi Dell'Aquila Date: Wed, 26 Jun 2019 09:56:31 +0200 Subject: [PATCH] Fix reverse traversal of bothE and bothV in MATCH execution Resolves: #8915 --- .../orient/core/sql/parser/OMethodCall.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMethodCall.java b/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMethodCall.java index b0f81e7133c..2be56c98d21 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMethodCall.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OMethodCall.java @@ -23,7 +23,7 @@ public class OMethodCall extends SimpleNode { Arrays.asList(new String[] { "out", "in", "both", "outE", "inE", "bothE", "bothV", "outV", "inV" })); static Set bidirectionalMethods = new HashSet( - Arrays.asList(new String[] { "out", "in", "both", "oute", "ine", "inv", "outv" })); + Arrays.asList(new String[] { "out", "in", "both", "oute", "ine", "inv", "outv", "bothe", "bothv" })); protected OIdentifier methodName; protected List params = new ArrayList(); @@ -157,6 +157,14 @@ public Object executeReverse(Object targetObjects, OCommandContext ctx) { return execute(targetObjects, ctx, "inE", params, null); } + if (straightName.equalsIgnoreCase("bothE")) { + return execute(targetObjects, ctx, "bothV", params, null); + } + + if (straightName.equalsIgnoreCase("bothV")) { + return execute(targetObjects, ctx, "bothE", params, null); + } + throw new UnsupportedOperationException("Invalid reverse traversal: " + methodName); }