Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

NoMethodError: undefined method `fetch_fields' for nil:NilClass: BEGIN

#6236

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:

  1. The error seems to have been introduced by this commit: https://github.com/rails/rails/commit/efc10a8a64d5748bc8355c0bd0373.... Changing exec_without_stmt back to execute prevents it.

  2. 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 for Mysql::Error or Mysql2::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

Reported by Jon Leighton · December 30th, 2010 @ 10:55 PM

State: resolved
Milestone: 3.x
Assigned to: Aaron Patterson Aaron Patterson
Importance: Low