aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/bind_parameter_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-09-15 12:39:28 +0900
committerGitHub <noreply@github.com>2018-09-15 12:39:28 +0900
commitb53b91527548d7ea16aac7d88c50dba9b7e9ce34 (patch)
tree7eee51cb3b9a17d7c775fedf185ae1d8dc7168f8 /activerecord/test/cases/bind_parameter_test.rb
parent70b5a7594e91d7e3f3ee60642102b7a2323c2e0c (diff)
parentb571c4f3f2811b5d3dc8b005707cf8c353abdf03 (diff)
downloadrails-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.rb6
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)