{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/17185","labels_url":"https://api.github.com/repos/rails/rails/issues/17185/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/17185/comments","events_url":"https://api.github.com/repos/rails/rails/issues/17185/events","html_url":"https://github.com/rails/rails/pull/17185","id":44932697,"number":17185,"title":"Fix for #12753","user":{"login":"brocktimus","id":2103728,"avatar_url":"https://avatars.githubusercontent.com/u/2103728?v=3","gravatar_id":"","url":"https://api.github.com/users/brocktimus","html_url":"https://github.com/brocktimus","followers_url":"https://api.github.com/users/brocktimus/followers","following_url":"https://api.github.com/users/brocktimus/following{/other_user}","gists_url":"https://api.github.com/users/brocktimus/gists{/gist_id}","starred_url":"https://api.github.com/users/brocktimus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brocktimus/subscriptions","organizations_url":"https://api.github.com/users/brocktimus/orgs","repos_url":"https://api.github.com/users/brocktimus/repos","events_url":"https://api.github.com/users/brocktimus/events{/privacy}","received_events_url":"https://api.github.com/users/brocktimus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-10-05T23:18:48Z","updated_at":"2015-02-10T23:47:58Z","closed_at":"2015-02-10T23:47:58Z","pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/17185","html_url":"https://github.com/rails/rails/pull/17185","diff_url":"https://github.com/rails/rails/pull/17185.diff","patch_url":"https://github.com/rails/rails/pull/17185.patch"},"body":"I did a lot of hunting around and managed to produce a failing test and isolate where issue is coming from. This also possibly relates somewhat to #15920.\r\n\r\nI've added a note near where the \"bug starts\". Basically if there are two bind params both referencing a single column when we do parameter replacement they're both replace with a common index. This fails with prepared statements and executing because some of the parameters are no longer used and the adapter raises unknown data type (or similar).\r\n\r\nI realise my test could be fixed by changing my scope to have ```unscoped.select(:parent_id)``` but it was the first failing test I could come up with after a lot of trying to integrate it into the codebase. Will be trying to \"adjust\" it to a more correct / succinct test case.\r\n\r\nI don't know where / how to start fixing this however, so I'll CC people I've seen working on this or similar code. Any ideas? @tenderlove @sgrif @eileencodes @senny "},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/73809350","html_url":"https://github.com/rails/rails/pull/17185#issuecomment-73809350","issue_url":"https://api.github.com/repos/rails/rails/issues/17185","id":73809350,"user":{"login":"brocktimus","id":2103728,"avatar_url":"https://avatars.githubusercontent.com/u/2103728?v=3","gravatar_id":"","url":"https://api.github.com/users/brocktimus","html_url":"https://github.com/brocktimus","followers_url":"https://api.github.com/users/brocktimus/followers","following_url":"https://api.github.com/users/brocktimus/following{/other_user}","gists_url":"https://api.github.com/users/brocktimus/gists{/gist_id}","starred_url":"https://api.github.com/users/brocktimus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brocktimus/subscriptions","organizations_url":"https://api.github.com/users/brocktimus/orgs","repos_url":"https://api.github.com/users/brocktimus/repos","events_url":"https://api.github.com/users/brocktimus/events{/privacy}","received_events_url":"https://api.github.com/users/brocktimus/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T23:47:58Z","updated_at":"2015-02-10T23:47:58Z","body":"Fixed in ac1fbc1. Going to do less messy new PR for old test that would have failed."}}