mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
8679fd9883
commit
0b55bd5259
@ -119,7 +119,8 @@ abstract class Database {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of all tables in the 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
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected abstract function tableList();
|
protected abstract function tableList();
|
||||||
@ -171,7 +172,7 @@ abstract class Database {
|
|||||||
function beginSchemaUpdate() {
|
function beginSchemaUpdate() {
|
||||||
$this->tableList = array();
|
$this->tableList = array();
|
||||||
$tables = $this->tableList();
|
$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->indexList = null;
|
||||||
$this->fieldList = null;
|
$this->fieldList = null;
|
||||||
|
@ -507,7 +507,7 @@ class MySQLDatabase extends Database {
|
|||||||
$tables = array();
|
$tables = array();
|
||||||
foreach($this->query("SHOW TABLES") as $record) {
|
foreach($this->query("SHOW TABLES") as $record) {
|
||||||
$table = reset($record);
|
$table = reset($record);
|
||||||
$tables[$table] = $table;
|
$tables[strtolower($table)] = $table;
|
||||||
}
|
}
|
||||||
return $tables;
|
return $tables;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user