Issue Bug Closed

#24472Install complains about default values in ext_tables.sql

Christian Futterlieb 01/04/11, 15:05 updated 07/10/14, 15:50

Description

When a field with a datatype which is not blob or text has NULL as default value, the extension manager ( or install tool db compare) treats the default value as ‘’.

For example:

ext_tables.sql:

CREATE TABLE category (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT ‘0’ NOT NULL,
parent_category_uid int(11),
name varchar(255) DEFAULT ‘’ NOT NULL,

FOREIGN KEY (parent_category_uid) REFERENCES category(uid) ON DELETE CASCADE,
PRIMARY KEY (uid),
KEY parent (pid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DESCRIBE category:

Field | Type | Null | Key | Default | Extra
..
parent_category_uid | int(11) | YES | MUL | NULL |
..

Back in extension manager:

ALTER TABLE category CHANGE parent_category_uid parent_category_uid int(11);
Current value: int(11) default ‘’

Attached patch prevents generating [default ‘’] on fields which have NULL as default value.

Tested and working (only) on my sytem:
Ubuntu 10.10
PHP 5.3.3
Apache 2.2.16
MySQL 5.1.49
TYPO3 4.4.6

I don’t know if there raise any unwished influences (dbal?).

(issue imported from #M16912)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.