Changeset 3246
- Timestamp:
- 12/08/05 05:07:45 (3 years ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r3244 r3246 1 1 *SVN* 2 3 * MySQL: more robust test for nullified result hashes. #3124 [Stefan Kaes] 2 4 3 5 * SQLite: find database file when RAILS_ROOT is a symlink. #3116 [anna@wota.jp] trunk/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
r3216 r3246 9 9 begin 10 10 require_library_or_gem 'mysql' 11 # The C version of mysql returns null fields in each_hash if Mysql::VERSION is defined12 ConnectionAdapters::MysqlAdapter.null_values_in_each_hash = Mysql.const_defined?(:VERSION)13 11 rescue LoadError => cannot_require_mysql 14 12 # Only use the supplied backup Ruby/MySQL driver if no driver is already in place 15 13 begin 16 14 require 'active_record/vendor/mysql' 17 # The ruby version of mysql returns null fields in each_hash18 ConnectionAdapters::MysqlAdapter.null_values_in_each_hash = true19 15 rescue LoadError 20 16 raise cannot_require_mysql … … 78 74 cattr_accessor :emulate_booleans 79 75 80 cattr_accessor :null_values_in_each_hash81 @@null_values_in_each_hash = false82 83 76 LOST_CONNECTION_ERROR_MESSAGES = [ 84 77 "Server shutdown in progress", … … 91 84 super(connection, logger) 92 85 @connection_options = connection_options 86 @null_values_in_each_hash = Mysql.const_defined?(:VERSION) 93 87 @config = config 94 88 connect … … 333 327 result = execute(sql, name) 334 328 rows = [] 335 if @ @null_values_in_each_hash329 if @null_values_in_each_hash 336 330 result.each_hash { |row| rows << row } 337 331 else