{"action":"opened","issue":{"url":"https://api.github.com/repos/rails/rails/issues/34316","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/34316/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/34316/comments","events_url":"https://api.github.com/repos/rails/rails/issues/34316/events","html_url":"https://github.com/rails/rails/issues/34316","id":374062011,"node_id":"MDU6SXNzdWUzNzQwNjIwMTE=","number":34316,"title":"ActiveRecord Errors sometimes include raw SQL in exception message","user":{"login":"nerdrew","id":10101,"node_id":"MDQ6VXNlcjEwMTAx","avatar_url":"https://avatars1.githubusercontent.com/u/10101?v=4","gravatar_id":"","url":"https://api.github.com/users/nerdrew","html_url":"https://github.com/nerdrew","followers_url":"https://api.github.com/users/nerdrew/followers","following_url":"https://api.github.com/users/nerdrew/following{/other_user}","gists_url":"https://api.github.com/users/nerdrew/gists{/gist_id}","starred_url":"https://api.github.com/users/nerdrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerdrew/subscriptions","organizations_url":"https://api.github.com/users/nerdrew/orgs","repos_url":"https://api.github.com/users/nerdrew/repos","events_url":"https://api.github.com/users/nerdrew/events{/privacy}","received_events_url":"https://api.github.com/users/nerdrew/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-25T17:55:16Z","updated_at":"2018-10-25T17:55:16Z","closed_at":null,"author_association":"NONE","body":"### Steps to reproduce\r\nThere are numerous exceptions that include raw SQL in the exception message. Exception are messages often sent to external systems and should not include un-redacted SQL.\r\n\r\nIt looks like many exceptions raised by Mysql2. E.g.:\r\n- `ActiveRecord::ValueTooLong: Mysql2::Error: Data too long for column 'class_name' at row 1: UN-REDACTED SQL STATEMENT`\r\n- `Mysql2::Error: Deadlock found when trying to get lock; try restarting transaction: UN-REDACTED SQL STATEMENT`\r\n- `ActiveRecord::StatementInvalid: Mysql2::Error: Incorrect string value: '...' for column 'name' at row 1: UN-REDACTED SQL STATEMENT`\r\n- `ActiveRecord::StatementInvalid: Mysql2::Error: Lock wait timeout exceeded; try restarting transaction: UN-REDACTED SQL STATEMENT`\r\n\r\n### Expected behavior\r\nThere shouldn't be any un-redacted SQL in exception messages\r\n\r\n### Actual behavior\r\nThere is un-redacted SQL in exception messages\r\n\r\n### System configuration\r\n4.2.x - 5.2.x\r\n\r\n**Ruby version**:\r\n2.4.x, 2.5.x\r\n\r\nNotes:\r\nThis is the method that seems to add the un-redacted SQL: https://github.com/rails/rails/blob/5b5367364f7b17ca89b50a8738e6b0c692bb730f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L583-L593"}}
{"actor":{"display_login":"nerdrew"}}