On the command line I try this:
curl --user admin:admin -XGET "http://localhost:2480/query/demo/sql/select from Profile/20/*:-1"
And get this
from Profile/20/*:-1"
from 500 Internal Server Error
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Date: Wed Oct 17 10:25:57 CDT 2012
Content-Type: text/plain; charset=utf-8
Server: OrientDB Server v.1.2.0 (build 12659)
Connection: Keep-Alive
Content-Length: 72
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Then I try this:
curl --user admin:admin "http://localhost:2480/query/demo/sql/select from Profile/20/*:-1"
And get this
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Edit:
I'm using the 1.2.0 version in ubuntu 12.04
Edit 2:
if I access from google chrome to:
http://localhost:2480/query/demo/sql/select%20from%20Profile/20/*:-1
It works. So I think is something in the curl request.
Edit 3:
I try adding this headers and the same error came out
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Authorization:Basic YWRtaW46YWRtaW4=
Cache-Control:max-age=0
Connection:keep-alive
Cookie:OSESSIONID=-
Host:127.0.0.1:2480
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/535.19
The white spaces must be replaced by %20
Bad query:
curl --user admin:admin "http://localhost:2480/query/demo/sql/select from Profile/20/*:-1"
Good query
curl --user admin:admin "http://localhost:2480/query/demo/sql/select%20from%20Profile/20/*:-1"