Bug #14139
closedInstall tool is incapable of comparing modern database dumps
0%
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)
Updated by Ingmar Schlecht over 20 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,',');
}
Updated by old_facorreia over 20 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.
Updated by Michael Stucki over 19 years ago
Should be fixed in 3.8.0beta2 - please reopen if this is wrong.
Updated by Peter Niederlag over 19 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
.....
.....
Updated by Peter Niederlag over 19 years ago
seems finally solved.
Thx to all bugfixers