This project is archived and is in readonly mode.
NoMethodError: undefined method `fetch_fields' for nil:NilClass: BEGIN
Reported by Jon Leighton | December 30th, 2010 @ 10:55 PM | in 3.x
This is showing up in the debug.log when running the Active Record tests under the mysql adapter (not mysql2).
The exception is printed to the log file by
AbstractAdapter#log
, but then caught by "rescue
Exception
" in
MysqlAdapter#begin_db_transaction
. There are two
issues here:
-
The error seems to have been introduced by this commit: https://github.com/rails/rails/commit/efc10a8a64d5748bc8355c0bd0373.... Changing
exec_without_stmt
back toexecute
prevents it. -
The error would have been more obvious if that
MysqlAdapter#begin_db_transaction
wasn't using "rescue Exception
" as a way to test for transaction support. My hunch would be that it would be sufficient to check forMysql::Error
orMysql2::Error
, depending on which driver is in use. However, I don't know this for sure and I'm not sure how to create a situation where the mysql server will throw an error indicating a lack of support for transactions, so I will defer to greater wisdom :)
Cheers
Comments and changes to this ticket
-
Repository January 7th, 2011 @ 07:49 PM
(from [2ee4c8d90b6818867ad371907cb7d3c763318c3b]) only rescue from Mysql::Error exceptions [#6236 state:resolved] https://github.com/rails/rails/commit/2ee4c8d90b6818867ad371907cb7d...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 6236 NoMethodError: undefined method `fetch_fields' for nil:NilClass: BEGIN (from [2ee4c8d90b6818867ad371907cb7d3c763318c3b]) only re...