Project

General

Profile

Actions

Bug #22058

closed

ext_tables.sql Syntax

Added by Joachim Mathes about 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2010-02-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

t3lib_install.patch (511 Bytes) t3lib_install.patch Administrator Admin, 2010-02-04 15:48
Actions #1

Updated by Joachim Mathes about 14 years ago

Instead of preg_split("/\s+/",$value) it might be more appropriate to use t3lib_div::trimExplode(' ', $value, 1).

Actions #2

Updated by Chris topher about 14 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/

Actions #3

Updated by Benni Mack about 14 years ago

committed to trunk (rev. 6943)
committed to TYPO3_4-3 (rev. 6944)

Actions

Also available in: Atom PDF