diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-09-15 12:39:28 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-15 12:39:28 +0900 |
commit | b53b91527548d7ea16aac7d88c50dba9b7e9ce34 (patch) | |
tree | 7eee51cb3b9a17d7c775fedf185ae1d8dc7168f8 /activerecord/test/cases/bind_parameter_test.rb | |
parent | 70b5a7594e91d7e3f3ee60642102b7a2323c2e0c (diff) | |
parent | b571c4f3f2811b5d3dc8b005707cf8c353abdf03 (diff) | |
download | rails-b53b91527548d7ea16aac7d88c50dba9b7e9ce34.tar.gz rails-b53b91527548d7ea16aac7d88c50dba9b7e9ce34.tar.bz2 rails-b53b91527548d7ea16aac7d88c50dba9b7e9ce34.zip |
Merge pull request #33878 from kamipo/fallback_to_unprepared_statement
Fallback to unprepared statement only when bind params limit is exceeded
Diffstat (limited to 'activerecord/test/cases/bind_parameter_test.rb')
-rw-r--r-- | activerecord/test/cases/bind_parameter_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/bind_parameter_test.rb b/activerecord/test/cases/bind_parameter_test.rb index 91cc49385c..9c1f7aaef2 100644 --- a/activerecord/test/cases/bind_parameter_test.rb +++ b/activerecord/test/cases/bind_parameter_test.rb @@ -34,6 +34,12 @@ if ActiveRecord::Base.connection.prepared_statements ActiveSupport::Notifications.unsubscribe(@subscription) end + def test_too_many_binds + bind_params_length = @connection.send(:bind_params_length) + topics = Topic.where(id: (1 .. bind_params_length + 1).to_a) + assert_equal Topic.count, topics.count + end + def test_bind_from_join_in_subquery subquery = Author.joins(:thinking_posts).where(name: "David") scope = Author.from(subquery, "authors").where(id: 1) |