Skip to content

Commit

Permalink
Fix .toJson() in new SQL executor
Browse files Browse the repository at this point in the history
Resolves: #8304
  • Loading branch information
luigidellaquila committed Jun 4, 2018
1 parent 68e97e6 commit 417aa25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ default String encode(String s) {
result = result.replaceAll("\"", "\\\\\"");
result = result.replaceAll("\n", "\\\\n");
result = result.replaceAll("\t", "\\\\t");
result = result.replaceAll("\r", "\\\\r");
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.record.ORecord;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.executor.OResult;
import com.orientechnologies.orient.core.sql.method.misc.OAbstractSQLMethod;

import java.util.Map;
Expand Down Expand Up @@ -52,6 +53,9 @@ public Object execute(Object iThis, OIdentifiable iCurrentRecord, OCommandContex

final String format = iParams.length > 0 ? ((String) iParams[0]).replace("\"", "") : null;

if(iThis instanceof OResult){
iThis = ((OResult) iThis).toElement();
}
if (iThis instanceof ORecord) {

final ORecord record = (ORecord) iThis;
Expand Down

0 comments on commit 417aa25

Please sign in to comment.