{"action":"created","issue":{"url":"https://api.github.com/repos/simplethings/EntityAudit/issues/26","labels_url":"https://api.github.com/repos/simplethings/EntityAudit/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/simplethings/EntityAudit/issues/26/comments","events_url":"https://api.github.com/repos/simplethings/EntityAudit/issues/26/events","html_url":"https://github.com/simplethings/EntityAudit/issues/26","id":6729650,"number":26,"title":"SQL syntax error when viewing revisions on entities with MySQL reserved yet quoted field names.","user":{"login":"bobemoe","id":2304970,"avatar_url":"https://avatars.githubusercontent.com/u/2304970?v=3","gravatar_id":"","url":"https://api.github.com/users/bobemoe","html_url":"https://github.com/bobemoe","followers_url":"https://api.github.com/users/bobemoe/followers","following_url":"https://api.github.com/users/bobemoe/following{/other_user}","gists_url":"https://api.github.com/users/bobemoe/gists{/gist_id}","starred_url":"https://api.github.com/users/bobemoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobemoe/subscriptions","organizations_url":"https://api.github.com/users/bobemoe/orgs","repos_url":"https://api.github.com/users/bobemoe/repos","events_url":"https://api.github.com/users/bobemoe/events{/privacy}","received_events_url":"https://api.github.com/users/bobemoe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/simplethings/EntityAudit/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2012-09-08T07:29:12Z","updated_at":"2015-01-10T14:01:15Z","closed_at":null,"body":"Entity with fields \\`to\\` and \\`from\\` produces invalid SQL due to not being quoted is the AS part.\n\nFields on entity are defined as such:\n    /**\n     * @var string $to\n     * @ORM\\Column(name=\"\\`to\\`\", type=\"string\", length=255)\n     */\n    private $to;      \n\nSQL errors:\n\nSELECT e.revtype, id AS id, name AS name, \\`to\\` AS to, \\`from\\` AS from, subject AS subject, body AS body FROM MailTemplate_audit e WHERE e.rev = ?' with params {\"1\":\"4\"}: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to, \\`from\\` AS from, subject AS subject, body AS body FROM MailTemplate_audit e W' at line 1 (uncaught exception)\n\nQuick (but untested for side affects)  fix is to comment out the end of line 222 of SimpleThings\\EntityAudit\\AuditReader (https://github.com/simplethings/EntityAudit.git 60a5bcb61a43fc4360ff5190cb4b5e63864fc3b7)\n\n                $columnList .= ', ' . $class->getQuotedColumnName($field, $this->platform);// .' AS ' . $field;\n\nEDIT: Correct formatting for clarity (\\`to\\` and \\`from\\` was showing as `to` and `from`)"},"comment":{"url":"https://api.github.com/repos/simplethings/EntityAudit/issues/comments/69456730","html_url":"https://github.com/simplethings/EntityAudit/issues/26#issuecomment-69456730","issue_url":"https://api.github.com/repos/simplethings/EntityAudit/issues/26","id":69456730,"user":{"login":"andrewtch","id":925330,"avatar_url":"https://avatars.githubusercontent.com/u/925330?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewtch","html_url":"https://github.com/andrewtch","followers_url":"https://api.github.com/users/andrewtch/followers","following_url":"https://api.github.com/users/andrewtch/following{/other_user}","gists_url":"https://api.github.com/users/andrewtch/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewtch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewtch/subscriptions","organizations_url":"https://api.github.com/users/andrewtch/orgs","repos_url":"https://api.github.com/users/andrewtch/repos","events_url":"https://api.github.com/users/andrewtch/events{/privacy}","received_events_url":"https://api.github.com/users/andrewtch/received_events","type":"User","site_admin":false},"created_at":"2015-01-10T14:01:15Z","updated_at":"2015-01-10T14:01:15Z","body":"@bobemoe , this should be fixed by now. Please re-check or close."}}