I see you have one request for this issue in your bug report, but I figured I'd post here and try to give some more details/suggestions/fixes.

When enabling the module, I was delivered an error message stating that "there can be only one auto column and it must be defined as a key." The query shown was:
CREATE TABLE gotcha (mid int NOT NULL auto_increment, datestamp varchar(20) NOT NULL, suspect tinyint NOT NULL default '0', recipients longtext NOT NULL, subject varchar(255) NOT NULL, body longtext NOT NULL, sendername varchar(255) NOT NULL, sendermail varchar(255) NOT NULL, userip varchar(20), sitename varchar(255), servername varchar(255), serveraddr varchar(255), serverport varchar(10), PRIMARY KEY (datestamp)) /*!40100 DEFAULT CHARACTER SET utf8 */;

I checked the database, and confirmed that the table had not been created. FYI, I'm running Drupal 5.2, Apache, PHP 4.3.11, and (most importantly) MySQL 5.0.45.

I added two things to the db_query(): first, I set the CREATE to CREATE TABLE IF NOT EXISTS To be certain that I wasn't going to screw-up the table if it was there already, then I added KEY (mid), just above the PRIMARY KEY. I made some other slight changes like adding a $query = statement, and an if/else for reporting success or failure on the $query.

After the above mods, the install works without issue. I am attaching the *MySQL-only* .install file I modified for your reference. I hope it helps. This is an awesome module and I think it really will help Drupal users in keeping the contact-form spam to a minimum. Keep up the great work, and thanks!

CommentFileSizeAuthor
gotcha.install.txt1.53 KBZrO-1
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NancyDru’s picture

Assigned: Unassigned » NancyDru
Status: Active » Fixed

I am committing some changes which will include this fix. Actually, "mid" is now the primary key and "userip" is a secondary index. "Datestamp" is no longer an index. Make sure you run both update_5101 and update_5102.

NancyDru’s picture

You may still encounter an error, depending on several factors. The end result should be that the "mid" column should be the primary key and there should be an index on "userip". If these exist, then ignore any further errors, or completely uninstall and re-install the module.

If anyone has Postgres problems, please let me know and suggest how to correct them.

Anonymous’s picture

Status: Fixed » Closed (fixed)