BUGFIX: Some places want tableList() to have lower case, some want native case - return both!

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90047 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2009-10-23 02:15:37 +00:00
parent 8679fd9883
commit 0b55bd5259
2 changed files with 4 additions and 3 deletions

View File

@ -119,7 +119,8 @@ abstract class Database {
/**
* Returns a list of all tables in the database.
* The table names will be in lower case.
* Keys are table names in lower case, values are table names in case that
* database expects.
* @return array
*/
protected abstract function tableList();
@ -171,7 +172,7 @@ abstract class Database {
function beginSchemaUpdate() {
$this->tableList = array();
$tables = $this->tableList();
foreach($tables as $table) $this->tableList[strtolower($table)] = strtolower($table);
foreach($tables as $table) $this->tableList[strtolower($table)] = $table;
$this->indexList = null;
$this->fieldList = null;

View File

@ -507,7 +507,7 @@ class MySQLDatabase extends Database {
$tables = array();
foreach($this->query("SHOW TABLES") as $record) {
$table = reset($record);
$tables[$table] = $table;
$tables[strtolower($table)] = $table;
}
return $tables;
}