Bug #25067

creating the default tables (Install->DB Analyser->Compare) fails with MySQL 5.5

Added by Christian Hernmarck over 2 years ago. Updated 3 months ago.

Status:New Start date:2011-02-17
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:4.5.23
TYPO3 Version:4.5 Complexity:
PHP Version:
Votes: 2 (View)

Description

When using MySQL 5.5 (as in the new xampp packages) you cannot install the default tables in the install tool....

Install MySQL 5.5, setup a new TYPO3 -> Install tool, try to create the default tables...

The install tool uses the "type" table option to specify the table storage engine.
this option is no more supported in MySQL 5.5:
"Removed Features:
The TYPE table option to specify the storage engine for CREATE TABLE or ALTER TABLE (use ENGINE)."

MySQL < 5.5:
table_option: {ENGINE|TYPE} [=] engine_name

MySQL 5.5:
table_option:
ENGINE [=] engine_name

the sqlparser (class.t3lib_sqlparser.php) uses TYPE this should be changed to ENGINE.
line 1823:
// Make query:
$query = 'CREATE TABLE ' . $components['TABLE'] . ' (
' . implode(',
', $fieldsKeys) . '
)' . ($components['tableType'] ? ' TYPE=' . $components['tableType'] : '');

(issue imported from #M17629)

History

Updated by Chris topher over 2 years ago

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.

Updated by Christian Hernmarck over 2 years ago

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....

Updated by Chris topher over 2 years ago

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. :-)

Updated by Christian Hernmarck over 2 years ago

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)...

Updated by Thomas Deinhamer 11 months ago

  • 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=".

Updated by Navi 8 months ago

  • 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!

Updated by Thomas Deinhamer 3 months ago

  • 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.

Also available in: Atom PDF