rails/rails — Issue #4139: Mysql "LOAD DATA LOCAL INFILE" does not work after reconnect
Author: ngan
Created: 2011-12-23 04:06:34+00:00
State: open

Hi, I'm on Rails 2.3.8, but I think this problem affects Rails 3.x as well.

After using `ActiveRecord::Base.verify_active_connections!` after the mysql going away, or even a manual disconnect, I cannot seem to do a "LOAD DATA INFILE" query. I get an error from MySQL: "ActiveRecord::StatementInvalid: Mysql::Error: The used command is not allowed with this MySQL version"

Yes, I have checked permissions and what not. I can do the LOAD DATA INFILE before the reconnect.

To duplicate, simply boot up console:

```
ActiveRecord::Base.connection.disconnect! ActiveRecord::Base.verify_active_connections! ActiveRecord::Base.connection.execute("LOAD DATA INFILE '/tmp/some_file.txt' INTO some_table")
```