{"action":"opened","issue":{"url":"https://api.github.com/repos/rails/rails/issues/31148","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/31148/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/31148/comments","events_url":"https://api.github.com/repos/rails/rails/issues/31148/events","html_url":"https://github.com/rails/rails/issues/31148","id":273694658,"number":31148,"title":"@column_types for ActiveRecord::Result is empty when used with MySQL","user":{"login":"Liooo","id":1630378,"avatar_url":"https://avatars1.githubusercontent.com/u/1630378?v=4","gravatar_id":"","url":"https://api.github.com/users/Liooo","html_url":"https://github.com/Liooo","followers_url":"https://api.github.com/users/Liooo/followers","following_url":"https://api.github.com/users/Liooo/following{/other_user}","gists_url":"https://api.github.com/users/Liooo/gists{/gist_id}","starred_url":"https://api.github.com/users/Liooo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Liooo/subscriptions","organizations_url":"https://api.github.com/users/Liooo/orgs","repos_url":"https://api.github.com/users/Liooo/repos","events_url":"https://api.github.com/users/Liooo/events{/privacy}","received_events_url":"https://api.github.com/users/Liooo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-14T07:39:03Z","updated_at":"2017-11-14T07:39:03Z","closed_at":null,"author_association":"NONE","body":"```\r\nsql = Model.all.to_sql\r\nresult = ActiveRecord::base.connection.select_all(sql)\r\n\r\nresult.cast_values \r\n#=> returns non casted values for mysql\r\n\r\nresult.column_types\r\n#=> {}\r\n```\r\nI'm guessing this is because the third `column_types` argument for [ActiveRecord::Result constructor](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/result.rb#L39) is not passed [with mysql adapter](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb#L34), while [postgres adapter does set it](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb#L89).\r\n\r\nIs this an expected behaviour or a bug?\r\n\r\n### System configuration\r\n**Rails version**:\r\n5.1.2 \r\n**Ruby version**:\r\n2.3.4\r\n"}}
{"actor":{"display_login":"Liooo"}}