API CHANGE: Database::tableList() no longer returns lowercase table names

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76355 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-05-07 04:30:54 +00:00
parent 0ce07eb9cd
commit f7155ff580
2 changed files with 6 additions and 5 deletions

View File

@ -156,7 +156,10 @@ abstract class Database extends Object {
* Once * Once
*/ */
function beginSchemaUpdate() { function beginSchemaUpdate() {
$this->tableList = $this->tableList(); $this->tableList = array();
$tables = $this->tableList();
foreach($tables as $table) $this->tableList[strtolower($table)] = strtolower($table);
$this->indexList = null; $this->indexList = null;
$this->fieldList = null; $this->fieldList = null;
$this->schemaUpdateTransaction = array(); $this->schemaUpdateTransaction = array();
@ -257,7 +260,6 @@ abstract class Database extends Object {
* @param string $table The table name. * @param string $table The table name.
*/ */
function dontRequireTable($table) { function dontRequireTable($table) {
if(!isset($this->tableList)) $this->tableList = $this->tableList();
if(isset($this->tableList[strtolower($table)])) { if(isset($this->tableList[strtolower($table)])) {
$suffix = ''; $suffix = '';
while(isset($this->tableList[strtolower("_obsolete_{$table}$suffix")])) { while(isset($this->tableList[strtolower("_obsolete_{$table}$suffix")])) {

View File

@ -456,13 +456,12 @@ class MySQLDatabase extends Database {
/** /**
* Returns a list of all the tables in the database. * Returns a list of all the tables in the database.
* Table names will all be in lowercase.
* @return array * @return array
*/ */
public function tableList() { public function tableList() {
$tables = array(); $tables = array();
foreach($this->query("SHOW TABLES") as $record) { foreach($this->query("SHOW TABLES") as $record) {
$table = strtolower(reset($record)); $table = reset($record);
$tables[$table] = $table; $tables[$table] = $table;
} }
return $tables; return $tables;
@ -470,7 +469,7 @@ class MySQLDatabase extends Database {
/** /**
* Return the number of rows affected by the previous operation. * Return the number of rows affected by the previous operation.
* @return int * @return int
*/ */
public function affectedRows() { public function affectedRows() {
return mysql_affected_rows($this->dbConn); return mysql_affected_rows($this->dbConn);