Skip to content

Commit

Permalink
Merge pull request rails#16196 from yahonda/mysql_restrict_test
Browse files Browse the repository at this point in the history
Revert "Rename to test_mysql_strict_mode_disabled_dont_override_global_sql_mode"
  • Loading branch information
matthewd committed Jul 16, 2014
2 parents e361996 + 599d138 commit 0a5be1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions activerecord/test/cases/adapters/mysql/connection_test.rb
Expand Up @@ -134,12 +134,11 @@ def test_mysql_default_in_strict_mode
assert_equal [["STRICT_ALL_TABLES"]], result.rows
end

def test_mysql_strict_mode_disabled_dont_override_global_sql_mode
def test_mysql_strict_mode_disabled
run_without_connection do |orig_connection|
ActiveRecord::Base.establish_connection(orig_connection.merge({:strict => false}))
global_sql_mode = ActiveRecord::Base.connection.exec_query "SELECT @@GLOBAL.sql_mode"
session_sql_mode = ActiveRecord::Base.connection.exec_query "SELECT @@SESSION.sql_mode"
assert_equal global_sql_mode.rows, session_sql_mode.rows
result = ActiveRecord::Base.connection.exec_query "SELECT @@SESSION.sql_mode"
assert_equal [['']], result.rows
end
end

Expand Down
7 changes: 3 additions & 4 deletions activerecord/test/cases/adapters/mysql2/connection_test.rb
Expand Up @@ -60,12 +60,11 @@ def test_mysql_default_in_strict_mode
assert_equal [["STRICT_ALL_TABLES"]], result.rows
end

def test_mysql_strict_mode_disabled_dont_override_global_sql_mode
def test_mysql_strict_mode_disabled
run_without_connection do |orig_connection|
ActiveRecord::Base.establish_connection(orig_connection.merge({:strict => false}))
global_sql_mode = ActiveRecord::Base.connection.exec_query "SELECT @@GLOBAL.sql_mode"
session_sql_mode = ActiveRecord::Base.connection.exec_query "SELECT @@SESSION.sql_mode"
assert_equal global_sql_mode.rows, session_sql_mode.rows
result = ActiveRecord::Base.connection.exec_query "SELECT @@SESSION.sql_mode"
assert_equal [['']], result.rows
end
end

Expand Down

0 comments on commit 0a5be1d

Please sign in to comment.