{"action":"opened","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3750","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3750/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3750/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/3750/events","html_url":"https://github.com/orientechnologies/orientdb/issues/3750","id":60641056,"number":3750,"title":"Can't use ORDER BY @rid DESC in distributed mode","user":{"login":"tobiemh","id":1588290,"avatar_url":"https://avatars.githubusercontent.com/u/1588290?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiemh","html_url":"https://github.com/tobiemh","followers_url":"https://api.github.com/users/tobiemh/followers","following_url":"https://api.github.com/users/tobiemh/following{/other_user}","gists_url":"https://api.github.com/users/tobiemh/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiemh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiemh/subscriptions","organizations_url":"https://api.github.com/users/tobiemh/orgs","repos_url":"https://api.github.com/users/tobiemh/repos","events_url":"https://api.github.com/users/tobiemh/events{/privacy}","received_events_url":"https://api.github.com/users/tobiemh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-11T10:55:57Z","updated_at":"2015-03-11T10:55:57Z","closed_at":null,"body":"Setup the database:\r\n\r\n```sql\r\nCONNECT remote:127.0.0.1/testdatabase root root\r\nCREATE CLASS Person extends V\r\nCREATE VERTEX Person SET fullname = 'Joe Bloggs'\r\nCREATE VERTEX Person SET fullname = 'Tom Jones'\r\nCREATE VERTEX Person SET fullname = 'Mark Zuckerberg'\r\n```\r\n\r\nConsole output:\r\n```shell\r\nCreated vertex 'Person#30:0{fullname:Joe Bloggs} v1' in 0.051000 sec(s).\r\nCreated vertex 'Person#30:1{fullname:Tom Jones} v1' in 0.040000 sec(s).\r\nCreated vertex 'Person#30:2{fullname:Mark Zuckerberg} v1' in 0.046000 sec(s)\r\n```\r\n\r\nWhen executing the following queries, an error is raised:\r\n\r\n```sql\r\n-- Ordered by @rid descending\r\nSELECT FROM Person ORDER BY @rid DESC\r\n-- Ordered by @rid descending AND with @rid in WHERE clause\r\nSELECT FROM Person WHERE ( @rid = #30:0 OR archived = false ) ORDER BY @rid DESC\r\n```\r\n\r\nThese queries work correctly:\r\n```sql\r\n-- Ordered by @rid ascending\r\nSELECT FROM Person ORDER BY @rid ASC\r\n-- Ordered by @rid ascending AND with @rid in WHERE clause\r\nSELECT FROM Person WHERE ( @rid = #30:0 OR archived = false ) ORDER BY @rid ASC\r\n-- Ordered by @rid descending but selecting from a cluster which has content\r\nSELECT FROM cluster:30 WHERE ( @rid = #30:0 OR archived = false ) ORDER BY @rid DESC\r\n-- Ordered by @rid descending but selecting from a cluster which does not have content\r\nSELECT FROM cluster:31 WHERE ( @rid = #30:0 OR archived = false ) ORDER BY @rid DESC\r\nSELECT FROM cluster:32 WHERE ( @rid = #30:0 OR archived = false ) ORDER BY @rid DESC\r\n```\r\n\r\nThis is the full stack trace raised on the server:\r\n\r\n```shell\r\n2015-03-11 02:53:45:810 SEVERE Internal server error:\r\ncom.orientechnologies.common.io.OIOException: You cannot access outside the file size (0 bytes). You have requested portion -65536-0 bytes. File: File: admin_core-5.cpm os-size=1024, stored=0, filled=0, max=0 [ONetworkProtocolHttpDb]\r\n```\r\n\r\n***\r\n\r\nOrientDB version: 2.0.4 and 2.0.5-SNAPSHOT"}}