Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename to test_mysql_no_override_global_sql_mode #7408

Merged
merged 1 commit into from Aug 21, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions activerecord/test/cases/adapters/mysql/connection_test.rb
Expand Up @@ -128,11 +128,12 @@ def test_mysql_default_in_strict_mode
assert_equal [["STRICT_ALL_TABLES"]], result.rows
end

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

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

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

Expand Down