Tried with 2.1.2 and works. I've created a couple of new test cases for that.
https://github.com/orientechnologies/orientdb/commit/cfd3de500c33bfa49b4f130db6509718b5a9638b Lvc@ On Wednesday, 13 May 2015 09:38:29 UTC+2, Jean-Sebastien Lemay wrote: > > When using SQL prepared statements, passing an empty List or Set will > cause an OStorageException to be raised (caused by a inner > NoSuchElementException). > > This will crash: > OrientGraph db = ... > String sql = "SELECT FROM MyUsers WHERE username NOT IN :usernames"; > Map<String, Object> queryParams= new HashMap<>(); > queryParams.put("usernames", new HashSet<String>()); > > Iterable<Vertex> results = ((Iterable<Vertex>) > db.command(new OSQLSynchQuery<>(sql)) > .execute(queryParams)); > > Instead of crashing, I would've expected the output SQL command to be: > SELECT FROM MyUsers WHERE username NOT IN [] > > As soon as there is a value, the crash does not occur. > OrientGraph db = ... > String sql = "SELECT FROM MyUsers WHERE username NOT IN :usernames"; > Map<String, Object> queryParams= new HashMap<>(); > queryParams.put("usernames", new HashSet<String>() {{ add("test"); }}); > > Iterable<Vertex> results = ((Iterable<Vertex>) > db.command(new OSQLSynchQuery<>(sql)) > .execute(queryParams)); > (the above works fine) > > Can this be fixed? > > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
