Hm, yeah. That's pretty much exactly what I ended up doing. I actually ended up patching ActiveRecord to allow me to specify a my.cnf file in my database.yml so I could set *any* MySQL option and not just OPT_LOCAL_INFILE. In my my.cnf I have local-infile under [client]. Everything seems to work fine now. It seems pretty silly that ActiveRecord doesn't allow you to set the low-level options on the MySQL adapter... See attached patch.

About getting your patch of connect to be executed... At first glance, it looks like it should work just fine. The other methods are being defined properly and all... Maybe it's loading *before* the actual MysqlAdapter so connect gets overridden by the one from ActiveRecord?

- Brandon

On Dec 22, 2007, at 20:45, Anthony Eden wrote:

Unfortunately it looks like there was some change in 2.0 (I haven't
tracked it down yet as to when the change occurred) however the
private connect method in AdapterExtensions mysql_adapter.rb is no
longer being called. If I patch Rails with the attached patch then I
can execute the tests without any problems. If anyone has any good
ideas on how to properly override the connect method of
mysql_adapter.rb then please feel free to speak up.

V/r
Anthony Eden

On Dec 20, 2007 1:39 PM, Anthony Eden <[EMAIL PROTECTED]> wrote:
It might be that the Rails version is using the mysql adapter that
comes with Rails, which is a pure Ruby implementation that has a
maximum limit to the number of bytes it can ship over the wire.

This problem has come up a couple of times, so I finally pulled the
content from emails I had sent to individuals and posted in on my
blog:

http://anthonyeden.com/2007/12/20/mysql-bulk-load-with-pure-mysql-driver-in-rails

V/r
Anthony Eden


On 12/20/07, Brandon Dimcheff <[EMAIL PROTECTED]> wrote:
I'm trying to add a couple features to the the adapter extensions, but
I can't seem to get a few of the tests to run.  For instance,
test_bulk_load throws:

Mysql::Error: The used command is not allowed with this MySQL version: LOAD DATA LOCAL INFILE './test/integration/people.txt' INTO TABLE people

According to pretty much whatever I've read, this is caused by local- infile being disabled on either the client or server side. I can run
the query in the mysql command line client, so it must be something
fishy with ActiveRecord.  The strange thing is, I can run that same
query in script/console in my activewarehouse-based project and it
executes just fine. I just can't seem to figure out what's different about the way ActiveRecord is being used in these tests vs. in a rails
app...

Any ideas?

Thanks,
Brandon
_______________________________________________
Activewarehouse-discuss mailing list
Activewarehouse-discuss@rubyforge.org
http://rubyforge.org/mailman/listinfo/activewarehouse-discuss


<mysql_adapter_opt_local_infile.diff>

Attachment: config_file_support.patch
Description: Binary data

_______________________________________________
Activewarehouse-discuss mailing list
Activewarehouse-discuss@rubyforge.org
http://rubyforge.org/mailman/listinfo/activewarehouse-discuss

Reply via email to