My SQL Error 1101 - BLOB/TEXT cannot have default value

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
vivekjain
Forum Commoner
Posts: 76
Joined: Thu Jan 08, 2004 12:38 am

My SQL Error 1101 - BLOB/TEXT cannot have default value

Post by vivekjain »

Hi,
I am developing an application using PHP and MySQL. I had an older version of MySQL - 4.0 and installed Joomla CMS and it installed smoothly. I upgraded the MySQL version to the newer one - 5.1 and when I run the same Joomla installer, it gives me this error, when it tries to set up the database:

My SQL Error 1101 - BLOB/TEXT cannot have default value

Any idea why this may happen?

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's trying to apply a default value to a text/blob field. :?
vivekjain
Forum Commoner
Posts: 76
Joined: Thu Jan 08, 2004 12:38 am

My SQL Error

Post by vivekjain »

Yeah, noticed that, but the same thing worked with the previous version of MySQL.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's possible the behaviour could have been changed between versions.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

joomla.sql wrote:CREATE TABLE `#__poll_data` (
`id` int(11) NOT NULL auto_increment,
`pollid` int(4) NOT NULL default '0',
`text` text NOT NULL default '',
`hits` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `pollid` (`pollid`,`text`(1))
) TYPE=MyISAM;
only until mysql 5 the invalid default '' has been ignored. You cannot define a default value for text and blob fields, not even ''.
Post Reply