From 56af4323dd25ad2707715e28f3ada54b4bea9f30 Mon Sep 17 00:00:00 2001 From: Luigi Dell'Aquila Date: Tue, 18 Sep 2018 08:47:29 +0200 Subject: [PATCH] Fix multiple edge creations in BATCH script with LET statements Resolves: #8444 --- .../orient/core/sql/executor/CreateEdgesStep.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/CreateEdgesStep.java b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/CreateEdgesStep.java index 42946a75c07..724d42245ac 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/CreateEdgesStep.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/CreateEdgesStep.java @@ -152,17 +152,17 @@ private void init() { Iterator toIter = (Iterator) toValues; - while (toIter != null && toIter.hasNext()) { - toList.add(toIter.next()); - } - - toIterator = toList.iterator(); if (toIter instanceof OResultSet) { try { ((OResultSet) toIter).reset(); } catch (Exception ignore) { } } + while (toIter != null && toIter.hasNext()) { + toList.add(toIter.next()); + } + + toIterator = toList.iterator(); currentFrom = fromIter != null && fromIter.hasNext() ? asVertex(fromIter.next()) : null;