Fixing missed cache reads for table schema.

Because cache keys were different, model schema would not be read from
the cache.  Make keys used consistent.

Fixes 
This commit is contained in:
mark_story 2012-03-11 10:24:05 -04:00
parent 4b3d8612e9
commit 8c611b236d
4 changed files with 8 additions and 6 deletions
lib/Cake/Model/Datasource/Database

View file

@ -297,7 +297,8 @@ class Mysql extends DboSource {
* @throws CakeException
*/
public function describe($model) {
$cache = parent::describe($model);
$key = $this->fullTableName($model, false);
$cache = parent::describe($key);
if ($cache != null) {
return $cache;
}
@ -331,7 +332,7 @@ class Mysql extends DboSource {
}
}
}
$this->_cacheDescription($this->fullTableName($model, false), $fields);
$this->_cacheDescription($key, $fields);
$cols->closeCursor();
return $fields;
}

View file

@ -186,8 +186,8 @@ class Postgres extends DboSource {
* @return array Fields in table. Keys are name and type
*/
public function describe($model) {
$fields = parent::describe($model);
$table = $this->fullTableName($model, false, false);
$fields = parent::describe($table);
$this->_sequenceMap[$table] = array();
$cols = null;

View file

@ -160,11 +160,11 @@ class Sqlite extends DboSource {
* @return array Fields in table. Keys are name and type
*/
public function describe($model) {
$cache = parent::describe($model);
$table = $this->fullTableName($model, false, false);
$cache = parent::describe($table);
if ($cache != null) {
return $cache;
}
$table = $this->fullTableName($model, false, false);
$fields = array();
$result = $this->_execute('PRAGMA table_info(' . $table . ')');

View file

@ -201,7 +201,8 @@ class Sqlserver extends DboSource {
* @throws CakeException
*/
public function describe($model) {
$cache = parent::describe($model);
$table = $this->fullTableName($model, false);
$cache = parent::describe($table);
if ($cache != null) {
return $cache;
}