<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -35,6 +35,18 @@ module ActiveRecord #:nodoc:
       # * &lt;tt&gt;:enclosed_by&lt;/tt&gt; -- The field enclosure
       def do_bulk_load(file, table_name, options={})
         return if File.size(file) == 0
+
+        # an unfortunate hack - setting the bulk load option after the connection has been 
+        # established does not seem to have any effect, and since the connection is made when 
+        # active-record is loaded, there's no chance for us to sneak it in earlier. So we 
+        # disconnect, set the option, then reconnect - fortunately, this only needs to happen once.
+        unless @bulk_load_enabled
+          disconnect!
+          @connection.options(Mysql::OPT_LOCAL_INFILE, true)
+          connect
+          @bulk_load_enabled = true
+        end
+
         q = &quot;LOAD DATA LOCAL INFILE '#{file}' INTO TABLE #{table_name}&quot;
         if options[:fields]
           q &lt;&lt; &quot; FIELDS&quot;</diff>
      <filename>lib/adapter_extensions/connection_adapters/mysql_adapter.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>mysql_adapter_opt_local_infile.patch</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>b4d9f42a3c18d1d903bbd7b49356e770d2a80b30</id>
    </parent>
  </parents>
  <author>
    <name>Darin Wilson</name>
    <email>darinwilson@yahoo.com</email>
  </author>
  <url>http://github.com/aeden/adapter_extensions/commit/ffb8e3afc4fe6f1bff55b9bc630b351dd38b8936</url>
  <id>ffb8e3afc4fe6f1bff55b9bc630b351dd38b8936</id>
  <committed-date>2008-11-11T16:53:47-08:00</committed-date>
  <authored-date>2008-11-11T16:53:47-08:00</authored-date>
  <message>Set bulk load option for MySQL automatically

Previously, ActiveRecord had to be patched manually to make the bulk load optionwork correct - now it happens within AdapterExtensions itself</message>
  <tree>170a6d188a7ac8eab6ad78e069605692b5267fc4</tree>
  <committer>
    <name>Darin Wilson</name>
    <email>darinwilson@yahoo.com</email>
  </committer>
</commit>
