mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
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 #2670
This commit is contained in:
parent
4b3d8612e9
commit
8c611b236d
4 changed files with 8 additions and 6 deletions
|
@ -297,7 +297,8 @@ class Mysql extends DboSource {
|
||||||
* @throws CakeException
|
* @throws CakeException
|
||||||
*/
|
*/
|
||||||
public function describe($model) {
|
public function describe($model) {
|
||||||
$cache = parent::describe($model);
|
$key = $this->fullTableName($model, false);
|
||||||
|
$cache = parent::describe($key);
|
||||||
if ($cache != null) {
|
if ($cache != null) {
|
||||||
return $cache;
|
return $cache;
|
||||||
}
|
}
|
||||||
|
@ -331,7 +332,7 @@ class Mysql extends DboSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->_cacheDescription($this->fullTableName($model, false), $fields);
|
$this->_cacheDescription($key, $fields);
|
||||||
$cols->closeCursor();
|
$cols->closeCursor();
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,8 +186,8 @@ class Postgres extends DboSource {
|
||||||
* @return array Fields in table. Keys are name and type
|
* @return array Fields in table. Keys are name and type
|
||||||
*/
|
*/
|
||||||
public function describe($model) {
|
public function describe($model) {
|
||||||
$fields = parent::describe($model);
|
|
||||||
$table = $this->fullTableName($model, false, false);
|
$table = $this->fullTableName($model, false, false);
|
||||||
|
$fields = parent::describe($table);
|
||||||
$this->_sequenceMap[$table] = array();
|
$this->_sequenceMap[$table] = array();
|
||||||
$cols = null;
|
$cols = null;
|
||||||
|
|
||||||
|
|
|
@ -160,11 +160,11 @@ class Sqlite extends DboSource {
|
||||||
* @return array Fields in table. Keys are name and type
|
* @return array Fields in table. Keys are name and type
|
||||||
*/
|
*/
|
||||||
public function describe($model) {
|
public function describe($model) {
|
||||||
$cache = parent::describe($model);
|
$table = $this->fullTableName($model, false, false);
|
||||||
|
$cache = parent::describe($table);
|
||||||
if ($cache != null) {
|
if ($cache != null) {
|
||||||
return $cache;
|
return $cache;
|
||||||
}
|
}
|
||||||
$table = $this->fullTableName($model, false, false);
|
|
||||||
$fields = array();
|
$fields = array();
|
||||||
$result = $this->_execute('PRAGMA table_info(' . $table . ')');
|
$result = $this->_execute('PRAGMA table_info(' . $table . ')');
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,8 @@ class Sqlserver extends DboSource {
|
||||||
* @throws CakeException
|
* @throws CakeException
|
||||||
*/
|
*/
|
||||||
public function describe($model) {
|
public function describe($model) {
|
||||||
$cache = parent::describe($model);
|
$table = $this->fullTableName($model, false);
|
||||||
|
$cache = parent::describe($table);
|
||||||
if ($cache != null) {
|
if ($cache != null) {
|
||||||
return $cache;
|
return $cache;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue