Invalid SQL create table statement

aaronsb - August 13, 2009 - 21:49
Project:Mailing List Archive
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Enabling the module "Mail Archive" fails to create table. Error is below:

user warning: BLOB/TEXT column 'headers' can't have a default value query: CREATE TABLE mailarchive_messages ( mid int(11) UNSIGNED AUTO_INCREMENT, sid int(11) UNSIGNED NOT NULL DEFAULT '0', status int(2) UNSIGNED NOT NULL DEFAULT '0', created int(11) UNSIGNED NOT NULL DEFAULT '0', received int(11) UNSIGNED NOT NULL DEFAULT '0', year int(4) UNSIGNED NOT NULL DEFAULT '0', month int(2) UNSIGNED NOT NULL DEFAULT '0', day int(2) UNSIGNED NOT NULL DEFAULT '0', headers text NOT NULL DEFAULT '', message_id varchar(255) NOT NULL DEFAULT '', reference varchar(255) NOT NULL DEFAULT '', in_reply_to varchar(255) NOT NULL DEFAULT '', multiple_in_reply_to int(1) NOT NULL DEFAULT '0', thread_id int(11) UNSIGNED NOT NULL DEFAULT '0', sub_thread_id varchar(255) NOT NULL DEFAULT '0', mailfrom varchar(255) NOT NULL DEFAULT '', subject varchar(255) NOT NULL DEFAULT '', body text NOT NULL DEFAULT '', attachments int(3) UNSIGNED DEFAULT '0', attachments_path varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (mid), UNIQUE (sid, message_id), KEY (status), KEY (created), KEY (received), KEY (year), KEY (month), KEY (day), KEY (message_id), KEY (thread_id), KEY (sub_thread_id), KEY (subject) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in E:\websites\drupalimporter\modules\mailarchive\mailarchive.install on line 72.

I am able to create the table successfully with the following sql statement, where I have removed the default of ' ' for headers and body.

CREATE TABLE mailarchive_messages ( mid int(11) UNSIGNED AUTO_INCREMENT, sid int(11) UNSIGNED NOT NULL DEFAULT '0', status int(2) UNSIGNED NOT NULL DEFAULT '0', created int(11) UNSIGNED NOT NULL DEFAULT '0', received int(11) UNSIGNED NOT NULL DEFAULT '0', year int(4) UNSIGNED NOT NULL DEFAULT '0', month int(2) UNSIGNED NOT NULL DEFAULT '0', day int(2) UNSIGNED NOT NULL DEFAULT '0', headers text NOT NULL, message_id varchar(255) NOT NULL DEFAULT '', reference varchar(255) NOT NULL DEFAULT '', in_reply_to varchar(255) NOT NULL DEFAULT '', multiple_in_reply_to int(1) NOT NULL DEFAULT '0', thread_id int(11) UNSIGNED NOT NULL DEFAULT '0', sub_thread_id varchar(255) NOT NULL DEFAULT '0', mailfrom varchar(255) NOT NULL DEFAULT '', subject varchar(255) NOT NULL DEFAULT '', body text NOT NULL, attachments int(3) UNSIGNED DEFAULT '0', attachments_path varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (mid), UNIQUE (sid, message_id), KEY (status), KEY (created), KEY (received), KEY (year), KEY (month), KEY (day), KEY (message_id), KEY (thread_id), KEY (sub_thread_id), KEY (subject) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

Database: MySQL 5.1.37, using engine MyISAM

#1

aaronsb - August 13, 2009 - 22:54
Component:User interface» Code

This should probably component:code.

 
 

Drupal is a registered trademark of Dries Buytaert.