Ticket #3739: md.diff
| File md.diff, 1.5 kB (added by anonymous, 3 years ago) |
|---|
-
activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
old new 33 33 end 34 34 35 35 mysql = Mysql.init 36 mysql.reconnect = 1 36 37 mysql.ssl_set(config[:sslkey], config[:sslcert], config[:sslca], config[:sslcapath], config[:sslcipher]) if config[:sslkey] 37 38 ConnectionAdapters::MysqlAdapter.new(mysql, logger, [host, username, password, database, port, socket], config) 38 39 end … … 177 178 end 178 179 179 180 def execute(sql, name = nil, retries = 2) #:nodoc: 181 repeat = 1 180 182 log(sql, name) { @connection.query(sql) } 181 183 rescue ActiveRecord::StatementInvalid => exception 182 if exception.message.split(":").first =~ /Packets out of order/ 184 if repeat && LOST_CONNECTION_ERROR_MESSAGES.include?(exception.message.split(": ").at(1)) 185 reconnect! 186 --repeat 187 retry 188 elsif exception.message.split(":").first =~ /Packets out of order/ 183 189 raise ActiveRecord::StatementInvalid, "'Packets out of order' error was received from the database. Please update your mysql bindings (gem install mysql) and read http://dev.mysql.com/doc/mysql/en/password-hashing.html for more information. If you're on Windows, use the Instant Rails installer to get the updated mysql bindings." 184 190 else 185 191 raise