[sam] [PATCH] Amavisd_sql error

pub pub at niin.org
Sun Apr 17 13:26:11 PDT 2005


When I try to use the SQL code included in the file
'sam/scripts/sql/amavisd_sql.mysql.sql', I get this error from MySQL
(v4.1.10):

#1067 - Invalid default value for 'id'

The problem is that you can not add a default value with auto_increment


NB


Here is the patch to remove the default value:

--- amavisd_sql.mysql.sql.orig  Sun Apr 17 21:55:20 2005
+++ amavisd_sql.mysql.sql       Sun Apr 17 21:56:07 2005
@@ -2,7 +2,7 @@

-- local users
CREATE TABLE users (
-  id         int unsigned DEFAULT '0' NOT NULL auto_increment,
+  id         int unsigned NOT NULL auto_increment,
   policy_id  int unsigned DEFAULT '1' NOT NULL,
   email      varchar(255) NOT NULL,
   PRIMARY KEY (id),
@@ -12,7 +12,7 @@

-- any e-mail address, external or local, used as senders in wblist
CREATE TABLE mailaddr (
-  id         int unsigned DEFAULT '0' NOT NULL auto_increment,
+  id         int unsigned NOT NULL auto_increment,
   email      varchar(255)             NOT NULL,
   PRIMARY KEY (id),
   KEY email (email)
@@ -29,7 +29,7 @@
);

CREATE TABLE policy (
-  id                   int unsigned DEFAULT '0' NOT NULL auto_increment,
+  id                   int unsigned NOT NULL auto_increment,
   policy_name          varchar(255), -- not used by amavisd-new

   virus_lover          char(1),      -- Y/N




More information about the sam mailing list