Project

General

Profile

Actions

Bug #14529

closed

Cannot create static tables containing data with MySQL 4.x

Added by old_webbo over 19 years ago. Updated over 17 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend API
Target version:
-
Start date:
2005-02-03
Due date:
% Done:

0%

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

Description

When installing static_info_tables the tables were never created. The extension would appear to be installed OK but then each time I clicked on it in the extension manager I kept getting prompted to create the tables.

Further investigation into this problem revealed the cause came from a call to t3lib_install->getCreateTables from inside the checkDBupdates function of .\typo3\mod\tools\em\index.php.

The getCreateTables function will not strip the DEFAULT '0' text of auto_increment columns..

I added a few lines of code to the getCreateTables function that resolves the issue

(issue imported from #M748)


Files

0000748-bug_748.diff (747 Bytes) 0000748-bug_748.diff Administrator Admin, 2005-02-03 21:42

Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #14354: MySQL gt 4.1 no default value for auto incClosedIngmar Schlecht2004-10-12

Actions
Actions #1

Updated by old_webbo over 19 years ago

See attached patch file

Actions #2

Updated by old_webbo over 19 years ago

This only affects extensions which have ext_tables+adt.sql files such as static_info_tables.

But I was able to reproduce the problem using a fresh install of the Dummy-3.7.0.zip installation with the bug_416.diff patch applied on both a windows and linux installation.

Actions #3

Updated by Michael Stucki over 19 years ago

This is pretty much the same as bug #0000416 except that you are exploding the $linecontent with "\n" first. Please tell me if this step is really needed or not.

Otherwise I think this bug can be closed.

Actions #4

Updated by old_webbo over 19 years ago

Hi Stucki,

I don't believe this to be the same problem as #14354. In fact I'd already applied the bug_416.diff patch and could still consistently reproduce this problem.

#14354 addresses the problem inside of the getUpdateSuggestions() method however my fix addresses the issue inside of the getCreateTables() method.

If you follow the logic through in ./typo3/mod/tools/em/index.php file and look at the checkDBupdates() method, on line #14354 the if clause checks for the existence of a ext_tables_static+adt.sql file. If this exists, which in the case of static_info_tables it does, it first DROPS all of the tables then recreates them. It builds the CREATE statement by calling getCreateTables() which does not strip the DEFAULT '0' text and this is where the problem occurs.

Not many people have probably realised the problem because (a) it only affects extensions that have static ext_tables_static+adt.sql files; and (b) from a BE user view it appears to have installed OK and is listed in the "Loaded Extensions" but if you check the DB the tables are never created.

Hope this explains the issue better, if you need any more information from me just shout.

Cheers,

Webbo

edited on: 04.02.05 18:55

Actions #5

Updated by Michael Stucki over 19 years ago

OK, but still this is not a different bug, the solution in #14354 just seems to be false.
Can you please move this information (plus patch) there so I can close this one?

Actions #6

Updated by old_webbo over 19 years ago

Hi Stucki,

I've uploaded the patch to #14354 as requested.

Cheers,

Steve

Actions #7

Updated by Peter Russ over 19 years ago

if (TYPO3_OS=='WIN') {$table=strtolower($table);} // tablenames are always lowercase on windows!

THIS is not right, because it depends on your setup of MySql. So you can keep to have tablenames consistent to other OS.

Actions #8

Updated by Michael Stucki over 19 years ago

Thanks, so I close this one marking it as a duplicate.

Actions #9

Updated by Peter Russ over 19 years ago

'strstr' should become 'stristr'

Actions

Also available in: Atom PDF