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
Updated by Joachim Mathes almost 15 years ago
Instead of preg_split("/\s+/",$value) it might be more appropriate to use t3lib_div::trimExplode(' ', $value, 1).
Updated by Chris topher almost 15 years ago
Hi Joachim ,
to get your patch discussed and finally included, send it to the TYPO3-core-list!
Check out:
http://typo3.org/development/bug-fixing/mailing-list/
http://typo3.org/teams/core/core-mailinglist-rules/
Updated by Benni Mack over 14 years ago
committed to trunk (rev. 6943)
committed to TYPO3_4-3 (rev. 6944)