PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.authmap' doesn't exist: SELECT authname FROM {authmap} WHERE module = :module AND uid = :uid; Array#012(#012 [:module] => openid#012 [:uid] => 2#012)#012 in _mollom_get_openid() (line 1258 of /var/www/sites/all/modules/mollom/mollom.module).

That’s what I get in my syslog and my authors see the maintenance page when they try to delete a comment. The authmap table doesn’t exist in a standard Drupal 7 installation. I have no clue if it exist if OpenID is installed. I guess you have to implement a check against the OpenID module before querying the database.

Regards
Richard

Comments

sun’s picture

Status: Active » Closed (cannot reproduce)

The authmap table is defined and installed by Drupal core's User module:
http://drupalcode.org/project/drupal.git/blob/refs/heads/7.x:/modules/us...

If that table does not exist on your site, then something must have gone horribly wrong at some point. Perhaps the table was forgotten in a backup/restore procedure. In any case, the table always existed, and was always defined and installed by User module (since at least Drupal 5).

fleshgrinder’s picture

Thanks, seems like something went wrong here some time ago and I never noticed because I don't need that table. If someone else runs into that problem, here's the SQL code for Drupal 7 to re-create it:

SET FOREIGN_KEY_CHECKS=0;

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

SET AUTOCOMMIT=0;
START TRANSACTION;

CREATE TABLE IF NOT EXISTS `authmap` (
  `aid` int(10) unsigned NOT NULL auto_increment COMMENT 'Primary Key: Unique authmap ID.',
  `uid` int(11) NOT NULL default '0' COMMENT 'User’s users.uid.',
  `authname` varchar(128) NOT NULL default '' COMMENT 'Unique authentication name.',
  `module` varchar(128) NOT NULL default '' COMMENT 'Module which is controlling the authentication.',
  PRIMARY KEY  (`aid`),
  UNIQUE KEY `authname` (`authname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores distributed authentication mapping.' AUTO_INCREMENT=1 ;

SET FOREIGN_KEY_CHECKS=1;

COMMIT;