BUGFIX #2476: Rename lowercase tables to correct casing if they have been transferred from a windows box.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90548 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-10-31 00:38:38 +00:00
parent bd452e1579
commit 50831cba9a

View File

@ -281,6 +281,11 @@ class MySQLDatabase extends SS_Database {
*/ */
public function checkAndRepairTable($tableName) { public function checkAndRepairTable($tableName) {
if(!$this->runTableCheckCommand("CHECK TABLE \"$tableName\"")) { if(!$this->runTableCheckCommand("CHECK TABLE \"$tableName\"")) {
if($this->runTableCheckCommand("CHECK TABLE \"".strtolower($tableName)."\"")){
Database::alteration_message("Table $tableName: renamed from lowercase","repaired");
return $this->renameTable(strtolower($tableName),$tableName);
}
DB::alteration_message("Table $tableName: repaired","repaired"); DB::alteration_message("Table $tableName: repaired","repaired");
return $this->runTableCheckCommand("REPAIR TABLE \"$tableName\" USE_FRM"); return $this->runTableCheckCommand("REPAIR TABLE \"$tableName\" USE_FRM");
} else { } else {