{"action":"created","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5393","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5393/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5393/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5393/events","html_url":"https://github.com/orientechnologies/orientdb/issues/5393","id":119333923,"number":5393,"title":"Escaping single quote dosn't play well with double braces","user":{"login":"red-0ne","id":231488,"avatar_url":"https://avatars.githubusercontent.com/u/231488?v=3","gravatar_id":"","url":"https://api.github.com/users/red-0ne","html_url":"https://github.com/red-0ne","followers_url":"https://api.github.com/users/red-0ne/followers","following_url":"https://api.github.com/users/red-0ne/following{/other_user}","gists_url":"https://api.github.com/users/red-0ne/gists{/gist_id}","starred_url":"https://api.github.com/users/red-0ne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/red-0ne/subscriptions","organizations_url":"https://api.github.com/users/red-0ne/orgs","repos_url":"https://api.github.com/users/red-0ne/repos","events_url":"https://api.github.com/users/red-0ne/events{/privacy}","received_events_url":"https://api.github.com/users/red-0ne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-29T03:40:15Z","updated_at":"2015-11-29T08:00:38Z","closed_at":null,"body":"The following query is causing parsing exception.\r\n```sql\r\nSELECT FROM OUser WHERE ((name = 'Dell\\'Aquila')) AND status = 'ACTIVE'\r\n```\r\n```\r\n2015-11-29 04:24:22:994 SEVER Internal server error:\r\ncom.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #50: Invalid keyword 'AND'\r\nCommand: SELECT FROM OUser WHERE ((name = 'Dell\\'Aquila' ) ) AND status = 'ACTIVE'\r\n----------------------------------------------------------^\r\n```\r\nOmitting the escaped signle quote `\\'`, using one brace `... (name = 'Dell\\'Aquila') AND ...` does not raise the exception.\r\n\r\nThis is very annoying as it makes all our programmatically built queries nearly unusable.\r\n\r\nOrientDB develop branch f5ce925"},"comment":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/comments/160390590","html_url":"https://github.com/orientechnologies/orientdb/issues/5393#issuecomment-160390590","issue_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5393","id":160390590,"user":{"login":"red-0ne","id":231488,"avatar_url":"https://avatars.githubusercontent.com/u/231488?v=3","gravatar_id":"","url":"https://api.github.com/users/red-0ne","html_url":"https://github.com/red-0ne","followers_url":"https://api.github.com/users/red-0ne/followers","following_url":"https://api.github.com/users/red-0ne/following{/other_user}","gists_url":"https://api.github.com/users/red-0ne/gists{/gist_id}","starred_url":"https://api.github.com/users/red-0ne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/red-0ne/subscriptions","organizations_url":"https://api.github.com/users/red-0ne/orgs","repos_url":"https://api.github.com/users/red-0ne/repos","events_url":"https://api.github.com/users/red-0ne/events{/privacy}","received_events_url":"https://api.github.com/users/red-0ne/received_events","type":"User","site_admin":false},"created_at":"2015-11-29T08:00:37Z","updated_at":"2015-11-29T08:00:37Z","body":"Also issuing the query with one pair of parentheses\r\n```\r\nSELECT FROM WHERE OUser (name = 'Dell\\'Aquila') AND status = 'ACTIVE'\r\n```\r\nreturns no results even if the record exists."}}