Skip to content

Commit

Permalink
Deterministic connection collation in tests
Browse files Browse the repository at this point in the history
The default collation for utf8mb4 is changed to utf8mb4_0900_ai_ci in
MySQL 8.0, so `test_mysql_connection_collation_is_configured` is
affected by MySQL version and/or default_collation_for_utf8mb4 system
variable.

https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_collation_for_utf8mb4

```
% ARCONN=mysql2 be ruby -w -Itest test/cases/adapters/mysql2/connection_test.rb -n test_mysql_connection_collation_is_configured
Using mysql2
Run options: -n test_mysql_connection_collation_is_configured --seed 10421

# Running:

F

Failure:
Mysql2ConnectionTest#test_mysql_connection_collation_is_configured [test/cases/adapters/mysql2/connection_test.rb:108]:
Expected: "utf8mb4_general_ci"
  Actual: "utf8mb4_0900_ai_ci"

rails test test/cases/adapters/mysql2/connection_test.rb:106

Finished in 0.013842s, 72.2450 runs/s, 144.4900 assertions/s.
1 runs, 2 assertions, 1 failures, 0 errors, 0 skips
```
  • Loading branch information
kamipo committed Oct 25, 2018
1 parent d76d66f commit 3c00087
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions activerecord/test/config.example.yml
Expand Up @@ -59,6 +59,7 @@ connections:
arunit2:
username: rails
encoding: utf8mb4
collation: utf8mb4_general_ci

oracle:
arunit:
Expand Down

0 comments on commit 3c00087

Please sign in to comment.