Error in the database table definition

pauleH - December 18, 2007 - 02:02
Project:Custom filter
Version:5.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi everybody,

I´m not sure if this is right, but since the module was not automatically installed, I looked at the .install file and tried the queries by hand, the result was that my MySQL 4.0.24 DB did not accept the code. boolean was not recognized as a valid type so I tried bool. This worked.

So my suggested code change to make it work on mysql 4 is the following:

$result[] = db_query("CREATE TABLE {customfilter_set} (
        `sid` int(10) unsigned NOT NULL default '0',
        `name` varchar(32) NOT NULL default '',
        `cache` bool NOT NULL default '1',
        `description` text,
        `shorttips` text,
        `longtips` text);");

      $result[] = db_query("CREATE TABLE {customfilter_filter} (
        `fid` int(10) unsigned NOT NULL default '0',
        `sid` int(10) unsigned NOT NULL default '0',
        `parentid` int(10) unsigned NOT NULL default '0',
        `name` varchar(32) NOT NULL default '',
        `description` text,
        `matches` int(2) NOT NULL default '1',
        `pattern` text,
        `replacement` text,
        `func` bool NOT NULL default '0',
        `weight` int(5) NOT NULL default '0');");

Hope this helps and is not stupid :-).

#1

pauleH - December 18, 2007 - 02:05
Title:W» DB-Installation does not work automatically

#2

kiamlaluno - July 1, 2009 - 15:20
Title:DB-Installation does not work automatically» Error in the database table definition
Status:needs review» needs work

Rather than using the bool type, it would be better to use the integer type, as it is also done in Drupal 6.

#3

kiamlaluno - August 23, 2009 - 02:34
Status:needs work» fixed

A version 5.x-1.3 has been released about a month ago (if not more); I am pretty sure that version resolves this problem; therefore, I am setting this report as fixed.

If the error is still present in last version, feel free to open a new report; this report is too old, and the patch reported here is probably not applicable to the latest Drupal 5 versions.

#4

System Message - September 6, 2009 - 02:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.