You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2011/06/23 19:48:49 UTC

svn commit: r1139015 - in /spamassassin/trunk/sql: README.bayes awl_mysql.sql bayes_mysql.sql

Author: mmartinec
Date: Thu Jun 23 17:48:49 2011
New Revision: 1139015

URL: http://svn.apache.org/viewvc?rev=1139015&view=rev
Log:
Bug 6626: Newer MySQL chokes on TYPE=MyISAM syntax

Modified:
    spamassassin/trunk/sql/README.bayes
    spamassassin/trunk/sql/awl_mysql.sql
    spamassassin/trunk/sql/bayes_mysql.sql

Modified: spamassassin/trunk/sql/README.bayes
URL: http://svn.apache.org/viewvc/spamassassin/trunk/sql/README.bayes?rev=1139015&r1=1139014&r2=1139015&view=diff
==============================================================================
--- spamassassin/trunk/sql/README.bayes (original)
+++ spamassassin/trunk/sql/README.bayes Thu Jun 23 17:48:49 2011
@@ -17,27 +17,37 @@ The directives required to turn on the S
 bayes_store_module		   Mail::SpamAssassin::BayesStore::SQL
 
 This directive is used by the Bayes module to determine which storage
-module should be used.  If not set it will default to:
+module should be used. If not set it will default to:
 Mail::SpamAssassin::BayesStore::DBM
 
+The storage module Mail::SpamAssassin::BayesStore::SQL is an older generic
+SQL module which can be also be used with versions of MySQL which did not
+have support for an InnoDB engine and transactions. If choosing this module
+consider replacing the InnoDB engine with MyISAM (explicitly or defaulted)
+in the schema (files bayes_mysql.sql and awl_mysql.sql). Note that old
+versions of MySQL expect syntax TYPE=MyISAM instead of ENGINE=MyISAM,
+while newer versions throw a syntax error on TYPE and only allow ENGINE.
+In short: replace ENGINE=InnoDB with TYPE=MyISAM (or just leave it out)
+in the bayes_mysql.sql and awl_mysql.sql schemas if ENGINE=InnoDB is not
+accepted.
+
+There is also a MySQL specific storage driver available to provides a
+small boost in performance.  It requires version 4.1 or above of the
+MySQL database software to work properly.  In addition, it provides
+rollback on error functionality if you create your bayes database table
+using the InnoDB storage engine. WARNING: Using this module with a version
+of MySQL < 4.1 could have unexpected results.  To use the MySQL 4.1+
+specific module set your bayes_store_module directive accordingly:
+  bayes_store_module               Mail::SpamAssassin::BayesStore::MySQL
+
 PostgreSQL users will want to use the PostgreSQL specific storage
 module:
-bayes_store_module               Mail::SpamAssassin::BayesStore::PgSQL
+  bayes_store_module               Mail::SpamAssassin::BayesStore::PgSQL
 This module provides a slightly different interface to makes better
 use of the resources that PostgreSQL offers.  In addition, please make
 sure that you follow the instructions below for loading the proper
 procedural language and installing the tables and stored procedure.
 
-There is also a MySQL specific storage driver available to provides a
-small boost in performance.  It requires version 4.1 or above of the
-MySQL database software to work properly.  In addition, it provides
-rollback on error functionality if you create your bayes database
-table using the InnoDB storage engine (ie s/MyISAM/InnoDB/ on the
-bayes_mysql.sql file).  WARNING: Using this module with a version of
-MySQL < 4.1 could have unexpected results.  To use the MySQL 4.1+
-specific module set your bayes_store_module directive accordingly:
-bayes_store_module               Mail::SpamAssassin::BayesStore::MySQL
-
 Additional configuration directives provided by BayesSQL:
 
 bayes_sql_dsn			   DBI:driver:database:hostname[:port]

Modified: spamassassin/trunk/sql/awl_mysql.sql
URL: http://svn.apache.org/viewvc/spamassassin/trunk/sql/awl_mysql.sql?rev=1139015&r1=1139014&r2=1139015&view=diff
==============================================================================
--- spamassassin/trunk/sql/awl_mysql.sql (original)
+++ spamassassin/trunk/sql/awl_mysql.sql Thu Jun 23 17:48:49 2011
@@ -1,9 +1,9 @@
 CREATE TABLE awl (
   username varchar(100) NOT NULL default '',
-  email varchar(255) NOT NULL default '',
+  email varbinary(255) NOT NULL default '',
   ip varchar(40) NOT NULL default '',
   count int(11) NOT NULL default '0',
   totscore float NOT NULL default '0',
   signedby varchar(255) NOT NULL default '',
   PRIMARY KEY (username,email,signedby,ip)
-) TYPE=MyISAM;
+) ENGINE=InnoDB;

Modified: spamassassin/trunk/sql/bayes_mysql.sql
URL: http://svn.apache.org/viewvc/spamassassin/trunk/sql/bayes_mysql.sql?rev=1139015&r1=1139014&r2=1139015&view=diff
==============================================================================
--- spamassassin/trunk/sql/bayes_mysql.sql (original)
+++ spamassassin/trunk/sql/bayes_mysql.sql Thu Jun 23 17:48:49 2011
@@ -3,13 +3,13 @@ CREATE TABLE bayes_expire (
   id int(11) NOT NULL default '0',
   runtime int(11) NOT NULL default '0',
   KEY bayes_expire_idx1 (id)
-) TYPE=MyISAM;
+) ENGINE=InnoDB;
 
 CREATE TABLE bayes_global_vars (
   variable varchar(30) NOT NULL default '',
   value varchar(200) NOT NULL default '',
   PRIMARY KEY  (variable)
-) TYPE=MyISAM;
+) ENGINE=InnoDB;
 
 INSERT INTO bayes_global_vars VALUES ('VERSION','3');
 
@@ -18,7 +18,7 @@ CREATE TABLE bayes_seen (
   msgid varchar(200) binary NOT NULL default '',
   flag char(1) NOT NULL default '',
   PRIMARY KEY  (id,msgid)
-) TYPE=MyISAM;
+) ENGINE=InnoDB;
 
 CREATE TABLE bayes_token (
   id int(11) NOT NULL default '0',
@@ -28,7 +28,7 @@ CREATE TABLE bayes_token (
   atime int(11) NOT NULL default '0',
   PRIMARY KEY  (id, token),
   INDEX bayes_token_idx1 (id, atime)
-) TYPE=MyISAM;
+) ENGINE=InnoDB;
 
 CREATE TABLE bayes_vars (
   id int(11) NOT NULL AUTO_INCREMENT,
@@ -43,4 +43,4 @@ CREATE TABLE bayes_vars (
   newest_token_age int(11) NOT NULL default '0',
   PRIMARY KEY  (id),
   UNIQUE bayes_vars_idx1 (username)
-) TYPE=MyISAM;
+) ENGINE=InnoDB;