Project

General

Profile

Bug #14354 » class.t3lib_install_4.diff

Administrator Admin, 2005-04-07 18:06

View differences:

t3lib/class.t3lib_install.php 7 Apr 2005 15:52:39 -0000
} else {
$lineV = ereg_replace(',$','',$value);
$parts = explode(' ',$lineV,2);
if(stristr($parts[1],'auto_increment')) {
$parts[1] = eregi_replace(' DEFAULT \'0\'','',$parts[1]);
}
if ($parts[0]!='PRIMARY' && $parts[0]!='KEY' && $parts[0]!='UNIQUE') {
$total[$isTable]['fields'][$parts[0]] = $parts[1];
} else {
......
if (is_array($info['fields'])) {
foreach($info['fields'] as $fN => $fV) {
if ($info['whole_table']) {
if(!strcmp($fN,'uid')) {
if(strstr($fV,'auto_increment')) {
$fV = eregi_replace('default \'0\'','',$fV);
}
}
$whole_table[]=$fN.' '.$fV;
} else {
if ($theKey=='extra') {
......
$field[] = 'NOT NULL';
}
if (!strstr($row['Type'],'blob') && !strstr($row['Type'],'text')) {
// This code will return a default value if the sql-file version is not 3.23 and the field is not auto-incremented. In 3.23 files, the auto-incremented fields do not have a default definition.
// Furthermore if the file is 3.22 the default value of auto-incremented fields are expected to always be zero which is why the default value is passed through intval(). Thus it should work on 3.23 MySQL servers.
if ($this->mysqlVersion!='3.23' || !stristr($row['Extra'],'auto_increment')) {
$field[] = ($this->mysqlVersion=='3.23'?'default':'DEFAULT')." '".(stristr($row['Extra'],'auto_increment')?intval($row['Default']):addslashes($row['Default']))."'";
// This code will return a default value if the field is not auto-incremented (these fields never have a default definition).
if(!stristr($row['Extra'],'auto_increment')) {
$field[] = 'DEFAULT'." '".addslashes($row['Default'])."'";
}
}
if ($this->mysqlVersion!='3.23' && !$row['Null']) {
(4-4/6)