orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

SQL Keyword FETCHPLAN throws Exception

Open dxxr opened this issue 12 years ago • 6 comments

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

dxxr avatar Jan 30 '14 15:01 dxxr

What OrientDB version?

lvca avatar Jan 30 '14 15:01 lvca

Sorry forgot: OrientDB v 1.6.3 Storage: plocal System Win 8 64bit

dxxr avatar Jan 30 '14 15:01 dxxr

We fixed it in 1.6.4 and 1.7-SNAPSHOT.

lvca avatar Jan 30 '14 15:01 lvca

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

dxxr avatar Jan 30 '14 17:01 dxxr

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.

lvca avatar Jan 30 '14 17:01 lvca

You're right, both my original application query as well as the test-query (from ouser) work in the 1.7 snapshot console.

dxxr avatar Feb 04 '14 14:02 dxxr