Bug #22058
closedext_tables.sql Syntax
0%
Description
I extended the ext_tables.sql file of my extension by one new table, which is similar to the following definition.
CREATE TABLE `foobar` (
`uid` int(11) NOT NULL auto_increment,
`pid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL DEFAULT '0',
`crdate` int(11) NOT NULL DEFAULT '0',
`cruser_id` int(11) NOT NULL DEFAULT '0',
`deleted` tinyint(4) NOT NULL DEFAULT '0',
`hidden` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`),
KEY `parent` (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
As a matter of fact the extension manager will not create this table. The problem are two spaces between "TABLE" and "`foobar`" instead of one. Even if ext_tables.sql is not meant to be fully MySQL compatible, this is quite annoying, especially when the SQL code is created automatically as it is in my case.
The reason for this restrictive behaviour is the explode() function in line 306 in the getFieldDefinitions_fileContent() method in t3lib/class.t3lib_install.php. What about replacing it with a more compliable preg_split("/\s+/",$value)?
(issue imported from #M13423)
Files