未验证 提交 924a368f 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Drop mysql2 version less than 0.4.3 to guarantee fork safety (#31244)

Since #31173, mysql2 adapter depends on `automatic_close` which is
introduced since mysql2 0.4.3. So the adapter with the mysql2 version
before doesn't work with fork now.

```
% ARCONN=mysql2 be ruby -w -Itest test/cases/connection_adapters/connection_handler_test.rb -n test_forked_child_doesnt_mangle_parent_connection
Using mysql2
Run options: -n test_forked_child_doesnt_mangle_parent_connection --seed 19988

/Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:108:in `discard!': undefined method `automatic_close=' for #<Mysql2::Client:0x00007fedaa91dfd0> (NoMethodError)
```

This drops mysql2 version less than 0.4.3 to guarantee fork safety.
上级 c22ec971
......@@ -3,7 +3,7 @@
require "active_record/connection_adapters/abstract_mysql_adapter"
require "active_record/connection_adapters/mysql/database_statements"
gem "mysql2", ">= 0.3.18", "< 0.5", "!= 0.4.3"
gem "mysql2", "~> 0.4.4"
require "mysql2"
module ActiveRecord
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册