Skip to content

Commit

Permalink
Fix nested projections on INSERT RETURN statement
Browse files Browse the repository at this point in the history
Resolves: #8543
  • Loading branch information
luigidellaquila committed Nov 27, 2018
1 parent 615a9ce commit 14d6d1f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.orientechnologies.orient.core.db.record.ridbag.ORidBag;
import com.orientechnologies.orient.core.exception.OCommandExecutionException;
import com.orientechnologies.orient.core.id.ORID;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.record.impl.OEdgeToVertexIterable;
import com.orientechnologies.orient.core.record.impl.OEdgeToVertexIterator;
import com.orientechnologies.orient.core.sql.executor.AggregationContext;
Expand Down Expand Up @@ -140,6 +141,9 @@ public Object execute(OResult iCurrentRecord, OCommandContext ctx) {
result = expression.execute(iCurrentRecord, ctx);
}
if (nestedProjection != null) {
if(result instanceof ODocument && ((ODocument) result).isEmpty()){
((ODocument) result).load(null);
}
result = nestedProjection.apply(expression, result, ctx);
}
return convert(result);
Expand Down

0 comments on commit 14d6d1f

Please sign in to comment.