public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/JackDanger/rails.git
Search Repo:
 r3457@asus:  jeremy | 2005-12-13 08:52:39 -0800
 Apply [3293] to stable.  MySQL: allow encoding option for mysql.rb 
 driver.


git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/stable@3295 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
jeremy (author)
Tue Dec 13 09:34:00 -0800 2005
commit  2670371690cc2a00ded62a636d0bb706013c25a0
tree    b340ca8cdd2cb335c969cee96170979f9f2924be
parent  5da86f8c27dc9df4bcce0ba88adb67cac5af4ca8
...
 
1
2
3
4
 
 
5
6
7
...
1
2
3
4
5
6
7
8
9
10
0
@@ -1,7 +1,10 @@
0
+*
0
 *1.13.2* (December 13th, 2005)
0
 
0
 * Become part of Rails 1.0
0
 
0
+* MySQL: allow encoding option for mysql.rb driver. [Jeremy Kemper]
0
+
0
 * MySQL: fixes for the bundled mysql.rb driver. #3160 [Justin Forder]
0
 
0
 * MySQL, PostgreSQL: reconnect! also reconfigures the connection. Otherwise, the connection 'loses' its settings if it times out and is reconnected. #2978 [Shugo Maeda]
...
311
312
313
314
315
316
317
318
 
319
320
321
...
311
312
313
 
 
 
 
 
314
315
316
317
0
@@ -311,11 +311,7 @@ module ActiveRecord
0
         def connect
0
           encoding = @config[:encoding]
0
           if encoding
0
- begin
0
- @connection.options(Mysql::SET_CHARSET_NAME, encoding)
0
- rescue
0
- raise ActiveRecord::ConnectionFailed, 'The :encoding option is only available for MySQL 4.1 and later with the mysql-ruby driver. Again, this does not work with the ruby-mysql driver or MySQL < 4.1.'
0
- end
0
+ @connection.options(Mysql::SET_CHARSET_NAME, encoding) rescue nil
0
           end
0
           @connection.real_connect(*@connection_options)
0
           execute("SET NAMES '#{encoding}'") if encoding

Comments

    No one has commented yet.