SQL Keyword FETCHPLAN throws Exception
When using the FETCHPLAN keyword in an SQL SELECT statement, the following Exception is thrown:
java.lang.StringIndexOutOfBoundsException: String index out of range: -56 at java.lang.String.substring(Unknown Source) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.parseFetchplan(OCommandExecutorSQLSelect.java:1398) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.parse(OCommandExecutorSQLSelect.java:163) at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.parse(OCommandExecutorSQLSelect.java:85) at ...
This error can be reproduced using the Orient Console:
orientdb> SELECT FROM OUser FETCHPLAN *:-1 Error: com.orientechnologies.orient.enterprise.channel.binary.OResponseProcessingException: Exception during response processing. Error: java.lang.StringIndexOutOfBoundsException: String index out of range: -29
What OrientDB version?
Sorry forgot: OrientDB v 1.6.3 Storage: plocal System Win 8 64bit
We fixed it in 1.6.4 and 1.7-SNAPSHOT.
If I'm using the keyword in the right way (???) the error is still present ini 1.6.4 (actually, i can't see any code change at the relevant position)
OrientDB console v.1.6.4 (build UNKNOWN@r${buildNumber}; 2014-01-16 00:01:20+0100) www.orientechnologies.com
Type 'help' to display all the commands supported.
Installing extensions for GREMLIN language v.2.5.0-SNAPSHOT
orientdb> connect plocal:S:/tools/orientdb-community-1.6.4/databases/GratefulDeadConcerts admin admin
Connecting to database [plocal:S:/tools/orientdb-community-1.6.4/databases/GratefulDeadConcerts] with user 'admin'...OK
orientdb> SELECT FROM OUser FETCHPLAN *:-1
Error: java.lang.StringIndexOutOfBoundsException: String index out of range: -29
I've tried with 1.7-SNAPSHOT and works, but I don't remember recent fix on this. Please could you try with 1.7? We could isolate the fix and cherry-picking it to 1.6.5.
You're right, both my original application query as well as the test-query (from ouser) work in the 1.7 snapshot console.