I'm getting the following error on every page load...

There was an error collecting statistics data:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'cache' in 'field list'

I looked in the accesslog table, and didn't see a cache column. I tried turning off the cache statistics, but it didn't eliminate the error. Only when I disabled the Better Statistics module did the error go away.

Comments

emclaughlin’s picture

This is happening to me, too. I'm not sure what caused it, but I did find a fix.

In a module's install file, add an update function like this:

/**
 * Update the statistics fields.
 */
function MYMODULE_update_7005() {
  // Load the admin.inc file.
  module_load_include('inc', 'better_statistics', 'better_statistics.admin');

  // Add theset wo fields because for some reason they seem not to get added.
  better_statistics_enable_fields(array('cache''));
}

This will add the cache column back to your access_log table. If you have other fields that are erroring out, add them to the array in better_statistics_enable_fields.