Fix small bug only reproduced in tests about changing field names and

amldb_field object becoming modified. Novice OOP bug :-(
This commit is contained in:
stronk7
2007-03-15 19:58:47 +00:00
parent eb2a36fb55
commit dbd0f586a2
@@ -203,11 +203,14 @@ class XMLDBmysql extends XMLDBGenerator {
$results = array(); //Array where all the sentences will be stored
/// Need a clone of xmldb_field to perform the change leaving original unmodified
$xmldb_field_clone = clone($xmldb_field);
/// Change the name of the field to perform the change
$xmldb_field->setName($xmldb_field->getName() . ' ' . $newname);
$xmldb_field_clone->setName($xmldb_field_clone->getName() . ' ' . $newname);
$results[] = 'ALTER TABLE ' . $this->getTableName($xmldb_table) . ' CHANGE ' .
$this->getFieldSQL($xmldb_field);
$this->getFieldSQL($xmldb_field_clone);
return $results;
}