diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-01 17:49:20 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-01 17:49:20 -0300 |
commit | e99e23d11561a992c22b711d966ff9a70db0b804 (patch) | |
tree | 74cc2223e00e949c53572d70769e1dd403643d0a /activerecord/test/cases/adapters/mysql/connection_test.rb | |
parent | 492282d20dd3d869fa1ae30f0bce7c93dbba9cb7 (diff) | |
parent | 7e8b06282354da82518f96e0aab38f04788237fa (diff) | |
download | rails-e99e23d11561a992c22b711d966ff9a70db0b804.tar.gz rails-e99e23d11561a992c22b711d966ff9a70db0b804.tar.bz2 rails-e99e23d11561a992c22b711d966ff9a70db0b804.zip |
Merge pull request #14896 from jetthoughts/14895_overide_strict_by_sql_mode
Symbolize variables of mysql/mysql2 connection configuration
Conflicts:
activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test/cases/adapters/mysql/connection_test.rb')
-rw-r--r-- | activerecord/test/cases/adapters/mysql/connection_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/mysql/connection_test.rb b/activerecord/test/cases/adapters/mysql/connection_test.rb index 412efa22ff..4c90d06732 100644 --- a/activerecord/test/cases/adapters/mysql/connection_test.rb +++ b/activerecord/test/cases/adapters/mysql/connection_test.rb @@ -151,6 +151,14 @@ class MysqlConnectionTest < ActiveRecord::TestCase end end + def test_mysql_sql_mode_variable_overides_strict_mode + run_without_connection do |orig_connection| + ActiveRecord::Base.establish_connection(orig_connection.deep_merge(variables: { 'sql_mode' => 'ansi' })) + result = ActiveRecord::Base.connection.exec_query 'SELECT @@SESSION.sql_mode' + assert_not_equal [['STRICT_ALL_TABLES']], result.rows + end + end + def test_mysql_set_session_variable_to_default run_without_connection do |orig_connection| ActiveRecord::Base.establish_connection(orig_connection.deep_merge({:variables => {:default_week_format => :default}})) |