I found a bug in the latest drupal-4.2.0-rc.tgz being offered on the drupal.org website invloving the node tables.
I also fixed this as it was pissing me off big time when trying to figure out why extremely long story submissions would display with paragraphs truncated, mixed up, and even duplicated after submission and preview.
The problem is the MySQL field type for the body field in the table for "node" is shipped as 'text'. This is fine and dandy for the teaser field, but on stories longer than 65535 characters it becomes a problem.
Changing it to 'longtext' only for the 'body' column saolces the problem of longer articles being displayed properly. By using 'longtext' instead of 'text' the maximum is increased to 4294967295 characters..thus allowing for full length stories.
This is the corrected table structure. Please replace the one you guys ship with with this one instead and allow longer content writers to submit in-depth stories.
CREATE TABLE `node` (
`nid` int(10) unsigned NOT NULL auto_increment,
`type` varchar(16) NOT NULL default '',
`title` varchar(128) NOT NULL default '',
`score` int(11) NOT NULL default '0',
`votes` int(11) NOT NULL default '0',
`uid` int(10) NOT NULL default '0',
`status` int(4) NOT NULL default '1',
`created` int(11) NOT NULL default '0',
`comment` int(2) NOT NULL default '0',
`promote` int(2) NOT NULL default '0',
`moderate` int(2) NOT NULL default '0',
`users` text NOT NULL,
`attributes` varchar(255) NOT NULL default '',
`teaser` text NOT NULL,
`body` longtext NOT NULL,
`changed` int(11) NOT NULL default '0',
`revisions` text NOT NULL,
`static` int(2) NOT NULL default '0',
PRIMARY KEY (`nid`),
KEY `type` (`type`),
KEY `title` (`title`,`type`),
KEY `promote` (`promote`),
KEY `status` (`status`),
KEY `uid` (`uid`),
FULLTEXT KEY `body` (`body`)
) TYPE=MyISAM AUTO_INCREMENT=5 ;
Cheers,
Zoom
Comments
Comment #1
marco commented+1
but I'd use mediumtext: 2^24 chars seem enough to me, longtext allows for 2^32
Comment #2
dries commentedComment #3
dries commentedFixed in both the DRUPAL-4-2-0 and HEAD branch. Closing this report.
Comment #4
adrian commentedclosing again, dries has stated it has been fixed in 4.2.0 and HEAD branches
Comment #5
teledyn commented>>>>> "a" == adrian writes:
a> closing again, dries has stated it has been fixed in 4.2.0 and
a> HEAD branches
There's no update in the HEAD branch to migrate body to a longtext (or
even mediumtext), although the database.mysql does change node.body to
a mediumtext field.