aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/bind_parameter_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-10-24 10:31:41 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-10-24 11:26:49 +0900
commitce40073c9c321575e6b4f46dd5ac9b796a2637be (patch)
tree0e57b4f8c46ff591122cec58d248fe39125e3bbf /activerecord/test/cases/bind_parameter_test.rb
parentdc6761592009e9146552fc9d6299bf58a34e187a (diff)
downloadrails-ce40073c9c321575e6b4f46dd5ac9b796a2637be.tar.gz
rails-ce40073c9c321575e6b4f46dd5ac9b796a2637be.tar.bz2
rails-ce40073c9c321575e6b4f46dd5ac9b796a2637be.zip
Lazy checking whether or not values in IN clause are boundable
Since #33844, eager loading/preloading with too many and/or too large ids won't be broken by pre-checking whether the value is constructable or not. But the pre-checking caused the type to be evaluated at relation build time instead of at the query execution time, that is breaking an expectation for some apps. I've made the pre-cheking lazy as much as possible, that is no longer happend at relation build time.
Diffstat (limited to 'activerecord/test/cases/bind_parameter_test.rb')
-rw-r--r--activerecord/test/cases/bind_parameter_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/bind_parameter_test.rb b/activerecord/test/cases/bind_parameter_test.rb
index 9c1f7aaef2..fddc2781b8 100644
--- a/activerecord/test/cases/bind_parameter_test.rb
+++ b/activerecord/test/cases/bind_parameter_test.rb
@@ -36,7 +36,7 @@ if ActiveRecord::Base.connection.prepared_statements
def test_too_many_binds
bind_params_length = @connection.send(:bind_params_length)
- topics = Topic.where(id: (1 .. bind_params_length + 1).to_a)
+ topics = Topic.where(id: (1 .. bind_params_length).to_a << 2**63)
assert_equal Topic.count, topics.count
end