Bug #14139

Install tool is incapable of comparing modern database dumps

Added by Ingmar Schlecht about 17 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Could have
Category:
Install Tool
Target version:
-
Start date:
2004-05-03
Due date:
% Done:

0%

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

Description

When I use the "Database Analyzer" of the Typo3 install tool to compare the current database to the file typo3conf/database.sql it shows me lots of differences although the current database is in fact exactly the same as the database.sql file so there should NOT be ANY difference.

When I look closer at it, I see that the only differences Typo3 finds is the order of things.

It says it needs to do this...
ALTER TABLE be_groups CHANGE tstamp tstamp
int(11) unsigned NOT NULL default '0';

...because the current value is this:
int(11) unsigned DEFAULT '0' NOT NULL

This bug is present in the install tool as well as in the extension manager.

I might be able to provide a fix for this when I've got some spare time, so I'll assign this bug to me.
(issue imported from #M55)


Related issues

Related to TYPO3 Core - Bug #14354: MySQL gt 4.1 no default value for auto incClosedIngmar Schlecht2004-10-12

Actions
Has duplicate TYPO3 Core - Bug #14336: Database analyzer gives stupid Alter statements by comparing existing schema with database.sqlClosedIngmar Schlecht2004-09-22

Actions
#1

Updated by Ingmar Schlecht about 17 years ago

quick and DIRTY (!) fix for t3lib_install:

Replace the line:
} elseif (strcmp($FDcomp[$table][$theKey][$fieldN], $fieldC)){
with:
} elseif (strcmp($this->getNormalizedFieldDefinition($fieldC), $this->getNormalizedFieldDefinition($FDcomp[$table][$theKey][$fieldN]))){

And somewhere below insert this new function:

function getNormalizedFieldDefinition($FD) {
// remove duplicate spaces and convert to upper case
$FD = ereg_replace(' +',' ',strtoupper($FD));
$mysqlExpressions = array(
'NOT NULL' => 'not_null',
"DEFAULT \'([^']*)\'" => 'default_\\1', // DOES THIS DOES NOT WORK STABLE!
);
foreach($mysqlExpressions as $mysqlExpression => $replacement) {
$FD = ereg_replace($mysqlExpression,$replacement,$FD);
}
if(strstr($FD,'AUTO_INCREMENT')) {
$FD = str_replace('default_0','',$FD);
}
$parts = t3lib_div::trimExplode(' ',$FD);
sort($parts);
if(!strcmp($parts[0],'')) unset ($parts[0]);
return implode($parts,',');
}
#2

Updated by old_facorreia almost 17 years ago

I have a similar situation, but it is not only the order of things:

ALTER TABLE be_groups CHANGE uid uid int(11) unsigned NOT NULL auto_increment;
Current value: int(11) unsigned DEFAULT '0' NOT NULL auto_increment

The difference is that the Current value has DEFAULT '0' and the definition doesn't.

#3

Updated by Michael Stucki about 16 years ago

Should be fixed in 3.8.0beta2 - please reopen if this is wrong.

#4

Updated by Peter Niederlag about 16 years ago

I still find these problems wit 3.8.0beta2 as well as current HEAD.

Install-Tool->Update required tables->COMPARE

ALTER TABLE be_groups CHANGE uid uid int(11) DEFAULT '0' NOT NULL auto_increment;
Current value: int(11) unsigned DEFAULT '0' NOT NULL auto_increment
.....
.....

#5

Updated by Peter Niederlag almost 16 years ago

seems finally solved.
Thx to all bugfixers

Also available in: Atom PDF