Skip to content

Commit

Permalink
Make default to @prepared_statements = false in Mysql2Adapter
Browse files Browse the repository at this point in the history
Prepared statements in mysql2 still have GC issue.
brianmario/mysql2#694
  • Loading branch information
kamipo committed Feb 8, 2016
1 parent 304bc25 commit 5bfaeeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Mysql2Adapter < AbstractMysqlAdapter

def initialize(connection, logger, connection_options, config)
super
@prepared_statements = false unless config.key?(:prepared_statements)
configure_connection
end

Expand Down
3 changes: 2 additions & 1 deletion activerecord/test/cases/bind_parameter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def setup
ActiveSupport::Notifications.unsubscribe(@subscription)
end

if ActiveRecord::Base.connection.supports_statement_cache?
if ActiveRecord::Base.connection.supports_statement_cache? &&
ActiveRecord::Base.connection.prepared_statements
def test_bind_from_join_in_subquery
subquery = Author.joins(:thinking_posts).where(name: 'David')
scope = Author.from(subquery, 'authors').where(id: 1)
Expand Down

0 comments on commit 5bfaeeb

Please sign in to comment.