diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index cc3f5860c..5686798a7 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -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; } diff --git a/lib/Cake/Model/Datasource/Database/Postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php index 0bc35d5c1..3aa1976b0 100644 --- a/lib/Cake/Model/Datasource/Database/Postgres.php +++ b/lib/Cake/Model/Datasource/Database/Postgres.php @@ -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; diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php index 3d2be70be..e60f128a8 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlite.php +++ b/lib/Cake/Model/Datasource/Database/Sqlite.php @@ -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 . ')'); diff --git a/lib/Cake/Model/Datasource/Database/Sqlserver.php b/lib/Cake/Model/Datasource/Database/Sqlserver.php index 392a30ea6..1081d1609 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlserver.php +++ b/lib/Cake/Model/Datasource/Database/Sqlserver.php @@ -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; }