Skip to content

Commit 6f50c2b

Browse files
committed
make MySQL pass our tests under 5.6
Conflicts: test/db/mysql/connection_test.rb
1 parent 709051d commit 6f50c2b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/db/mysql/connection_test.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ def test_mysql_default_in_strict_mode
88

99
def test_mysql_strict_mode_disabled
1010
run_without_connection do |orig_connection|
11-
ActiveRecord::Base.establish_connection(orig_connection.merge({:strict => false}))
12-
assert_equal [['']], select_rows("SELECT @@SESSION.sql_mode") if ! mariadb_driver?
11+
ActiveRecord::Base.establish_connection(orig_connection.merge(:strict => false))
12+
sql_mode = select_rows("SELECT @@SESSION.sql_mode")
13+
version = ActiveRecord::Base.connection.send(:version)
14+
if version[0] > 6 || ( version[0] == 5 && version[1] >= 6 )
15+
assert ! sql_mode.flatten.include?("STRICT_ALL_TABLES")
16+
else
17+
assert_equal [['']], sql_mode unless mariadb_driver?
18+
end
1319
end
1420
end
1521

0 commit comments

Comments
 (0)