Installing this on a live postgres fails to to bad syntax on INT - using INT(10) does not work. This has been addressed before in previous versions but for some reason it is still an issue.
Here are the errors:
warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "(" LINE 3: uid int(10) NOT NULL default 0, ^ in /var/www/sparcs/includes/database.pgsql.inc on line 139.
user warning: query: CREATE TABLE fupload_previewlist ( fieldname varchar(32) NOT NULL default '', uid int(10) NOT NULL default 0, nid int(10) NOT NULL default 0, fid int(11) default 0, created int(11) NOT NULL default 0, PRIMARY KEY (fid) ) in /var/www/sparcs/includes/database.inc on line 515.
warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "fupload_previewlist" does not exist in /var/www/sparcs/includes/database.pgsql.inc on line 139.
user warning: query: CREATE INDEX fupload_previewlist_fieldname_idx ON fupload_previewlist (fieldname) in /var/www/sparcs/includes/database.inc on line 515.
warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "fupload_previewlist" does not exist in /var/www/sparcs/includes/database.pgsql.inc on line 139.
user warning: query: CREATE INDEX fupload_previewlist_uid_idx ON fupload_previewlist (uid) in /var/www/sparcs/includes/database.inc on line 515.
There is a security update available for your version of Drupal. To ensure the security of your server, you should update immediately! See the available updates page for more information.
removing the (10) sizes solved it for me, or perhaps using the tiny, big etc conventions.
this worked for me:
CREATE TABLE fupload_previewlist ( fieldname varchar(32) NOT NULL default '', uid int NOT NULL default 0, nid int NOT NULL default 0, fid int default 0, created int NOT NULL default 0, PRIMARY KEY (fid));
CREATE INDEX fupload_previewlist_fieldname_idx ON fupload_previewlist (fieldname) ;
CREATE INDEX fupload_previewlist_uid_idx ON fupload_previewlist (uid) ;
Comments
Comment #1
grandcat commentedThank you for the detailed report.
Comment #2
ronhoogwater commentedHello,
As described in http://api.drupal.org/api/group/schemaapi/6 the 'field' attribute in hook_schema() should only be used for types varchar and text. In the image_fupload module I found it defined for int also.
I removed the field attributes in this (quick) patch. I tested it on my installation: drupal 6.13 with a postgresql database. I tested only once and not on a clean installation.
I think it is a bug in the core also. The referenced page says the field attribute is ignored for other types than varchar and text, but that is not true (http://api.drupal.org/api/function/_db_create_field_sql/6).
Hope this helps,
Ron
Comment #3
nardberjean commentedbase FUpload + FUpload cck
with MySQL 5 and the Schema module 6.x-1.6
admin/build/schema shows:
I do not know if it is related. I am asking me if the same patch can be applied?
Comment #4
Thomas_Zahreddin commentedalso another error with fid and index
fixed with this patch
Comment #5
blackice2999 commentedi have tested this patch and it´s works without problems. Thanks to User
Comment #6
grandcat commentedThanks to all. Now committed to HEAD.
Comment #8
nardberjean commentedAdding the schema tag...
Comment #9
nardberjean commentedWith MySQL 5 I still observ this:
fupload_previewlist
column fid - difference on: not null
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'not null' => FALSE, 'default' => 0)
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'not null' => TRUE, 'default' => 0)
I took the version in dev which I understand should contain the proposed patch.