Skip to content

Commit

Permalink
Fix test failure if prepared_statements is flipped
Browse files Browse the repository at this point in the history
  • Loading branch information
kamipo committed Jan 20, 2020
1 parent e7a6a48 commit fc07294
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions activerecord/test/cases/prepared_statement_status_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ def test_prepared_statement_status_is_thread_and_instance_specific

assert_not_same course_conn, entrant_conn

if current_adapter?(:Mysql2Adapter)
# The mysql adapter does not use prepared
# statements by default.
assert_not course_conn.prepared_statements
assert_not entrant_conn.prepared_statements
else
if ActiveRecord::Base.connection.prepared_statements
t1 = Thread.new do
course_conn.unprepared_statement do
inside.set
Expand All @@ -44,6 +39,9 @@ def test_prepared_statement_status_is_thread_and_instance_specific

t1.join
t2.join
else
assert_not course_conn.prepared_statements
assert_not entrant_conn.prepared_statements
end
end
end
Expand Down

0 comments on commit fc07294

Please sign in to comment.