Fix nested projections on INSERT RETURN statement
Resolves:
@@ -7,6 +7,7 @@ import com.orientechnologies.orient.core.db.record.OIdentifiable;
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;
@@ -140,6 +141,9 @@ public class OProjectionItem extends SimpleNode {
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);
