adapter_extensions 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -23,6 +23,22 @@ module ActiveRecord #:nodoc:
|
|
23
23
|
q << " (#{options[:columns].join(',')})" if options[:columns]
|
24
24
|
execute(q)
|
25
25
|
end
|
26
|
+
|
27
|
+
private
|
28
|
+
def connect
|
29
|
+
encoding = @config[:encoding]
|
30
|
+
if encoding
|
31
|
+
@connection.options(Mysql::SET_CHARSET_NAME, encoding) rescue nil
|
32
|
+
end
|
33
|
+
@connection.options(Mysql::OPT_LOCAL_INFILE, true)
|
34
|
+
@connection.ssl_set(@config[:sslkey], @config[:sslcert], @config[:sslca], @config[:sslcapath], @config[:sslcipher]) if @config[:sslkey]
|
35
|
+
@connection.real_connect(*@connection_options)
|
36
|
+
execute("SET NAMES '#{encoding}'") if encoding
|
37
|
+
|
38
|
+
# By default, MySQL 'where id is null' selects the last inserted id.
|
39
|
+
# Turn this off. http://dev.rubyonrails.org/ticket/6778
|
40
|
+
execute("SET SQL_AUTO_IS_NULL=0")
|
41
|
+
end
|
26
42
|
end
|
27
43
|
end
|
28
44
|
end
|
metadata
CHANGED