Bug #25067
closed
Add compatibility with MySQL 5.5: Replace "TYPE" with "ENGINE"
Added by Christian Hernmarck almost 14 years ago.
Updated about 11 years ago.
Description
Problem:
When using MySQL 5.5 or newer you cannot install the default tables in the install tool. Trying to create them the install tool uses the "type" table option to specify the table storage engine. This option is no longer supported in MySQL 5.5.
Error message:
"Removed Features:
The TYPE table option to specify the storage engine for CREATE TABLE or ALTER TABLE (use ENGINE)."
Fix:
Change the sqlparser (class.t3lib_sqlparser.php): Do not use "TYPE", but "ENGINE".
line 1823:
// Make query:
$query = 'CREATE TABLE ' . $components['TABLE'] . ' (
' . implode(',
', $fieldsKeys) . '
)' . ($components['tableType'] ? ' TYPE=' . $components['tableType'] : '');
(issue imported from #M17629)
Hi Christian,
I have recently tried this with the Introduction Package and creating the new database tables there worked.
BUT: In MySQL 5.5 the tables are by default created as InnoDB. In many cases we decided to use MyISAM. We should discuss, if we should (silently) let that change happen or if we should define the table engine somehow explicitly.
Well - to be exact:
some tables were created - the ones without engine definition... - but obviously they were all created as innodb (as you stated right).
For me this are two "problems":
- default storage engine
- keyword to define storage engine
of course its possible to deal both in one step. It would make sense to add a "ENGINE = MyISAM" where no ENGINE is given....
I don't know if we should go on using MyISAM. Maybe they improved InnoDB so that it might make sense to change? I don't know...
Can you open a thread concerning that question in the news groups? Best in the dev list.
Guys like Masi, Dmitry or Christian Kuhn should know what to do. :-)
It seems to work with the 1-2-3 mode of the install tool (maybe it's another function since all tables are created without a compare before)...
- Target version changed from 0 to 4.5.17
Had the same problem trying to install 4.5 LTS on Windows with MySQL 5.5.
It seems the syntax "TYPE=InnoDB" has been removed in favor of the
new syntax "ENGINE=InnoDB" in MySQL version 5.5.
The t3lib_sqlparser still rewrites those queries
to "TYPE=InnoDB" and thus the query will fail.
The new code on line 1827 should be:
)' . ($components['tableType'] ? ' ENGINE=' . $components['tableType'] : '');
Probably it should be checked for the proper MySQL version,
I'm not sure if older versions properly support "ENGINE=".
- Target version changed from 4.5.17 to 4.5.20
Bug still exists in 4.5.19.
Happens when trying to create the caching framework tables via DB Compare in install tool!
- Target version changed from 4.5.20 to 4.5.23
Still exists in 6.0.1 when trying to use the database analyzer 'compare' function to install the tables.
In 6.0.1 the mentioned line is line 1649 in the file /typo3/sysext/core/Classes/Database/SqlParser.php.
Changing 'TYPE=' to 'ENGINE=' helped.
Still exists in 6.1.3. The trick Thomas Deinhamer mentioned works.
- Subject changed from creating the default tables (Install->DB Analyser->Compare) fails with MySQL 5.5 to Add compatibility with MySQL 5.5: Replace "TYPE" with "ENGINE"
- Is Regression set to No
- Status changed from New to Closed
- Target version deleted (
4.5.23)
This issue is fixed with #50466 and released today in TYPO3 4.5.30, 4.7.15, 6.0.10 and 6.1.5
Also available in: Atom
PDF