New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arel/AR not replacing binds correct? #13887
Comments
This is correct. Who finally replace the binds are the database adapter when doing the query. |
good point =) |
So, |
See adequaterecord branch for adequate reason. If we replace the binds before the database connection call we would not have how to cache the prepared statements. That branch also explain why the |
Got it... everything is clear now... |
Yes, it should. |
✨ |
Using this script:
https://gist.github.com/arthurnn/8702117
mysql output:
postgres output:
sqlite3 output:
Is this correct? (AFAIK, the
?
and$1
should had been replaced)author.posts.select(:title)
returns aRelation
, which callsto_sql
https://github.com/rails/rails/blob/master/activerecord/lib/active_record/relation.rb#L510 . So that means that the binds are in place, so that might be an issue on AREL? (if it is a AREL thing, I can open a issue in there)maybe related #12753 ?
thoughts @tenderlove @rafaelfranca @carlosantoniodasilva
The text was updated successfully, but these errors were encountered: