@@ -0,0 +1,1944 @@
+package com.orientechnologies.orient.core.sql;%0A%0Aimport static org.testng.AssertJUnit.assertEquals;%0A%0Aimport java.util.List;%0A%0Aimport org.testng.annotations.Test;%0A%0Aimport com.orientechnologies.orient.core.db.document.ODatabaseDocument;%0Aimport com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;%0Aimport com.orientechnologies.orient.core.id.ORID;%0Aimport com.orientechnologies.orient.core.metadata.schema.OSchema;%0Aimport com.orientechnologies.orient.core.record.impl.ODocument;%0Aimport com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;%0A%0Apublic class UpdateWithRidParameters %7B%0A%0A  @Test%0A  public void testRidParameters() %7B%0A    ODatabaseDocument db = new ODatabaseDocumentTx(%22memory:%22 + UpdateWithRidParameters.class.getSimpleName());%0A    db.create();%0A%0A    OSchema schm = db.getMetadata().getSchema();%0A    schm.createClass(%22testingClass%22);%0A    schm.createClass(%22testingClass2%22);%0A    schm.save();%0A%0A    OCommandSQL cmd = new OCommandSQL(%22INSERT INTO testingClass SET id = ?%22);%0A    db.command(cmd).execute(123);%0A%0A    OCommandSQL cmd2 = new OCommandSQL(%22INSERT INTO testingClass2 SET id = ?%22);%0A    db.command(cmd2).execute(456);%0A%0A    List%3CODocument%3E docs = db.query(new OSQLSynchQuery%3CODocument%3E(%22SELECT FROM testingClass2 WHERE id = ?%22), 456);%0A    ORID orid = (ORID) docs.get(0).field(%22@rid%22, ORID.class);%0A%0A    // This does not work. It silently adds a null instead of the ORID.%0A    OCommandSQL cmd3 = new OCommandSQL(%22UPDATE testingClass ADD linkedlist = ?%22);%0A    db.command(cmd3).execute(orid);%0A%0A    // This does work.%0A    OCommandSQL cmd4 = new OCommandSQL(%22UPDATE testingClass ADD linkedlist = %22 + orid.toString());%0A    db.command(cmd4).execute();%0A%0A    List%3CODocument%3E docs2 = db.query(new OSQLSynchQuery%3CODocument%3E(%22SELECT FROM testingClass WHERE id = ?%22), 123);%0A    List%3CORID%3E lst = docs2.get(0).field(%22linkedlist%22, List.class);%0A%0A    assertEquals(orid, lst.get(0));%0A    assertEquals(orid, lst.get(1));%0A%0A    db.drop();%0A%0A  %7D%0A%0A%7D%0A

add test for update with RID parameters, issue #1533